[netcdf4-python] 01/06: Imported Upstream version 1.2.8
Bas Couwenberg
sebastic at debian.org
Sun May 28 07:20:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository netcdf4-python.
commit 03c57f9cfa351341fdbd1bbb4ff5a3adc60853c8
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sun May 28 08:44:53 2017 +0200
Imported Upstream version 1.2.8
---
.travis.yml | 8 +-
Changelog | 25 +
MANIFEST.in | 4 +-
PKG-INFO | 56 +-
README.md | 34 +-
README.release | 8 +-
appveyor.yml | 46 +-
conda.recipe/meta.yaml | 66 +-
conda.recipe/run_test.py | 12 +-
docs/netCDF4/index.html | 264 +-
examples/tutorial.py | 4 +-
include/constants.pyx | 4 -
include/netCDF4.pxi | 5 +
netCDF4/__init__.py | 2 +-
netCDF4/_netCDF4.c | 85723 ---------------------------------------------
netCDF4/_netCDF4.pyx | 447 +-
netCDF4/utils.py | 4 +-
netcdftime/_netcdftime.c | 35225 -------------------
setup.py | 66 +-
test/tst_Unsigned.py | 27 +
test/tst_compoundatt.py | 11 +-
test/tst_multifile.py | 2 +-
test/tst_multifile2.py | 2 +-
test/tst_netcdftime.py | 7 +
test/tst_open_mem.py | 32 +
test/tst_stringarr.py | 56 +-
test/tst_unicode.py | 2 -
test/tst_unicode3.py | 2 -
test/tst_unicodeatt.py | 35 +
test/ubyte.nc | Bin 0 -> 152 bytes
30 files changed, 895 insertions(+), 121284 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 92e7881..a6cb3aa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,9 +16,9 @@ env:
python:
- "2.7"
- - "3.4"
- "3.5"
- - "3.6-dev"
+ - "3.6"
+ - "3.7-dev"
matrix:
include:
@@ -26,10 +26,6 @@ matrix:
- python: 2.7
env:
- DEPENDS="numpy==1.7.0 cython==0.19 ordereddict==1.1"
- # Test without Cython installed.
- - python: 2.7
- env:
- - DEPENDS="numpy ordereddict"
notifications:
email: false
diff --git a/Changelog b/Changelog
index b14e4b3..7e2b48d 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,28 @@
+ version 1.2.8 (tag v1.2.8rel)
+==============================
+ * recognize _Unsigned attribute used by netcdf-java to designate unsigned
+ integer data stored with a signed integer type in netcdf-3 (issue #656).
+ * add Dataset init memory parameter to allow loading a file from memory
+ (pull request #652, issues #406 and #295).
+ * fix for negative times in num2date (issue #659).
+ * fix for failing tests in numpy 1.13 due to changes in numpy.ma (issue #662).
+ * Checking for _Encoding attribute for NC_STRING variables, otherwise use
+ 'utf-8'. 'utf-8' is used everywhere else, 'default_encoding' global module
+ variable is no longer used. getncattr method now takes optional kwarg
+ 'encoding' (default 'utf-8') so encoding of attributes can be specified
+ if desired. If _Encoding is specified for an NC_CHAR ('S1') variable,
+ the chartostring utility function is used to convert the array of
+ characters to an array of strings with one less dimension (the last
+ dimension is interpreted as the length of each string) when reading the
+ data. When writing the data, stringtochar is used to convert a numpy
+ array of fixed length strings to an array of characters with one more
+ dimension. chartostring and stringtochar now also have an 'encoding' kwarg.
+ Automatic conversion to/from character to string arrays can be turned off
+ via a new set_auto_chartostring Dataset and Variable method (default
+ is True). Addresses issue #654.
+ * Cython >= 0.19 now required, _netCDF4.c and _netcdftime.c removed from
+ repository.
+
version 1.2.7 (tag v1.2.7rel)
==============================
* fix for issue #624 (error in conversion to masked array when variable slice
diff --git a/MANIFEST.in b/MANIFEST.in
index f0a2beb..f35c12c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
recursive-include docs *
recursive-include man *
-recursive-include include *
recursive-include conda.recipe
include MANIFEST.in
include README.md
@@ -20,8 +19,7 @@ include utils/nc4tonc3
include utils/ncinfo
include netcdftime/__init__.py
include netcdftime/_netcdftime.pyx
-include netcdftime/_netcdftime.c
include netCDF4/__init__.py
include netCDF4/_netCDF4.pyx
include netCDF4/utils.py
-include netCDF4/_netCDF4.c
+include include/netCDF4.pxi
diff --git a/PKG-INFO b/PKG-INFO
index 088aa9d..06e5b8e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,17 +1,47 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
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
+Version: 1.2.8
Author: Jeff Whitaker
-Author-email: jeffrey.s.whitaker at 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
+Author-email: jeffrey s whitaker at noaa gov
+Home-page: https://github.com/Unidata/netcdf4-python
+Summary: python/numpy interface to netCDF library (versions 3 and 4)
+License: OSI Approved
+Description: 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,
+ variable length (vlen), and enumerated (enum) data types are supported, but
+ the opaque type is not. Mixtures of compound, vlen and/or enum data types are not supported.
+
+ This project has a `Github repository
+ <https://github.com/Unidata/netcdf4-python>`_ where you may access
+ the most
+ up-to-date source.
+
+ `Documentation
+ <http://unidata.github.io/netcdf4-python>`_
+
+ `Changelog
+ <https://github.com/Unidata/netcdf4-python/blob/master/Changelog>`_
+
+ Also available in the `Anaconda scientific python distribution <https://store.continuum.io/cshop/anaconda/>`_
+
+ Download source tarball and binary wheels below...
+Keywords: numpy netcdf data science network oceanography meteorology climate
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
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Topic :: Scientific/Engineering
+
diff --git a/README.md b/README.md
index 2451122..e1b7506 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,35 @@
## News
For the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog).
-1/8/2017: Version [1.2.7](https://github.com/Unidata/netcdf4-python/releases/tag/v1.2.7rel) released.
+6/1/2017: Version [1.2.8](https://pypi.python.org/pypi/netCDF4/1.2.8) released. From Changelog:
+ * recognize `_Unsigned` attribute used by [netcdf-java](http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/)
+ to designate unsigned integer data stored with a signed integer type in netcdf-3
+ [issue #656](https://github.com/Unidata/netcdf4-python/issues/656).
+ * add Dataset init memory parameter to allow loading a file from memory
+ [pull request #652](https://github.com/Unidata/netcdf4-python/pull/652),
+ [issue #406](https://github.com/Unidata/netcdf4-python/issues/406) and
+ [issue #295](https://github.com/Unidata/netcdf4-python/issues/295).
+ * fix for negative times in num2date [issue #659](https://github.com/Unidata/netcdf4-python/pull/659).
+ * fix for failing tests in numpy 1.13 due to changes in `numpy.ma`
+ [issue #662](https://github.com/Unidata/netcdf4-python/issues/662).
+ * Checking for `_Encoding` attribute for `NC_STRING` variables, otherwise use
+ 'utf-8'. 'utf-8' is used everywhere else, 'default_encoding' global module
+ variable is no longer used. getncattr method now takes optional kwarg
+ 'encoding' (default 'utf-8') so encoding of attributes can be specified
+ if desired. If `_Encoding` is specified for an `NC_CHAR` (`'S1'`) variable,
+ the chartostring utility function is used to convert the array of
+ characters to an array of strings with one less dimension (the last
+ dimension is interpreted as the length of each string) when reading the
+ data. When writing the data, stringtochar is used to convert a numpy
+ array of fixed length strings to an array of characters with one more
+ dimension. chartostring and stringtochar now also have an 'encoding' kwarg.
+ Automatic conversion to/from character to string arrays can be turned off
+ via a new `set_auto_chartostring` Dataset and Variable method (default
+ is `True`). Addresses [issue #654](https://github.com/Unidata/netcdf4-python/issues/654)
+ * [Cython](http://cython.org) >= 0.19 now required, `_netCDF4.c` and `_netcdftime.c` removed from
+ repository.
+
+1/8/2017: Version [1.2.7](https://pypi.python.org/pypi/netCDF4/1.2.7) released.
Python 3.6 compatibility, and fix for vector missing_values.
12/10/2016: Version [1.2.6](https://pypi.python.org/pypi/netCDF4/1.2.6) released.
@@ -85,8 +113,8 @@ 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 [numpy](http://www.numpy.org/) and [Cython](http://cython.org/) are
+ installed and you have [Python](https://www.python.org) 2.7 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`
diff --git a/README.release b/README.release
index 5cba50e..f03a8fa 100644
--- a/README.release
+++ b/README.release
@@ -2,10 +2,8 @@
* make sure version number in setup.py and netCDF4/_netCDF4.pyx are up to date
(in _netCDF4.pyx, change 'Version' in first line of docstring at top of file,
and __version__ variable). If netcdftime module has any updates,
- increment __version__ in netcdftime/_netcdftime.pyx. Regenerate netcdftime/_netcdftime.c
- from _netcdftime.pyx as needed.
-* make sure include/constants.pyx has all zeros, then generate C source by
- running 'cython -I../include _netCDF4.pyx' in the netCDF4 directory.
+ increment __version__ in netcdftime/_netcdftime.pyx. Update version number in
+ PKG_INFO.
* update Changelog and README.md as needed.
* commit and push all of the above changes.
* install the module (python setup.py install), then run 'sh create_docs.sh'
@@ -15,6 +13,8 @@
git tag -a vX.Y.Zrel -m "version X.Y.Z release"
git push origin --tags
* push an empty commit to the netcdf4-python-wheels repo to trigger new builds.
+ You will likely want to edit the .travis.yml file at
+ https://github.com/MacPython/netcdf4-python-wheels to specify the BUILD_COMMIT before triggering a build.
* update the pypi entry, upload the macosx wheels and the windows wheels
from Christoph Gohkle's site. Lastly, create a source tarball using
'python setup.py sdist' and upload to pypi.
diff --git a/appveyor.yml b/appveyor.yml
index 38595a3..e324dc6 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,37 +1,23 @@
environment:
- CONDA_INSTALL_LOCN: "C:\\conda"
-
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
- # Workaround for https://github.com/conda/conda-build/issues/636
- PYTHONIOENCODING: "UTF-8"
- PYTHONUNBUFFERED: "1"
-
- # We set a default Python version for the miniconda that is to be installed.
- # This can be overridden in the matrix definition where appropriate.
- CONDA_PY: "27"
-
matrix:
- - TARGET_ARCH: x86
- CONDA_NPY: 111
- CONDA_PY: 27
-
- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_PY: 27
-
- - TARGET_ARCH: x86
- CONDA_NPY: 111
- CONDA_PY: 36
+ CONDA_INSTALL_LOCN: C:\\Miniconda-x64
- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_PY: 36
+ CONDA_INSTALL_LOCN: C:\\Miniconda35-x64
+# We always use a 64-bit machine, but can build x86 distributions
+# with the TARGET_ARCH variable.
platform:
- x64
@@ -46,23 +32,21 @@ install:
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- # Set the CONDA_NPY, although it has no impact on the actual build.
- # We need this because of a test within conda-build.
- - cmd: set CONDA_NPY=19
+ # Add path, activate `conda` and update conda.
+ - cmd: set "PATH=%CONDA_INSTALL_LOCN%\\Scripts;%CONDA_INSTALL_LOCN%\\Library\\bin;%PATH%"
+ - cmd: conda update --yes --quiet conda
+ - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- # Use the pre-installed Miniconda for the desired arch.
- - ps: if($env:TARGET_ARCH -eq 'x86')
- {$root = "C:\Miniconda"}
- else
- {$root = "C:\Miniconda-x64"}
- $env:path="$root;$root\Scripts;$root\Library\bin;$($env:path)"
+ - cmd: set PYTHONUNBUFFERED=1
- # Update conda.
- - cmd: conda update --yes --quiet conda
+ # Ensure defaults and conda-forge channels are present.
+ - cmd: conda config --set show_channel_urls true
+ - cmd: conda config --remove channels defaults
+ - cmd: conda config --add channels defaults
+ - cmd: conda config --add channels conda-forge
# Conda build tools.
- - cmd: conda config --add channels conda-forge --force
- - cmd: conda install --yes --quiet obvious-ci
+ - cmd: conda install -n root --quiet --yes obvious-ci
- cmd: obvci_install_conda_build_tools.py
- cmd: conda info
diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml
index bebc347..e363858 100644
--- a/conda.recipe/meta.yaml
+++ b/conda.recipe/meta.yaml
@@ -1,45 +1,47 @@
{% set version = "dev" %}
package:
- name: netcdf4
- version: {{ version }}
+ name: netcdf4
+ version: {{ version }}
source:
- path: ../
+ path: ../
build:
- number: 0
- entry_points:
- - ncinfo = netCDF4.utils:ncinfo
- - nc4tonc3 = netCDF4.utils:nc4tonc3
- - nc3tonc4 = netCDF4.utils:nc3tonc4
+ number: 0
+ entry_points:
+ - ncinfo = netCDF4.utils:ncinfo
+ - nc4tonc3 = netCDF4.utils:nc4tonc3
+ - nc3tonc4 = netCDF4.utils:nc3tonc4
requirements:
- build:
- - python
- - setuptools
- - cython
- - numpy x.x
- - msinttypes # [win and py<35]
- - hdf5 1.8.15.1
- - libnetcdf
- run:
- - python
- - setuptools
- - numpy x.x
- - hdf5 1.8.15.1
- - libnetcdf
+ build:
+ - python
+ - setuptools
+ - cython
+ - numpy x.x
+ - msinttypes # [win and py<35]
+ - hdf5 1.8.17|1.8.17.*
+ - libnetcdf 4.4.*
+ run:
+ - python
+ - setuptools
+ - numpy x.x
+ - hdf5 1.8.17|1.8.17.*
+ - libnetcdf 4.4.*
test:
- imports:
- - netCDF4
- - netcdftime
- commands:
- - ncinfo -h
- - nc4tonc3 -h
- - nc3tonc4 -h
+ source_files:
+ - test
+ imports:
+ - netCDF4
+ - netcdftime
+ commands:
+ - ncinfo -h
+ - nc4tonc3 -h
+ - nc3tonc4 -h
about:
- home: http://github.com/Unidata/netcdf4-python
- license: OSI Approved
- summary: Provides an object-oriented python interface to the netCDF version 4 library.
+ home: http://github.com/Unidata/netcdf4-python
+ license: OSI Approved
+ summary: 'Provides an object-oriented python interface to the netCDF version 4 library..'
diff --git a/conda.recipe/run_test.py b/conda.recipe/run_test.py
index d59fda9..a3a4a52 100644
--- a/conda.recipe/run_test.py
+++ b/conda.recipe/run_test.py
@@ -1,14 +1,8 @@
import os
import netCDF4
-# Check OPeNDAP functionality.
-url = 'http://geoport-dev.whoi.edu/thredds/dodsC/estofs/atlantic'
-nc = netCDF4.Dataset(url)
-
-# Check if it was compiled with cython.
-assert nc.filepath() == url
-
-# Run the unittests.
-test_dir = os.path.join(os.environ['SRC_DIR'], 'test')
+# Run the unittests, skipping the opendap test.
+test_dir = os.path.join('test')
os.chdir(test_dir)
+os.environ['NO_NET']='1'
os.system('python run_all.py')
diff --git a/docs/netCDF4/index.html b/docs/netCDF4/index.html
index 517fb47..5977c7c 100644
--- a/docs/netCDF4/index.html
+++ b/docs/netCDF4/index.html
@@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<title>netCDF4 API documentation</title>
- <meta name="description" content="Version 1.2.7
+ <meta name="description" content="Version 1.2.8
-------------
- - -
@@ -908,8 +908,10 @@ table {
.codehilite .mh { color: #666666 } /* Literal.Number.Hex */
.codehilite .mi { color: #666666 } /* Literal.Number.Integer */
.codehilite .mo { color: #666666 } /* Literal.Number.Oct */
+.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
+.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
.codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
@@ -920,9 +922,11 @@ table {
.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
+.codehilite .fm { color: #0000FF } /* Name.Function.Magic */
.codehilite .vc { color: #19177C } /* Name.Variable.Class */
.codehilite .vg { color: #19177C } /* Name.Variable.Global */
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
+.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
@@ -1092,6 +1096,7 @@ table {
<li class="mono"><a href="#netCDF4.Dataset.renameDimension">renameDimension</a></li>
<li class="mono"><a href="#netCDF4.Dataset.renameGroup">renameGroup</a></li>
<li class="mono"><a href="#netCDF4.Dataset.renameVariable">renameVariable</a></li>
+ <li class="mono"><a href="#netCDF4.Dataset.set_auto_chartostring">set_auto_chartostring</a></li>
<li class="mono"><a href="#netCDF4.Dataset.set_auto_mask">set_auto_mask</a></li>
<li class="mono"><a href="#netCDF4.Dataset.set_auto_maskandscale">set_auto_maskandscale</a></li>
<li class="mono"><a href="#netCDF4.Dataset.set_auto_scale">set_auto_scale</a></li>
@@ -1147,6 +1152,7 @@ table {
<li class="mono"><a href="#netCDF4.Group.renameDimension">renameDimension</a></li>
<li class="mono"><a href="#netCDF4.Group.renameGroup">renameGroup</a></li>
<li class="mono"><a href="#netCDF4.Group.renameVariable">renameVariable</a></li>
+ <li class="mono"><a href="#netCDF4.Group.set_auto_chartostring">set_auto_chartostring</a></li>
<li class="mono"><a href="#netCDF4.Group.set_auto_mask">set_auto_mask</a></li>
<li class="mono"><a href="#netCDF4.Group.set_auto_maskandscale">set_auto_maskandscale</a></li>
<li class="mono"><a href="#netCDF4.Group.set_auto_scale">set_auto_scale</a></li>
@@ -1179,6 +1185,7 @@ table {
<li class="mono"><a href="#netCDF4.MFDataset.renameDimension">renameDimension</a></li>
<li class="mono"><a href="#netCDF4.MFDataset.renameGroup">renameGroup</a></li>
<li class="mono"><a href="#netCDF4.MFDataset.renameVariable">renameVariable</a></li>
+ <li class="mono"><a href="#netCDF4.MFDataset.set_auto_chartostring">set_auto_chartostring</a></li>
<li class="mono"><a href="#netCDF4.MFDataset.set_auto_mask">set_auto_mask</a></li>
<li class="mono"><a href="#netCDF4.MFDataset.set_auto_maskandscale">set_auto_maskandscale</a></li>
<li class="mono"><a href="#netCDF4.MFDataset.set_auto_scale">set_auto_scale</a></li>
@@ -1201,6 +1208,7 @@ table {
<ul>
<li class="mono"><a href="#netCDF4.MFTime.__init__">__init__</a></li>
<li class="mono"><a href="#netCDF4.MFTime.ncattrs">ncattrs</a></li>
+ <li class="mono"><a href="#netCDF4.MFTime.set_auto_chartostring">set_auto_chartostring</a></li>
<li class="mono"><a href="#netCDF4.MFTime.set_auto_mask">set_auto_mask</a></li>
<li class="mono"><a href="#netCDF4.MFTime.set_auto_maskandscale">set_auto_maskandscale</a></li>
<li class="mono"><a href="#netCDF4.MFTime.set_auto_scale">set_auto_scale</a></li>
@@ -1234,6 +1242,7 @@ table {
<li class="mono"><a href="#netCDF4.Variable.group">group</a></li>
<li class="mono"><a href="#netCDF4.Variable.ncattrs">ncattrs</a></li>
<li class="mono"><a href="#netCDF4.Variable.renameAttribute">renameAttribute</a></li>
+ <li class="mono"><a href="#netCDF4.Variable.set_auto_chartostring">set_auto_chartostring</a></li>
<li class="mono"><a href="#netCDF4.Variable.set_auto_mask">set_auto_mask</a></li>
<li class="mono"><a href="#netCDF4.Variable.set_auto_maskandscale">set_auto_maskandscale</a></li>
<li class="mono"><a href="#netCDF4.Variable.set_auto_scale">set_auto_scale</a></li>
@@ -1259,7 +1268,7 @@ table {
<header id="section-intro">
<h1 class="title"><span class="name">netCDF4</span> module</h1>
- <h2>Version 1.2.7</h2>
+ <h2>Version 1.2.8</h2>
<hr />
<h1>Introduction</h1>
<p>netcdf4-python is a Python interface to the netCDF C library. </p>
@@ -1571,8 +1580,8 @@ method returns an instance of the <a href="#netCDF4.Variable"><code>Variable</co
used later to access and set variable data and attributes.</p>
<div class="codehilite"><pre><span></span><span class="o">>>></span> <span class="n">times</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"time"</span><span class="p">,</span><span class="s2">"f8"</span><span class="p">,(</span><span class="s2">"time"</span><span class="p">,))</span>
<span class="o">>>></span> <span class="n">levels</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"level"</span><span class="p">,</span><span class="s2">"i4"</span><span class="p">,(</span><span class="s2">"level"</span><span class="p">,))</span>
-<span class="o">>>></span> <span class="n">latitudes</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"latitude"</span><span class="p">,</span><span class="s2">"f4"</span><span class="p">,(</span><span class="s2">"lat"</span><span class="p">,))</span>
-<span class="o">>>></span> <span class="n">longitudes</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"longitude"</span><span class="p">,</span><span class="s2">"f4"</span><span class="p">,(</span><span class="s2">"lon"</span><span class="p">,))</span>
+<span class="o">>>></span> <span class="n">latitudes</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"lat"</span><span class="p">,</span><span class="s2">"f4"</span><span class="p">,(</span><span class="s2">"lat"</span><span class="p">,))</span>
+<span class="o">>>></span> <span class="n">longitudes</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"lon"</span><span class="p">,</span><span class="s2">"f4"</span><span class="p">,(</span><span class="s2">"lon"</span><span class="p">,))</span>
<span class="o">>>></span> <span class="c1"># two dimensions unlimited</span>
<span class="o">>>></span> <span class="n">temp</span> <span class="o">=</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">createVariable</span><span class="p">(</span><span class="s2">"temp"</span><span class="p">,</span><span class="s2">"f4"</span><span class="p">,(</span><span class="s2">"time"</span><span class="p">,</span><span class="s2">"level"</span><span class="p">,</span><span class="s2">"lat" [...]
</pre></div>
@@ -1618,8 +1627,8 @@ Python dictionary, in the same way as the dimensions:</p>
<div class="codehilite"><pre><span></span><span class="o">>>></span> <span class="k">print</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">variables</span>
<span class="n">OrderedDict</span><span class="p">([(</span><span class="s2">"time"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4ba70</span><span class="o">></span><span class="p">),</span>
<span class="p">(</span><span class="s2">"level"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4bab0</span><span class="o">></span><span class="p">),</span>
- <span class="p">(</span><span class="s2">"latitude"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4baf0</span><span class="o">></span><span class="p">),</span>
- <span class="p">(</span><span class="s2">"longitude"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4bb30</span><span class="o">></span><span class="p">),</span>
+ <span class="p">(</span><span class="s2">"lat"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4baf0</span><span class="o">></span><span class="p">),</span>
+ <span class="p">(</span><span class="s2">"lon"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4bb30</span><span class="o">></span><span class="p">),</span>
<span class="p">(</span><span class="s2">"temp"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">Variable</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1b4bb70</span><span class="o">></span><span class="p">)])</span>
</pre></div>
@@ -1665,10 +1674,10 @@ and attributes that cannot (or should not) be modified by the user.</p>
<p>The <code>__dict__</code> attribute of a <a href="#netCDF4.Dataset"><code>Dataset</code></a>, <a href="#netCDF4.Group"><code>Group</code></a> or <a href="#netCDF4.Variable"><code>Variable</code></a>
instance provides all the netCDF attribute name/value pairs in a python
dictionary:</p>
-<div class="codehilite"><pre><span></span><span class="o">>>></span> <span class="k">print</span> <span class="n">rootgrp</span><span class="o">.</span><span class="n">__dict__</span>
-<span class="n">OrderedDict</span><span class="p">([(</span><span class="s2">u"description"</span><span class="p">,</span> <span class="s2">u"bogus example script"</span><span class="p">),</span>
- <span class="p">(</span><span class="s2">u"history"</span><span class="p">,</span> <span class="s2">u"Created Thu Mar 3 19:30:33 2011"</span><span class="p">),</span>
- <span class="p">(</span><span class="s2">u"source"</span><span class="p">,</span> <span class="s2">u"netCDF4 python module tutorial"</span><span class="p">)])</span>
+<div class="codehilite"><pre><span></span><span class="o">>>></span> <span class="k">print</span> <span class="n">rootgrp</span><span class="o">.</span><span class="vm">__dict__</span>
+<span class="n">OrderedDict</span><span class="p">([(</span><span class="sa">u</span><span class="s2">"description"</span><span class="p">,</span> <span class="sa">u</span><span class="s2">"bogus example script"</span><span class="p">),</span>
+ <span class="p">(</span><span class="sa">u</span><span class="s2">"history"</span><span class="p">,</span> <span class="sa">u</span><span class="s2">"Created Thu Mar 3 19:30:33 2011"</span><span class="p">),</span>
+ <span class="p">(</span><span class="sa">u</span><span class="s2">"source"</span><span class="p">,</span> <span class="sa">u</span><span class="s2">"netCDF4 python module tutorial"</span><span class="p">)])</span>
</pre></div>
@@ -1766,7 +1775,7 @@ will be a numpy scalar array.</p>
<p>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 <code>hours since YY:MM:DD hh-mm-ss</code>. These units can be
+specified like <code>hours since YY-MM-DD hh:mm:ss</code>. These units can be
awkward to deal with, without a utility to convert the values to and
from calendar dates. The function called <a href="#netCDF4.num2date"><code>num2date</code></a> and <a href="#netCDF4.date2num"><code>date2num</code></a> are
provided with this package to do just that. Here's an example of how they
@@ -1942,7 +1951,7 @@ objects gives useful summary information in an interactive session:</p>
<span class="o">>>></span> <span class="k">print</span> <span class="n">f</span><span class="o">.</span><span class="n">cmptypes</span>
<span class="n">OrderedDict</span><span class="p">([(</span><span class="s2">"complex128"</span><span class="p">,</span> <span class="o"><</span><span class="n">netCDF4</span><span class="o">.</span><span class="n">CompoundType</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x1029eb7e8</span><span class="o">></span><span class="p">)])</span>
<span class="o">>>></span> <span class="k">print</span> <span class="n">f</span><span class="o">.</span><span class="n">cmptypes</span><span class="p">[</span><span class="s2">"complex128"</span><span class="p">]</span>
-<span class="o"><</span><span class="nb">type</span> <span class="s2">"netCDF4._netCDF4.CompoundType"</span><span class="o">></span><span class="p">:</span> <span class="n">name</span> <span class="o">=</span> <span class="s2">"complex128"</span><span class="p">,</span> <span class="n">numpy</span> <span class="n">dtype</span> <span class="o">=</span> <span class="p">[(</span><span class="s2">u"real"</span><span class="p">,</span><span class="s2">" [...]
+<span class="o"><</span><span class="nb">type</span> <span class="s2">"netCDF4._netCDF4.CompoundType"</span><span class="o">></span><span class="p">:</span> <span class="n">name</span> <span class="o">=</span> <span class="s2">"complex128"</span><span class="p">,</span> <span class="n">numpy</span> <span class="n">dtype</span> <span class="o">=</span> <span class="p">[(</span><span class="sa">u</span><span class="s2">"real"</span><span class="p">,</spa [...]
</pre></div>
@@ -2054,19 +2063,19 @@ values and their names are used to define an Enum data type using
<a href="#netCDF4.Dataset.createEnumType"><code>createEnumType</code></a>.</p>
<div class="codehilite"><pre><span></span><span class="o">>>></span> <span class="n">nc</span> <span class="o">=</span> <span class="n">Dataset</span><span class="p">(</span><span class="s1">'clouds.nc'</span><span class="p">,</span><span class="s1">'w'</span><span class="p">)</span>
<span class="o">>>></span> <span class="c1"># python dict with allowed values and their names.</span>
-<span class="o">>>></span> <span class="n">enum_dict</span> <span class="o">=</span> <span class="p">{</span><span class="s1">u'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="s1">u'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span>
-<span class="o">>>></span> <span class="s1">u'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">u'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
-<span class="o">>>></span> <span class="s1">u'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="s1">u'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span> <span class="s1">u'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
-<span class="o">>>></span> <span class="s1">u'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">u'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
+<span class="o">>>></span> <span class="n">enum_dict</span> <span class="o">=</span> <span class="p">{</span><span class="sa">u</span><span class="s1">'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span>
+<span class="o">>>></span> <span class="sa">u</span><span class="s1">'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+<span class="o">>>></span> <span class="sa">u</span><span class="s1">'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
+<span class="o">>>></span> <span class="sa">u</span><span class="s1">'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
<span class="o">>>></span> <span class="c1"># create the Enum type called 'cloud_t'.</span>
<span class="o">>>></span> <span class="n">cloud_type</span> <span class="o">=</span> <span class="n">nc</span><span class="o">.</span><span class="n">createEnumType</span><span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">uint8</span><span class="p">,</span><span class="s1">'cloud_t'</span><span class="p">,</span><span class="n">enum_dict</span><span class="p">)</span>
<span class="o">>>></span> <span class="k">print</span> <span class="n">cloud_type</span>
<span class="o"><</span><span class="nb">type</span> <span class="s1">'netCDF4._netCDF4.EnumType'</span><span class="o">></span><span class="p">:</span> <span class="n">name</span> <span class="o">=</span> <span class="s1">'cloud_t'</span><span class="p">,</span>
-<span class="n">numpy</span> <span class="n">dtype</span> <span class="o">=</span> <span class="n">uint8</span><span class="p">,</span> <span class="n">fields</span><span class="o">/</span><span class="n">values</span> <span class="o">=</span><span class="p">{</span><span class="s1">u'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
-<span class="s1">u'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="s1">u'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span>
-<span class="s1">u'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">u'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
-<span class="s1">u'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">u'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
-<span class="s1">u'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="s1">u'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">}</span>
+<span class="n">numpy</span> <span class="n">dtype</span> <span class="o">=</span> <span class="n">uint8</span><span class="p">,</span> <span class="n">fields</span><span class="o">/</span><span class="n">values</span> <span class="o">=</span><span class="p">{</span><span class="sa">u</span><span class="s1">'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">}</span>
</pre></div>
@@ -2097,10 +2106,10 @@ specified names.</p>
<span class="n">unlimited</span> <span class="n">dimensions</span><span class="p">:</span> <span class="n">time</span>
<span class="n">current</span> <span class="n">shape</span> <span class="o">=</span> <span class="p">(</span><span class="mi">5</span><span class="p">,)</span>
<span class="o">>>></span> <span class="k">print</span> <span class="n">cloud_var</span><span class="o">.</span><span class="n">datatype</span><span class="o">.</span><span class="n">enum_dict</span>
-<span class="p">{</span><span class="s1">u'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="s1">u'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span> <span class="s1">u'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
-<span class="s1">u'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">u'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="s1">u'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
-<span class="s1">u'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="s1">u'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
-<span class="s1">u'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
+<span class="p">{</span><span class="sa">u</span><span class="s1">'Altocumulus'</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Missing'</span><span class="p">:</span> <span class="mi">255</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Stratus'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Clear'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Nimbostratus'</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Cumulus'</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Altostratus'</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'Cumulonimbus'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
+<span class="sa">u</span><span class="s1">'Stratocumulus'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
<span class="o">>>></span> <span class="k">print</span> <span class="n">cloud_var</span><span class="p">[:]</span>
<span class="p">[</span><span class="mi">0</span> <span class="mi">2</span> <span class="mi">4</span> <span class="o">--</span> <span class="mi">1</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">nc</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
@@ -2134,7 +2143,7 @@ PERFORMANCE OF THIS SOFTWARE.</p>
<div class="item">
<div class="name def" id="netCDF4.chartostring">
- <p>def <span class="ident">chartostring</span>(</p><p>b)</p>
+ <p>def <span class="ident">chartostring</span>(</p><p>b,encoding='utf-8')</p>
</div>
@@ -2144,7 +2153,9 @@ PERFORMANCE OF THIS SOFTWARE.</p>
<p><strong><code>b</code></strong>: Input character array (numpy datatype <code>'S1'</code> or <code>'U1'</code>).
Will be converted to a array of strings, where each string has a fixed
length of <code>b.shape[-1]</code> characters.</p>
-<p>returns a numpy string array with datatype <code>'SN'</code> or <code>'UN'</code> and shape
+<p>optional kwarg <code>encoding</code> can be used to specify character encoding (default
+<code>utf-8</code>).</p>
+<p>returns a numpy string array with datatype <code>'UN'</code> and shape
<code>b.shape[:-1]</code> where where <code>N=b.shape[-1]</code>.</p></div>
<div class="source_cont">
</div>
@@ -2303,7 +2314,7 @@ unicode array (dtype = <code>'U1'</code>) will be returned.</p>
<div class="item">
<div class="name def" id="netCDF4.stringtochar">
- <p>def <span class="ident">stringtochar</span>(</p><p>a)</p>
+ <p>def <span class="ident">stringtochar</span>(</p><p>a,encoding='utf-8')</p>
</div>
@@ -2313,6 +2324,8 @@ unicode array (dtype = <code>'U1'</code>) will be returned.</p>
<p><strong><code>a</code></strong>: Input numpy string array with numpy datatype <code>'SN'</code> or <code>'UN'</code>, where N
is the number of characters in each string. Will be converted to
an array of characters (datatype <code>'S1'</code> or <code>'U1'</code>) of shape <code>a.shape + (N,)</code>.</p>
+<p>optional kwarg <code>encoding</code> can be used to specify character encoding (default
+<code>utf-8</code>).</p>
<p>returns a numpy character array with datatype <code>'S1'</code> or <code>'U1'</code>
and shape <code>a.shape + (N,)</code>, where N is the length of each string in a.</p></div>
<div class="source_cont">
@@ -2632,7 +2645,8 @@ variable-length types defined for the <a href="#netCDF4.Group"><code>Group</code
<div class="desc"><p><a href="#netCDF4.Dataset"><code>Dataset</code></a> constructor.</p>
<p><strong><code>filename</code></strong>: Name of netCDF file to hold dataset. Can also
-be a python 3 pathlib instance or the URL of an OpenDAP dataset.</p>
+be a python 3 pathlib instance or the URL of an OpenDAP dataset. When memory is
+set this is just used to set the <code>filepath()</code>.</p>
<p><strong><code>mode</code></strong>: access mode. <code>r</code> means read-only; no data can be
modified. <code>w</code> means write; a new file is created, an existing file with
the same name is deleted. <code>a</code> and <code>r+</code> mean append (in analogy with
@@ -2681,7 +2695,9 @@ means it may keep open files alive as well. Setting <code>keepweakref=True</code
Dataset instances to be garbage collected as soon as they go out of scope, potentially
reducing memory usage and open file handles. However, in many 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.</p></div>
+rendered unusable when the parent Dataset instance is garbage collected.</p>
+<p><strong><code>memory</code></strong>: if not <code>None</code>, open file with contents taken from this block of memory.
+Must be a sequence of bytes. Note this only works with "r" mode.</p></div>
<div class="source_cont">
</div>
@@ -2997,8 +3013,10 @@ attribute does not exist on the variable. For example,</p>
<div class="desc"><p>retrieve 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.</p></div>
+Use if you need to get a netCDF attribute with the same
+name as one of the reserved python attributes.</p>
+<p>option kwarg <code>encoding</code> can be used to specify the
+character encoding of a string attribute (default is <code>utf-8</code>).</p></div>
<div class="source_cont">
</div>
@@ -3096,6 +3114,28 @@ name as one of the reserved python attributes.</p></div>
<div class="item">
+ <div class="name def" id="netCDF4.Dataset.set_auto_chartostring">
+ <p>def <span class="ident">set_auto_chartostring</span>(</p><p>self, True_or_False)</p>
+ </div>
+
+
+
+
+ <div class="desc"><p>Call <a href="#netCDF4.Variable.set_auto_chartostring"><code>set_auto_chartostring</code></a> for all variables contained in this <a href="#netCDF4.Dataset"><code>Dataset</code></a> or
+<a href="#netCDF4.Group"><code>Group</code></a>, as well as for all variables in all its subgroups.</p>
+<p><strong><code>True_or_False</code></strong>: Boolean determining if automatic conversion of
+all character arrays <--> string arrays should be performed for
+character variables (variables of type <code>NC_CHAR</code> or <code>S1</code>) with the
+<code>_Encoding</code> attribute set.</p>
+<p><strong><em>Note</em></strong>: Calling this function only affects existing variables. Variables created
+after calling this function will follow the default behaviour.</p></div>
+ <div class="source_cont">
+</div>
+
+ </div>
+
+
+ <div class="item">
<div class="name def" id="netCDF4.Dataset.set_auto_mask">
<p>def <span class="ident">set_auto_mask</span>(</p><p>self, True_or_False)</p>
</div>
@@ -4073,8 +4113,10 @@ attribute does not exist on the variable. For example,</p>
<div class="desc inherited"><p>retrieve 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.</p></div>
+Use if you need to get a netCDF attribute with the same
+name as one of the reserved python attributes.</p>
+<p>option kwarg <code>encoding</code> can be used to specify the
+character encoding of a string attribute (default is <code>utf-8</code>).</p></div>
<div class="source_cont">
</div>
@@ -4196,6 +4238,32 @@ name as one of the reserved python attributes.</p></div>
<div class="item">
+ <div class="name def" id="netCDF4.Group.set_auto_chartostring">
+ <p>def <span class="ident">set_auto_chartostring</span>(</p><p>self, True_or_False)</p>
+ </div>
+
+ <p class="inheritance">
+ <strong>Inheritance:</strong>
+ <code><a href="#netCDF4.Dataset">Dataset</a></code>.<code><a href="#netCDF4.Dataset.set_auto_chartostring">set_auto_chartostring</a></code>
+ </p>
+
+
+
+ <div class="desc inherited"><p>Call <a href="#netCDF4.Variable.set_auto_chartostring"><code>set_auto_chartostring</code></a> for all variables contained in this <a href="#netCDF4.Dataset"><code>Dataset</code></a> or
+<a href="#netCDF4.Group"><code>Group</code></a>, as well as for all variables in all its subgroups.</p>
+<p><strong><code>True_or_False</code></strong>: Boolean determining if automatic conversion of
+all character arrays <--> string arrays should be performed for
+character variables (variables of type <code>NC_CHAR</code> or <code>S1</code>) with the
+<code>_Encoding</code> attribute set.</p>
+<p><strong><em>Note</em></strong>: Calling this function only affects existing variables. Variables created
+after calling this function will follow the default behaviour.</p></div>
+ <div class="source_cont">
+</div>
+
+ </div>
+
+
+ <div class="item">
<div class="name def" id="netCDF4.Group.set_auto_mask">
<p>def <span class="ident">set_auto_mask</span>(</p><p>self, True_or_False)</p>
</div>
@@ -4980,8 +5048,10 @@ attribute does not exist on the variable. For example,</p>
<div class="desc inherited"><p>retrieve 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.</p></div>
+Use if you need to get a netCDF attribute with the same
+name as one of the reserved python attributes.</p>
+<p>option kwarg <code>encoding</code> can be used to specify the
+character encoding of a string attribute (default is <code>utf-8</code>).</p></div>
<div class="source_cont">
</div>
@@ -5084,6 +5154,32 @@ name as one of the reserved python attributes.</p></div>
<div class="item">
+ <div class="name def" id="netCDF4.MFDataset.set_auto_chartostring">
+ <p>def <span class="ident">set_auto_chartostring</span>(</p><p>self, True_or_False)</p>
+ </div>
+
+ <p class="inheritance">
+ <strong>Inheritance:</strong>
+ <code><a href="#netCDF4.Dataset">Dataset</a></code>.<code><a href="#netCDF4.Dataset.set_auto_chartostring">set_auto_chartostring</a></code>
+ </p>
+
+
+
+ <div class="desc inherited"><p>Call <a href="#netCDF4.Variable.set_auto_chartostring"><code>set_auto_chartostring</code></a> for all variables contained in this <a href="#netCDF4.Dataset"><code>Dataset</code></a> or
+<a href="#netCDF4.Group"><code>Group</code></a>, as well as for all variables in all its subgroups.</p>
+<p><strong><code>True_or_False</code></strong>: Boolean determining if automatic conversion of
+all character arrays <--> string arrays should be performed for
+character variables (variables of type <code>NC_CHAR</code> or <code>S1</code>) with the
+<code>_Encoding</code> attribute set.</p>
+<p><strong><em>Note</em></strong>: Calling this function only affects existing variables. Variables created
+after calling this function will follow the default behaviour.</p></div>
+ <div class="source_cont">
+</div>
+
+ </div>
+
+
+ <div class="item">
<div class="name def" id="netCDF4.MFDataset.set_auto_mask">
<p>def <span class="ident">set_auto_mask</span>(</p><p>self, True_or_False)</p>
</div>
@@ -5447,6 +5543,20 @@ the units from the master variable.</p></div>
<div class="item">
+ <div class="name def" id="netCDF4.MFTime.set_auto_chartostring">
+ <p>def <span class="ident">set_auto_chartostring</span>(</p><p>...)</p>
+ </div>
+
+
+
+
+ <div class="source_cont">
+</div>
+
+ </div>
+
+
+ <div class="item">
<div class="name def" id="netCDF4.MFTime.set_auto_mask">
<p>def <span class="ident">set_auto_mask</span>(</p><p>...)</p>
</div>
@@ -5595,12 +5705,18 @@ variable's data type.</p>
<p><strong><code>ndim</code></strong>: The number of variable dimensions.</p>
<p><strong><code>shape</code></strong>: A tuple with the current shape (length of all dimensions).</p>
<p><strong><code>scale</code></strong>: If True, <code>scale_factor</code> and <code>add_offset</code> are
-applied. Default is <code>True</code>, can be reset using <a href="#netCDF4.Variable.set_auto_scale"><code>set_auto_scale</code></a> and
+applied, and signed integer data is automatically converted to
+unsigned integer data if the <code>_Unsigned</code> attribute is set.
+Default is <code>True</code>, can be reset using <a href="#netCDF4.Variable.set_auto_scale"><code>set_auto_scale</code></a> and
<a href="#netCDF4.Variable.set_auto_maskandscale"><code>set_auto_maskandscale</code></a> methods.</p>
<p><strong><code>mask</code></strong>: If True, data is automatically converted to/from masked
arrays when missing values or fill values are present. Default is <code>True</code>, can be
reset using <a href="#netCDF4.Variable.set_auto_mask"><code>set_auto_mask</code></a> and <a href="#netCDF4.Variable.set_auto_maskandscale"><code>set_auto_maskandscale</code></a>
methods.</p>
+<p><strong><code>chartostring</code></strong>: If True, data is automatically converted to/from character
+arrays to string arrays when the <code>_Encoding</code> variable attribute is set.
+Default is <code>True</code>, can be reset using
+<a href="#netCDF4.Variable.set_auto_chartostring"><code>set_auto_chartostring</code></a> method.</p>
<p><strong><code>least_significant_digit</code></strong>: 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 <a href="#netCDF4.Variable"><code>Variable</code></a>
@@ -5625,6 +5741,20 @@ behavior is similar to Fortran or Matlab, but different than numpy.</p>
</ul>
<h3>Class variables</h3>
<div class="item">
+ <p id="netCDF4.Variable.chartostring" class="name">var <span class="ident">chartostring</span></p>
+
+
+
+
+ <div class="desc"><p>If True, data is automatically converted to/from character
+arrays to string arrays when <code>_Encoding</code> variable attribute is set.
+Default is <code>True</code>, can be reset using
+<a href="#netCDF4.Variable.set_auto_chartostring"><code>set_auto_chartostring</code></a> method.</p></div>
+ <div class="source_cont">
+</div>
+
+ </div>
+ <div class="item">
<p id="netCDF4.Variable.datatype" class="name">var <span class="ident">datatype</span></p>
@@ -5704,7 +5834,9 @@ methods.</p></div>
<div class="desc"><p>if True, <code>scale_factor</code> and <code>add_offset</code> are
-applied. Default is <code>True</code>, can be reset using <a href="#netCDF4.Variable.set_auto_scale"><code>set_auto_scale</code></a> and
+applied, and signed integer data is converted to unsigned
+integer data if the <code>_Unsigned</code> attribute is set.
+Default is <code>True</code>, can be reset using <a href="#netCDF4.Variable.set_auto_scale"><code>set_auto_scale</code></a> and
<a href="#netCDF4.Variable.set_auto_maskandscale"><code>set_auto_maskandscale</code></a> methods.</p></div>
<div class="source_cont">
</div>
@@ -5940,7 +6072,9 @@ details.</p></div>
<div class="desc"><p>retrieve a netCDF variable attribute. Use if you need to set a
netCDF attribute with the same name as one of the reserved python
-attributes.</p></div>
+attributes.</p>
+<p>option kwarg <code>encoding</code> can be used to specify the
+character encoding of a string attribute (default is <code>utf-8</code>).</p></div>
<div class="source_cont">
</div>
@@ -5993,6 +6127,33 @@ attributes.</p></div>
<div class="item">
+ <div class="name def" id="netCDF4.Variable.set_auto_chartostring">
+ <p>def <span class="ident">set_auto_chartostring</span>(</p><p>self,chartostring)</p>
+ </div>
+
+
+
+
+ <div class="desc"><p>turn on or off automatic conversion of character variable data to and
+from numpy fixed length string arrays when the <code>_Encoding</code> variable attribute
+is set.</p>
+<p>If <code>chartostring</code> is set to <code>True</code>, when data is read from a character variable
+(dtype = <code>S1</code>) that has an <code>_Encoding</code> attribute, it is converted to a numpy
+fixed length unicode string array (dtype = <code>UN</code>, where <code>N</code> is the length
+of the the rightmost dimension of the variable). The value of <code>_Encoding</code>
+is the unicode encoding that is used to decode the bytes into strings. </p>
+<p>When numpy string data is written to a variable it is converted back to
+indiviual bytes, with the number of bytes in each string equalling the
+rightmost dimension of the variable.</p>
+<p>The default value of <code>chartostring</code> is <code>True</code>
+(automatic conversions are performed).</p></div>
+ <div class="source_cont">
+</div>
+
+ </div>
+
+
+ <div class="item">
<div class="name def" id="netCDF4.Variable.set_auto_mask">
<p>def <span class="ident">set_auto_mask</span>(</p><p>self,mask)</p>
</div>
@@ -6032,8 +6193,10 @@ set to missing_value.</p>
<div class="desc"><p>turn on or off automatic conversion of variable data to and
-from masked arrays and automatic packing/unpacking of variable
-data using <code>scale_factor</code> and <code>add_offset</code> attributes.</p>
+from masked arrays, automatic packing/unpacking of variable
+data using <code>scale_factor</code> and <code>add_offset</code> attributes and
+automatic conversion of signed integer data to unsigned integer
+data if the <code>_Unsigned</code> attribute exists.</p>
<p>If <code>maskandscale</code> is set to <code>True</code>, 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
@@ -6065,6 +6228,12 @@ scale_factor is assumed to be one.
For more information on how <code>scale_factor</code> and <code>add_offset</code> can be
used to provide simple compression, see the
<a href="http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml">PSD metadata conventions</a>.</p>
+<p>In addition, if <code>maskandscale</code> is set to <code>True</code>, and if the variable has an
+attribute <code>_Unsigned</code> set, and the variable has a signed integer data type,
+a view to the data is returned with the corresponding unsigned integer data type.
+This convention is used by the netcdf-java library to save unsigned integer
+data in <code>NETCDF3</code> or <code>NETCDF4_CLASSIC</code> files (since the <code>NETCDF3</code>
+data model does not have unsigned integer data types).</p>
<p>The default value of <code>maskandscale</code> is <code>True</code>
(automatic conversions are performed).</p></div>
<div class="source_cont">
@@ -6082,7 +6251,10 @@ used to provide simple compression, see the
<div class="desc"><p>turn on or off automatic packing/unpacking of variable
-data using <code>scale_factor</code> and <code>add_offset</code> attributes.</p>
+data using <code>scale_factor</code> and <code>add_offset</code> attributes.
+Also turns on and off automatic conversion of signed integer data
+to unsigned integer data if the variable has an <code>_Unsigned</code>
+attribute.</p>
<p>If <code>scale</code> is set to <code>True</code>, and the variable has a
<code>scale_factor</code> or an <code>add_offset</code> attribute, then data read
from that variable is unpacked using::</p>
@@ -6101,6 +6273,12 @@ scale_factor is assumed to be one.
For more information on how <code>scale_factor</code> and <code>add_offset</code> can be
used to provide simple compression, see the
<a href="http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml">PSD metadata conventions</a>.</p>
+<p>In addition, if <code>scale</code> is set to <code>True</code>, and if the variable has an
+attribute <code>_Unsigned</code> set, and the variable has a signed integer data type,
+a view to the data is returned with the corresponding unsigned integer datatype.
+This convention is used by the netcdf-java library to save unsigned integer
+data in <code>NETCDF3</code> or <code>NETCDF4_CLASSIC</code> files (since the <code>NETCDF3</code>
+data model does not have unsigned integer data types).</p>
<p>The default value of <code>scale</code> is <code>True</code>
(automatic conversions are performed).</p></div>
<div class="source_cont">
@@ -6188,7 +6366,7 @@ each attribute</p></div>
<footer id="footer">
<p>
Documentation generated by
- <a href="https://github.com/BurntSushi/pdoc">pdoc 0.3.2.dev29</a>
+ <a href="https://github.com/BurntSushi/pdoc">pdoc 0.3.2.dev16</a>
</p>
<p>pdoc is in the public domain with the
diff --git a/examples/tutorial.py b/examples/tutorial.py
index 6ac8118..78eb27f 100644
--- a/examples/tutorial.py
+++ b/examples/tutorial.py
@@ -46,8 +46,8 @@ 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',))
+latitudes = rootgrp.createVariable('lat','f4',('lat',))
+longitudes = rootgrp.createVariable('lon','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)
diff --git a/include/constants.pyx b/include/constants.pyx
deleted file mode 100644
index 9731978..0000000
--- a/include/constants.pyx
+++ /dev/null
@@ -1,4 +0,0 @@
-DEF HAS_RENAME_GRP = 0
-DEF HAS_NC_INQ_PATH = 0
-DEF HAS_NC_INQ_FORMAT_EXTENDED = 0
-DEF HAS_CDF5_FORMAT = 0
diff --git a/include/netCDF4.pxi b/include/netCDF4.pxi
index b68013e..d62fc91 100644
--- a/include/netCDF4.pxi
+++ b/include/netCDF4.pxi
@@ -717,6 +717,11 @@ cdef extern from "netcdf.h":
int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier) nogil
+
+IF HAS_NC_OPEN_MEM:
+ cdef extern from "netcdf_mem.h":
+ int nc_open_mem(const char *path, int mode, size_t size, void* memory, int *ncidp)
+
# taken from numpy.pxi in numpy 1.0rc2.
cdef extern from "numpy/arrayobject.h":
ctypedef int npy_intp
diff --git a/netCDF4/__init__.py b/netCDF4/__init__.py
index cb9f308..65ba376 100644
--- a/netCDF4/__init__.py
+++ b/netCDF4/__init__.py
@@ -5,6 +5,6 @@ from ._netCDF4 import *
from ._netCDF4 import __doc__, __pdoc__
from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__,
__has_rename_grp__, __has_nc_inq_path__,
- __has_nc_inq_format_extended__)
+ __has_nc_inq_format_extended__, __has_nc_open_mem__)
__all__ =\
['Dataset','Variable','Dimension','Group','MFDataset','MFTime','CompoundType','VLType','date2num','num2date','date2index','stringtochar','chartostring','stringtoarr','getlibversion','EnumType']
diff --git a/netCDF4/_netCDF4.c b/netCDF4/_netCDF4.c
deleted file mode 100644
index fb7c560..0000000
--- a/netCDF4/_netCDF4.c
+++ /dev/null
@@ -1,85723 +0,0 @@
-/* Generated by Cython 0.24 */
-
-#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_24"
-#include <stddef.h>
-#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_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #undef SHIFT
- #undef BASE
- #undef MASK
-#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)
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
-#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]))
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
-#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
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
- #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
- #define PyObject_Malloc(s) PyMem_Malloc(s)
- #define PyObject_Free(p) PyMem_Free(p)
- #define PyObject_Realloc(p) PyMem_Realloc(p)
-#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 && !defined(PyObject_ASCII)
- #define PyObject_ASCII(o) PyObject_Repr(o)
-#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 <math.h>
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
- float value;
- memset(&value, 0xFF, sizeof(value));
- return value;
-}
-#endif
-
-
-#define __PYX_ERR(f_index, lineno, Ln_error) \
-{ \
- __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
-}
-
-#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 <omp.h>
-#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; const 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 <cstdlib>
- #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_IntOrLong(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
-#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
-#else
-#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
-#endif
-#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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 PyObject *__pyx_empty_unicode;
-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":1242
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * cdef _set_att(grp, int varid, name, value,\ # <<<<<<<<<<<<<<
- * nc_type xtype=-99, force_ncstring=False):
- * # Private function to set an attribute name/value pair
- */
-struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att {
- int __pyx_n;
- nc_type xtype;
- PyObject *force_ncstring;
-};
-
-/* "netCDF4/_netCDF4.pyx":4732
- * 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":4905
- * 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":5028
- * 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":5064
- * 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":1591
- * __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":2604
- *
- *
- * 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":2699
- *
- *
- * 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":2860
- * 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__;
- PyObject *_has_lsd;
-};
-
-
-/* "netCDF4/_netCDF4.pyx":4567
- * # 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":4816
- * # 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":4934
- * # 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":1032
- * _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) --- */
-/* Refnanny.proto */
-#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)
-
-/* PyObjectGetAttrStr.proto */
-#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
-
-/* GetBuiltinName.proto */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name);
-
-/* IterFinish.proto */
-static CYTHON_INLINE int __Pyx_IterFinish(void);
-
-/* PyObjectCall.proto */
-#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
-
-/* PyObjectCallMethO.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
-#endif
-
-/* PyObjectCallNoArg.proto */
-#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
-
-/* PyObjectCallOneArg.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-
-/* PyObjectCallMethod0.proto */
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
-
-/* RaiseNeedMoreValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-/* RaiseTooManyValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-/* UnpackItemEndCheck.proto */
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
-
-/* RaiseNoneIterError.proto */
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-/* UnpackTupleError.proto */
-static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
-
-/* UnpackTuple2.proto */
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
- int is_tuple, int has_known_size, int decref_tuple);
-
-/* dict_iter.proto */
-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);
-
-/* GetModuleGlobalName.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
-
-/* IncludeStringH.proto */
-#include <string.h>
-
-/* decode_c_string.proto */
-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));
-
-/* PyThreadStateGet.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
-#else
-#define __Pyx_PyThreadState_declare
-#define __Pyx_PyThreadState_assign
-#endif
-
-/* PyErrFetchRestore.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
-#endif
-
-/* RaiseException.proto */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
-/* ListAppend.proto */
-#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
-
-/* ExtTypeTest.proto */
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-
-/* BytesEquals.proto */
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* UnicodeEquals.proto */
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* StrEquals.proto */
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-/* ListCompAppend.proto */
-#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
-
-/* GetException.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
-#endif
-
-/* SwapException.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
-#endif
-
-/* SaveResetException.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-#else
-#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
-#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
-#endif
-
-/* GetItemInt.proto */
-#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);
-
-/* PyErrExceptionMatches.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
-#else
-#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
-#endif
-
-/* RaiseDoubleKeywords.proto */
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-
-/* ParseKeywords.proto */
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
- const char* function_name);
-
-/* RaiseArgTupleInvalid.proto */
-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);
-
-/* PySequenceContains.proto */
-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));
-}
-
-/* SliceObject.proto */
-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);
-
-/* StringJoin.proto */
-#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
-
-/* KeywordStringCheck.proto */
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
-
-/* py_dict_items.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
-
-/* UnpackUnboundCMethod.proto */
-typedef struct {
- PyObject *type;
- PyObject **method_name;
- PyCFunction func;
- PyObject *method;
- int flag;
-} __Pyx_CachedCFunction;
-
-/* CallUnboundCMethod0.proto */
-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
-
-/* CallableCheck.proto */
-#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
-
-/* GetAttr.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
-
-/* GetAttr3.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
-
-/* PyDictContains.proto */
-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));
-}
-
-/* DictGetItem.proto */
-#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
-
-/* None.proto */
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-/* PyObjectSetAttrStr.proto */
-#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
-
-/* PyIntBinop.proto */
-#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
-
-/* PyIntBinop.proto */
-#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
-
-/* SetItemInt.proto */
-#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);
-
-/* pyobject_as_double.proto */
-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
-
-/* SliceObject.proto */
-#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);
-
-/* ArgTypeTest.proto */
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact);
-
-/* PyIntBinop.proto */
-#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
-
-/* PyObjectCallMethod1.proto */
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
-
-/* append.proto */
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
-
-/* PyFloatBinop.proto */
-#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
-
-/* py_dict_keys.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);
-
-/* ListExtend.proto */
-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
-}
-
-/* Import.proto */
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
-
-/* ImportFrom.proto */
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-
-/* CalculateMetaclass.proto */
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
-
-/* FetchCommonType.proto */
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-/* CythonFunction.proto */
-#define __Pyx_CyFunction_USED 1
-#include <structmember.h>
-#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);
-
-/* Py3ClassCreate.proto */
-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);
-
-/* CodeObjectCache.proto */
-typedef struct {
- PyCodeObject* code_object;
- int code_line;
-} __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);
-
-/* AddTraceback.proto */
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);
-
-/* ForceInitThreads.proto */
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nc_type(nc_type value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE nc_type __Pyx_PyInt_As_nc_type(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE ptrdiff_t __Pyx_PyInt_As_ptrdiff_t(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-/* CoroutineBase.proto */
-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
-
-/* PatchModuleWithCoroutine.proto */
-static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
-
-/* PatchGeneratorABC.proto */
-static int __Pyx_patch_abc(void);
-
-/* Generator.proto */
-#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);
-
-/* CheckBinaryVersion.proto */
-static int __Pyx_check_binary_version(void);
-
-/* PyIdentifierFromString.proto */
-#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
-
-/* ModuleImport.proto */
-static PyObject *__Pyx_ImportModule(const char *name);
-
-/* TypeImport.proto */
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
-
-/* InitStrings.proto */
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
-
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* 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_issue485_workaround(int, int, char *); /*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_memoryview;
-static PyObject *__pyx_builtin_object;
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_KeyError;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_RuntimeError;
-static PyObject *__pyx_builtin_UnicodeError;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_IOError;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_Ellipsis;
-static PyObject *__pyx_builtin_sum;
-static PyObject *__pyx_builtin_UnicodeDecodeError;
-static const char __pyx_k_[] = "\000";
-static const char __pyx_k_1[] = "1";
-static const char __pyx_k_O[] = "O";
-static const char __pyx_k_S[] = "S";
-static const char __pyx_k_U[] = "U";
-static const char __pyx_k_V[] = "V";
-static const char __pyx_k_a[] = "a";
-static const char __pyx_k_b[] = "b";
-static const char __pyx_k_d[] = "d";
-static const char __pyx_k_f[] = "f";
-static const char __pyx_k_i[] = "i";
-static const char __pyx_k_k[] = "k";
-static const char __pyx_k_n[] = "n";
-static const char __pyx_k_r[] = "r";
-static const char __pyx_k_s[] = "(%s)";
-static const char __pyx_k_t[] = "t";
-static const char __pyx_k_u[] = "u'";
-static const char __pyx_k_v[] = "v";
-static const char __pyx_k_w[] = "w";
-static const char __pyx_k_0m[] = "\033[0m";
-static const char __pyx_k_4m[] = " \033[4m";
-static const char __pyx_k_S1[] = "S1";
-static const char __pyx_k__2[] = "";
-static const char __pyx_k_as[] = "as";
-static const char __pyx_k_bs[] = "bs";
-static const char __pyx_k_dt[] = "dt";
-static const char __pyx_k_f4[] = "f4";
-static const char __pyx_k_f8[] = "f8";
-static const char __pyx_k_i0[] = "i0";
-static const char __pyx_k_i1[] = "i1";
-static const char __pyx_k_i2[] = "i2";
-static const char __pyx_k_i4[] = "i4";
-static const char __pyx_k_i8[] = "i8";
-static const char __pyx_k_id[] = "id";
-static const char __pyx_k_iu[] = "iu";
-static const char __pyx_k_ma[] = "ma";
-static const char __pyx_k_n1[] = "n1";
-static const char __pyx_k_nv[] = "nv";
-static const char __pyx_k_td[] = "td";
-static const char __pyx_k_u1[] = "u1";
-static const char __pyx_k_u2[] = "u2";
-static const char __pyx_k_u4[] = "u4";
-static const char __pyx_k_u8[] = "u8";
-static const char __pyx_k_ws[] = "ws";
-static const char __pyx_k__13[] = "<";
-static const char __pyx_k__14[] = ">";
-static const char __pyx_k__15[] = "/";
-static const char __pyx_k__18[] = "'";
-static const char __pyx_k__20[] = ", ";
-static const char __pyx_k__21[] = ",";
-static const char __pyx_k__23[] = ",)";
-static const char __pyx_k__24[] = ")";
-static const char __pyx_k__28[] = "__";
-static const char __pyx_k__36[] = "=";
-static const char __pyx_k__37[] = "|";
-static const char __pyx_k_all[] = "all";
-static const char __pyx_k_any[] = "any";
-static const char __pyx_k_arr[] = "arr";
-static const char __pyx_k_big[] = "big";
-static const char __pyx_k_cdf[] = "_cdf";
-static const char __pyx_k_cnt[] = "cnt";
-static const char __pyx_k_dat[] = "dat";
-static const char __pyx_k_day[] = "day";
-static const char __pyx_k_dim[] = "dim";
-static const char __pyx_k_doc[] = "__doc__";
-static const char __pyx_k_get[] = "_get";
-static const char __pyx_k_grp[] = "grp";
-static const char __pyx_k_idx[] = "idx";
-static const char __pyx_k_ind[] = "ind";
-static const char __pyx_k_key[] = "_key";
-static const char __pyx_k_len[] = "__len__";
-static const char __pyx_k_lst[] = "lst";
-static const char __pyx_k_msg[] = "msg";
-static const char __pyx_k_num[] = "num";
-static const char __pyx_k_pop[] = "pop";
-static const char __pyx_k_put[] = "put";
-static const char __pyx_k_r_2[] = "r+";
-static const char __pyx_k_r_3[] = "%r\n";
-static const char __pyx_k_r_s[] = "r+s";
-static const char __pyx_k_s_2[] = "s";
-static const char __pyx_k_s_s[] = " %s: %s\n";
-static const char __pyx_k_sta[] = "sta";
-static const char __pyx_k_str[] = "str";
-static const char __pyx_k_sum[] = "sum";
-static const char __pyx_k_sys[] = "sys";
-static const char __pyx_k_val[] = "val";
-static const char __pyx_k_var[] = "var";
-static const char __pyx_k_vid[] = "vid";
-static const char __pyx_k_zip[] = "zip";
-static const char __pyx_k_1_10[] = "1.10";
-static const char __pyx_k_args[] = "args";
-static const char __pyx_k_bool[] = "bool";
-static const char __pyx_k_cdfm[] = "cdfm";
-static const char __pyx_k_char[] = "char";
-static const char __pyx_k_copy[] = "copy";
-static const char __pyx_k_data[] = "data";
-static const char __pyx_k_date[] = "date";
-static const char __pyx_k_days[] = "days";
-static const char __pyx_k_dict[] = "__dict__";
-static const char __pyx_k_dims[] = "_dims";
-static const char __pyx_k_dset[] = "dset";
-static const char __pyx_k_elem[] = "elem";
-static const char __pyx_k_enum[] = "enum";
-static const char __pyx_k_f4_2[] = "<f4";
-static const char __pyx_k_f4_3[] = ">f4";
-static const char __pyx_k_find[] = "find";
-static const char __pyx_k_flat[] = "flat";
-static const char __pyx_k_glob[] = "glob";
-static const char __pyx_k_grps[] = "_grps";
-static const char __pyx_k_hour[] = "hour";
-static const char __pyx_k_http[] = "http";
-static const char __pyx_k_in1d[] = "in1d";
-static const char __pyx_k_init[] = "__init__";
-static const char __pyx_k_isMA[] = "isMA";
-static const char __pyx_k_item[] = "item";
-static const char __pyx_k_izip[] = "izip";
-static const char __pyx_k_join[] = "join";
-static const char __pyx_k_keys[] = "keys";
-static const char __pyx_k_kind[] = "kind";
-static const char __pyx_k_main[] = "__main__";
-static const char __pyx_k_mask[] = "mask";
-static const char __pyx_k_mode[] = "mode";
-static const char __pyx_k_name[] = "name";
-static const char __pyx_k_ndim[] = "ndim";
-static const char __pyx_k_numv[] = "numv";
-static const char __pyx_k_part[] = "part";
-static const char __pyx_k_path[] = "path";
-static const char __pyx_k_pdoc[] = "__pdoc__";
-static const char __pyx_k_prod[] = "prod";
-static const char __pyx_k_repr[] = "__repr__";
-static const char __pyx_k_secs[] = "secs";
-static const char __pyx_k_self[] = "self";
-static const char __pyx_k_send[] = "send";
-static const char __pyx_k_size[] = "size";
-static const char __pyx_k_slen[] = "slen";
-static const char __pyx_k_step[] = "step";
-static const char __pyx_k_stop[] = "stop";
-static const char __pyx_k_strd[] = "strd";
-static const char __pyx_k_strt[] = "strt";
-static const char __pyx_k_test[] = "__test__";
-static const char __pyx_k_tile[] = "tile";
-static const char __pyx_k_time[] = "time";
-static const char __pyx_k_toma[] = "_toma";
-static const char __pyx_k_unit[] = "unit";
-static const char __pyx_k_vars[] = "_vars";
-static const char __pyx_k_view[] = "view";
-static const char __pyx_k_vlen[] = "vlen";
-static const char __pyx_k_warn[] = "warn";
-static const char __pyx_k_year[] = "year";
-static const char __pyx_k_zlib[] = "zlib";
-static const char __pyx_k_1_2_7[] = "1.2.7";
-static const char __pyx_k_4_2_1[] = "4.2.1";
-static const char __pyx_k_4_4_0[] = "4.4.0";
-static const char __pyx_k_4_4_1[] = "4.4.1";
-static const char __pyx_k_align[] = "align";
-static const char __pyx_k_array[] = "array";
-static const char __pyx_k_ascii[] = "ascii";
-static const char __pyx_k_attrs[] = "attrs";
-static const char __pyx_k_atype[] = "atype";
-static const char __pyx_k_cdf_2[] = "cdf";
-static const char __pyx_k_check[] = "check";
-static const char __pyx_k_close[] = "close";
-static const char __pyx_k_count[] = "count";
-static const char __pyx_k_d_d_d[] = "%d.%d.%d";
-static const char __pyx_k_dates[] = "dates";
-static const char __pyx_k_dimid[] = "_dimid";
-static const char __pyx_k_dtype[] = "dtype";
-static const char __pyx_k_empty[] = "empty";
-static const char __pyx_k_exact[] = "exact";
-static const char __pyx_k_files[] = "files";
-static const char __pyx_k_float[] = "float";
-static const char __pyx_k_grp_2[] = "_grp";
-static const char __pyx_k_grpid[] = "_grpid";
-static const char __pyx_k_isnan[] = "isnan";
-static const char __pyx_k_items[] = "items";
-static const char __pyx_k_lower[] = "lower";
-static const char __pyx_k_month[] = "month";
-static const char __pyx_k_msecs[] = "msecs";
-static const char __pyx_k_names[] = "names";
-static const char __pyx_k_numpy[] = "numpy";
-static const char __pyx_k_proxy[] = "proxy";
-static const char __pyx_k_put_2[] = "_put";
-static const char __pyx_k_range[] = "range";
-static const char __pyx_k_ravel[] = "ravel";
-static const char __pyx_k_redef[] = "_redef";
-static const char __pyx_k_round[] = "round";
-static const char __pyx_k_s_s_s[] = "%s %s(%s)\n";
-static const char __pyx_k_scale[] = "scale";
-static const char __pyx_k_shape[] = "shape";
-static const char __pyx_k_since[] = "since";
-static const char __pyx_k_split[] = "split";
-static const char __pyx_k_start[] = "start";
-static const char __pyx_k_strip[] = "strip";
-static const char __pyx_k_throw[] = "throw";
-static const char __pyx_k_times[] = "times";
-static const char __pyx_k_tostr[] = "_tostr";
-static const char __pyx_k_tsecs[] = "tsecs";
-static const char __pyx_k_units[] = "units";
-static const char __pyx_k_utf_8[] = "utf-8";
-static const char __pyx_k_utils[] = "utils";
-static const char __pyx_k_utime[] = "utime";
-static const char __pyx_k_vInst[] = "vInst";
-static const char __pyx_k_vName[] = "vName";
-static const char __pyx_k_value[] = "value";
-static const char __pyx_k_varid[] = "_varid";
-static const char __pyx_k_zeros[] = "zeros";
-static const char __pyx_k_MFTime[] = "MFTime";
-static const char __pyx_k_aggdim[] = "aggdim";
-static const char __pyx_k_append[] = "append";
-static const char __pyx_k_around[] = "around";
-static const char __pyx_k_astype[] = "astype";
-static const char __pyx_k_buffer[] = "buffer";
-static const char __pyx_k_decode[] = "decode";
-static const char __pyx_k_dims_2[] = "dims";
-static const char __pyx_k_dset_2[] = "_dset";
-static const char __pyx_k_encode[] = "encode";
-static const char __pyx_k_enddef[] = "_enddef";
-static const char __pyx_k_endian[] = "endian";
-static const char __pyx_k_fields[] = "fields";
-static const char __pyx_k_filled[] = "filled";
-static const char __pyx_k_format[] = "format";
-static const char __pyx_k_groups[] = "groups";
-static const char __pyx_k_import[] = "__import__";
-static const char __pyx_k_isenum[] = "_isenum";
-static const char __pyx_k_isvlen[] = "_isvlen";
-static const char __pyx_k_julian[] = "julian";
-static const char __pyx_k_little[] = "little";
-static const char __pyx_k_lstArr[] = "lstArr";
-static const char __pyx_k_master[] = "master";
-static const char __pyx_k_minute[] = "minute";
-static const char __pyx_k_module[] = "__module__";
-static const char __pyx_k_msecsd[] = "msecsd";
-static const char __pyx_k_name_2[] = "_name";
-static const char __pyx_k_native[] = "native";
-static const char __pyx_k_nbytes[] = "nbytes";
-static const char __pyx_k_ncdump[] = "ncdump";
-static const char __pyx_k_nctime[] = "nctime";
-static const char __pyx_k_nelems[] = "nelems";
-static const char __pyx_k_object[] = "object";
-static const char __pyx_k_parent[] = "parent";
-static const char __pyx_k_path_2[] = "_path";
-static const char __pyx_k_path_s[] = "path = %s\n";
-static const char __pyx_k_recLen[] = "_recLen";
-static const char __pyx_k_recVar[] = "_recVar";
-static const char __pyx_k_reduce[] = "__reduce__";
-static const char __pyx_k_second[] = "second";
-static const char __pyx_k_select[] = "select";
-static const char __pyx_k_stride[] = "stride";
-static const char __pyx_k_string[] = "string";
-static const char __pyx_k_tolist[] = "tolist";
-static const char __pyx_k_typeid[] = "typeid";
-static const char __pyx_k_values[] = "values";
-static const char __pyx_k_vltype[] = "_vltype";
-static const char __pyx_k_IOError[] = "IOError";
-static const char __pyx_k_MINYEAR[] = "MINYEAR";
-static const char __pyx_k_NETCDF3[] = "NETCDF3";
-static const char __pyx_k_NETCDF4[] = "NETCDF4";
-static const char __pyx_k_asarray[] = "asarray";
-static const char __pyx_k_bytestr[] = "bytestr";
-static const char __pyx_k_cdfTLen[] = "_cdfTLen";
-static const char __pyx_k_cdfVLen[] = "_cdfVLen";
-static const char __pyx_k_cdftime[] = "cdftime";
-static const char __pyx_k_clobber[] = "clobber";
-static const char __pyx_k_cmptype[] = "_cmptype";
-static const char __pyx_k_d_d_d_s[] = "%d.%d.%d-%s";
-static const char __pyx_k_dimlens[] = "dimlens";
-static const char __pyx_k_dimname[] = "dimname";
-static const char __pyx_k_exclude[] = "exclude";
-static const char __pyx_k_extDims[] = "extDims";
-static const char __pyx_k_extType[] = "extType";
-static const char __pyx_k_files_2[] = "_files";
-static const char __pyx_k_flatten[] = "flatten";
-static const char __pyx_k_formats[] = "formats";
-static const char __pyx_k_genexpr[] = "genexpr";
-static const char __pyx_k_getattr[] = "__getattr__";
-static const char __pyx_k_getdims[] = "_getdims";
-static const char __pyx_k_getitem[] = "__getitem__";
-static const char __pyx_k_getname[] = "_getname";
-static const char __pyx_k_group_s[] = "group %s:\n";
-static const char __pyx_k_has_lsd[] = "_has_lsd";
-static const char __pyx_k_nc_type[] = "_nc_type";
-static const char __pyx_k_ncattrs[] = "ncattrs";
-static const char __pyx_k_ndarray[] = "ndarray";
-static const char __pyx_k_newname[] = "newname";
-static const char __pyx_k_offsets[] = "offsets";
-static const char __pyx_k_oldname[] = "oldname";
-static const char __pyx_k_persist[] = "persist";
-static const char __pyx_k_prepare[] = "__prepare__";
-static const char __pyx_k_put_ind[] = "put_ind";
-static const char __pyx_k_python3[] = "python3";
-static const char __pyx_k_ref_num[] = "ref_num";
-static const char __pyx_k_replace[] = "replace";
-static const char __pyx_k_reshape[] = "reshape";
-static const char __pyx_k_s_s_s_2[] = "%s %s%s\n";
-static const char __pyx_k_seconds[] = "seconds";
-static const char __pyx_k_setattr[] = "__setattr__";
-static const char __pyx_k_shape_2[] = "_shape";
-static const char __pyx_k_shuffle[] = "shuffle";
-static const char __pyx_k_squeeze[] = "squeeze";
-static const char __pyx_k_timestr[] = "timestr";
-static const char __pyx_k_unicode[] = "__unicode__";
-static const char __pyx_k_value_2[] = "_value";
-static const char __pyx_k_varInfo[] = "varInfo";
-static const char __pyx_k_varname[] = "varname";
-static const char __pyx_k_version[] = "__version__";
-static const char __pyx_k_vltypes[] = "vltypes";
-static const char __pyx_k_weakref[] = "weakref";
-static const char __pyx_k_Ellipsis[] = "Ellipsis";
-static const char __pyx_k_KeyError[] = "KeyError";
-static const char __pyx_k_NUMCHARS[] = "NUMCHARS";
-static const char __pyx_k_Variable[] = "_Variable";
-static const char __pyx_k_aggDimId[] = "aggDimId";
-static const char __pyx_k_basedate[] = "basedate";
-static const char __pyx_k_byteswap[] = "byteswap";
-static const char __pyx_k_calendar[] = "calendar";
-static const char __pyx_k_cmptypes[] = "cmptypes";
-static const char __pyx_k_compound[] = "compound";
-static const char __pyx_k_datatype[] = "datatype";
-static const char __pyx_k_date2num[] = "date2num";
-static const char __pyx_k_datetime[] = "datetime";
-static const char __pyx_k_dimnames[] = "dimnames";
-static const char __pyx_k_diskless[] = "diskless";
-static const char __pyx_k_encoding[] = "encoding";
-static const char __pyx_k_endswith[] = "endswith";
-static const char __pyx_k_enumtype[] = "_enumtype";
-static const char __pyx_k_extShape[] = "extShape";
-static const char __pyx_k_filename[] = "filename";
-static const char __pyx_k_find_dim[] = "_find_dim";
-static const char __pyx_k_groups_s[] = " groups: %s\n";
-static const char __pyx_k_grpnames[] = "grpnames";
-static const char __pyx_k_has_cdf5[] = "__has_cdf5__";
-static const char __pyx_k_hr_units[] = "hr_units";
-static const char __pyx_k_ismasked[] = "ismasked";
-static const char __pyx_k_isnative[] = "isnative";
-static const char __pyx_k_isscalar[] = "isscalar";
-static const char __pyx_k_itemsize[] = "itemsize";
-static const char __pyx_k_newSlice[] = "newSlice";
-static const char __pyx_k_normpath[] = "normpath";
-static const char __pyx_k_num2date[] = "num2date";
-static const char __pyx_k_qualname[] = "__qualname__";
-static const char __pyx_k_quantize[] = "_quantize";
-static const char __pyx_k_ref_date[] = "ref_date";
-static const char __pyx_k_standard[] = "standard";
-static const char __pyx_k_subdtype[] = "subdtype";
-static const char __pyx_k_to_ascii[] = "_to_ascii";
-static const char __pyx_k_tostring[] = "tostring";
-static const char __pyx_k_typecode[] = "typecode";
-static const char __pyx_k_varnames[] = "varnames";
-static const char __pyx_k_warnings[] = "warnings";
-static const char __pyx_k_Dimension[] = "_Dimension";
-static const char __pyx_k_FillValue[] = "_FillValue";
-static const char __pyx_k_MFDataset[] = "MFDataset";
-static const char __pyx_k_TypeError[] = "TypeError";
-static const char __pyx_k_UNDEFINED[] = "UNDEFINED";
-static const char __pyx_k_byteorder[] = "byteorder";
-static const char __pyx_k_cdfRecVar[] = "_cdfRecVar";
-static const char __pyx_k_cdfVLen_2[] = "cdfVLen";
-static const char __pyx_k_complevel[] = "complevel";
-static const char __pyx_k_datashape[] = "datashape";
-static const char __pyx_k_dateparse[] = "_dateparse";
-static const char __pyx_k_day_units[] = "day_units";
-static const char __pyx_k_delncattr[] = "delncattr";
-static const char __pyx_k_dimtotlen[] = "dimtotlen";
-static const char __pyx_k_enum_dict[] = "enum_dict";
-static const char __pyx_k_enumerate[] = "enumerate";
-static const char __pyx_k_enumtypes[] = "enumtypes";
-static const char __pyx_k_getncattr[] = "getncattr";
-static const char __pyx_k_gregorian[] = "gregorian";
-static const char __pyx_k_isostring[] = "isostring";
-static const char __pyx_k_iteritems[] = "iteritems";
-static const char __pyx_k_itertools[] = "itertools";
-static const char __pyx_k_majorvers[] = "majorvers";
-static const char __pyx_k_mastervar[] = "_mastervar";
-static const char __pyx_k_metaclass[] = "__metaclass__";
-static const char __pyx_k_min_units[] = "min_units";
-static const char __pyx_k_minorvers[] = "minorvers";
-static const char __pyx_k_nunlimdim[] = "_nunlimdim";
-static const char __pyx_k_posixpath[] = "posixpath";
-static const char __pyx_k_recdimlen[] = "recdimlen";
-static const char __pyx_k_sec_units[] = "sec_units";
-static const char __pyx_k_setncattr[] = "setncattr";
-static const char __pyx_k_timedelta[] = "timedelta";
-static const char __pyx_k_totaltime[] = "totaltime";
-static const char __pyx_k_traceback[] = "traceback";
-static const char __pyx_k_unlimdims[] = "unlimdims";
-static const char __pyx_k_valid_max[] = "valid_max";
-static const char __pyx_k_valid_min[] = "valid_min";
-static const char __pyx_k_variables[] = "variables";
-static const char __pyx_k_walk_grps[] = "_walk_grps";
-static const char __pyx_k_Group_name[] = "Group.name";
-static const char __pyx_k_IndexError[] = "IndexError";
-static const char __pyx_k_ValueError[] = "ValueError";
-static const char __pyx_k_add_offset[] = "add_offset";
-static const char __pyx_k_aggDimName[] = "aggDimName";
-static const char __pyx_k_chunksizes[] = "chunksizes";
-static const char __pyx_k_contiguous[] = "contiguous";
-static const char __pyx_k_data_model[] = "data_model";
-static const char __pyx_k_date2index[] = "date2index";
-static const char __pyx_k_dimensions[] = "dimensions";
-static const char __pyx_k_dtype_name[] = "dtype_name";
-static const char __pyx_k_fill_value[] = "fill_value";
-static const char __pyx_k_filling_on[] = "filling on";
-static const char __pyx_k_fletcher32[] = "fletcher32";
-static const char __pyx_k_groups_s_2[] = " groups = %s\n";
-static const char __pyx_k_iscompound[] = "_iscompound";
-static const char __pyx_k_masterDims[] = "masterDims";
-static const char __pyx_k_masterType[] = "masterType";
-static const char __pyx_k_memoryview[] = "memoryview";
-static const char __pyx_k_ncdump_var[] = "ncdump_var";
-static const char __pyx_k_nctonptype[] = "_nctonptype";
-static const char __pyx_k_netcdftime[] = "netcdftime";
-static const char __pyx_k_nptonctype[] = "_nptonctype";
-static const char __pyx_k_parse_date[] = "_parse_date";
-static const char __pyx_k_preemption[] = "preemption";
-static const char __pyx_k_recdimname[] = "recdimname";
-static const char __pyx_k_sortbylist[] = "_sortbylist";
-static const char __pyx_k_startswith[] = "startswith";
-static const char __pyx_k_time2index[] = "time2index";
-static const char __pyx_k_utc_offset[] = "utc_offset";
-static const char __pyx_k_ImportError[] = "ImportError";
-static const char __pyx_k_MemoryError[] = "MemoryError";
-static const char __pyx_k_NC_DISKLESS[] = "NC_DISKLESS";
-static const char __pyx_k_OrderedDict[] = "OrderedDict";
-static const char __pyx_k_String_name[] = "String name.";
-static const char __pyx_k_VLType_name[] = "VLType.name";
-static const char __pyx_k_assign_vlen[] = "_assign_vlen";
-static const char __pyx_k_cdfRecVar_2[] = "cdfRecVar";
-static const char __pyx_k_chunk_cache[] = "chunk_cache";
-static const char __pyx_k_collections[] = "collections";
-static const char __pyx_k_concatenate[] = "concatenate";
-static const char __pyx_k_createGroup[] = "createGroup";
-static const char __pyx_k_development[] = "-development";
-static const char __pyx_k_disk_format[] = "_disk_format";
-static const char __pyx_k_file_format[] = "file_format";
-static const char __pyx_k_filling_off[] = "filling off\n";
-static const char __pyx_k_format_dict[] = "_format_dict";
-static const char __pyx_k_isprimitive[] = "_isprimitive";
-static const char __pyx_k_isunlimited[] = "isunlimited";
-static const char __pyx_k_keepweakref[] = "keepweakref";
-static const char __pyx_k_masterShape[] = "masterShape";
-static const char __pyx_k_ordereddict[] = "ordereddict";
-static const char __pyx_k_patchstring[] = "patchstring";
-static const char __pyx_k_releasevers[] = "releasevers";
-static const char __pyx_k_string_type[] = ": string type";
-static const char __pyx_k_stringtoarr[] = "stringtoarr";
-static const char __pyx_k_valid_range[] = "valid_range";
-static const char __pyx_k_variables_s[] = " variables = %s\n";
-static const char __pyx_k_Dataset_path[] = "Dataset.path";
-static const char __pyx_k_MFTime__time[] = "_MFTime__time";
-static const char __pyx_k_RuntimeError[] = "RuntimeError";
-static const char __pyx_k_UnicodeError[] = "UnicodeError";
-static const char __pyx_k_VLType_dtype[] = "VLType.dtype";
-static const char __pyx_k_chartostring[] = "chartostring";
-static const char __pyx_k_data_model_2[] = "_data_model";
-static const char __pyx_k_dimensions_s[] = " dimensions = %s\n";
-static const char __pyx_k_getattribute[] = "__getattribute__";
-static const char __pyx_k_masked_array[] = "masked_array";
-static const char __pyx_k_masterRecVar[] = "masterRecVar";
-static const char __pyx_k_microseconds[] = "microseconds";
-static const char __pyx_k_private_atts[] = "_private_atts";
-static const char __pyx_k_recdimname_2[] = "_recdimname";
-static const char __pyx_k_scale_factor[] = "scale_factor";
-static const char __pyx_k_stringtochar[] = "stringtochar";
-static const char __pyx_k_version_info[] = "version_info";
-static const char __pyx_k_EnumType_name[] = "EnumType.name";
-static const char __pyx_k_Illegal_index[] = "Illegal index";
-static const char __pyx_k_MFTime___init[] = "MFTime.__init__";
-static const char __pyx_k_MFTime__delta[] = "_MFTime__delta";
-static const char __pyx_k_NETCDF3_64BIT[] = "NETCDF3_64BIT";
-static const char __pyx_k_Variable_mask[] = "Variable.mask";
-static const char __pyx_k_Variable_name[] = "Variable.name";
-static const char __pyx_k_Variable_ndim[] = "Variable.ndim";
-static const char __pyx_k_Variable_size[] = "Variable.size";
-static const char __pyx_k_datatype_name[] = "datatype_name";
-static const char __pyx_k_disk_format_2[] = "disk_format";
-static const char __pyx_k_file_format_2[] = "_file_format";
-static const char __pyx_k_getlibversion[] = "getlibversion";
-static const char __pyx_k_intnptonctype[] = "_intnptonctype";
-static const char __pyx_k_is_native_big[] = "is_native_big";
-static const char __pyx_k_missing_value[] = "missing_value";
-static const char __pyx_k_name_s_size_s[] = ": name = '%s', size = %s\n";
-static const char __pyx_k_set_auto_mask[] = "set_auto_mask";
-static const char __pyx_k_timestr_split[] = "timestr_split";
-static const char __pyx_k_unicode_error[] = "unicode_error";
-static const char __pyx_k_AttributeError[] = "AttributeError";
-static const char __pyx_k_Dataset_groups[] = "Dataset.groups";
-static const char __pyx_k_Dataset_parent[] = "Dataset.parent";
-static const char __pyx_k_Dimension_name[] = "Dimension.name";
-static const char __pyx_k_EnumType_dtype[] = "EnumType.dtype";
-static const char __pyx_k_Variable___len[] = "_Variable.__len__";
-static const char __pyx_k_Variable_dtype[] = "Variable.dtype";
-static const char __pyx_k_Variable_scale[] = "Variable.scale";
-static const char __pyx_k_Variable_shape[] = "Variable.shape";
-static const char __pyx_k_current_size_s[] = "current size = %s\n";
-static const char __pyx_k_has_rename_grp[] = "__has_rename_grp__";
-static const char __pyx_k_hdf5libversion[] = "__hdf5libversion__";
-static const char __pyx_k_microsec_units[] = "microsec_units";
-static const char __pyx_k_millisec_units[] = "millisec_units";
-static const char __pyx_k_set_auto_scale[] = "set_auto_scale";
-static const char __pyx_k_supportedtypes[] = "_supportedtypes";
-static const char __pyx_k_Dataset_vltypes[] = "Dataset.vltypes";
-static const char __pyx_k_Dimension___len[] = "_Dimension.__len__";
-static const char __pyx_k_MFDataset_close[] = "MFDataset.close";
-static const char __pyx_k_NETCDF3_CLASSIC[] = "NETCDF3_CLASSIC";
-static const char __pyx_k_NETCDF4_CLASSIC[] = "NETCDF4_CLASSIC";
-static const char __pyx_k_Variable___init[] = "_Variable.__init__";
-static const char __pyx_k_Variable___repr[] = "_Variable.__repr__";
-static const char __pyx_k_Variable__shape[] = "_Variable._shape";
-static const char __pyx_k_current_shape_s[] = "current shape = %s\n";
-static const char __pyx_k_has_nc_inq_path[] = "__has_nc_inq_path__";
-static const char __pyx_k_out_array_shape[] = "_out_array_shape";
-static const char __pyx_k_Dataset_cmptypes[] = "Dataset.cmptypes";
-static const char __pyx_k_Dimension___init[] = "_Dimension.__init__";
-static const char __pyx_k_Dimension___repr[] = "_Dimension.__repr__";
-static const char __pyx_k_MFDataset___init[] = "MFDataset.__init__";
-static const char __pyx_k_MFDataset___repr[] = "MFDataset.__repr__";
-static const char __pyx_k_MFTime___getitem[] = "MFTime.__getitem__";
-static const char __pyx_k_StartCountStride[] = "_StartCountStride";
-static const char __pyx_k_Variable_ncattrs[] = "_Variable.ncattrs";
-static const char __pyx_k_default_encoding[] = "default_encoding";
-static const char __pyx_k_default_fillvals[] = "default_fillvals";
-static const char __pyx_k_enum_data_type_s[] = "enum data type: %s\n";
-static const char __pyx_k_is_native_little[] = "is_native_little";
-static const char __pyx_k_netCDF4__netCDF4[] = "netCDF4._netCDF4";
-static const char __pyx_k_s_not_found_in_s[] = "%s not found in %s";
-static const char __pyx_k_vlen_data_type_s[] = "vlen data type: %s\n";
-static const char __pyx_k_CompoundType_name[] = "CompoundType.name";
-static const char __pyx_k_Dataset_enumtypes[] = "Dataset.enumtypes";
-static const char __pyx_k_Dataset_variables[] = "Dataset.variables";
-static const char __pyx_k_MFDataset_ncattrs[] = "MFDataset.ncattrs";
-static const char __pyx_k_Variable_datatype[] = "Variable.datatype";
-static const char __pyx_k_Variable_typecode[] = "_Variable.typecode";
-static const char __pyx_k_gethdf5libversion[] = "_gethdf5libversion";
-static const char __pyx_k_netcdf4libversion[] = "__netcdf4libversion__";
-static const char __pyx_k_CompoundType_dtype[] = "CompoundType.dtype";
-static const char __pyx_k_Dataset_data_model[] = "Dataset.data_model";
-static const char __pyx_k_Dataset_dimensions[] = "Dataset.dimensions";
-static const char __pyx_k_EnumType_enum_dict[] = "EnumType.enum_dict";
-static const char __pyx_k_MFDataset___reduce[] = "MFDataset.__reduce__";
-static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
-static const char __pyx_k_Variable___getattr[] = "_Variable.__getattr__";
-static const char __pyx_k_Variable___getitem[] = "_Variable.__getitem__";
-static const char __pyx_k_dimensions_sizes_s[] = " dimensions(sizes): %s\n";
-static const char __pyx_k_set_default_format[] = "_set_default_format";
-static const char __pyx_k_Dataset_disk_format[] = "Dataset.disk_format";
-static const char __pyx_k_Dataset_file_format[] = "Dataset.file_format";
-static const char __pyx_k_Dataset_keepweakref[] = "Dataset.keepweakref";
-static const char __pyx_k_MFDataset___setattr[] = "MFDataset.__setattr__";
-static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
-static const char __pyx_k_Variable_dimensions[] = "Variable.dimensions";
-static const char __pyx_k_get_var_chunk_cache[] = "get_var_chunk_cache";
-static const char __pyx_k_orthogoral_indexing[] = "__orthogoral_indexing__";
-static const char __pyx_k_proleptic_gregorian[] = "proleptic_gregorian";
-static const char __pyx_k_reverse_format_dict[] = "_reverse_format_dict";
-static const char __pyx_k_NETCDF3_64BIT_OFFSET[] = "NETCDF3_64BIT_OFFSET";
-static const char __pyx_k_compound_data_type_s[] = "compound data type: %s\n";
-static const char __pyx_k_name_s_numpy_dtype_s[] = ": name = '%s', numpy dtype = %s\n";
-static const char __pyx_k_Dimension_isunlimited[] = "_Dimension.isunlimited";
-static const char __pyx_k_len_of_unsized_object[] = "len() of unsized object";
-static const char __pyx_k_set_auto_maskandscale[] = "set_auto_maskandscale";
-static const char __pyx_k_Variable_set_auto_mask[] = "_Variable.set_auto_mask";
-static const char __pyx_k_name_cannot_be_altered[] = "name cannot be altered";
-static const char __pyx_k_size_cannot_be_altered[] = "size cannot be altered";
-static const char __pyx_k_unlimited_dimensions_s[] = "unlimited dimensions: %s\n";
-static const char __pyx_k_unsupported_time_units[] = "unsupported time units";
-static const char __pyx_k_variables_dimensions_s[] = " variables(dimensions): %s\n";
-static const char __pyx_k_VLType_is_not_picklable[] = "VLType is not picklable";
-static const char __pyx_k_Variable_set_auto_scale[] = "_Variable.set_auto_scale";
-static const char __pyx_k_least_significant_digit[] = "least_significant_digit";
-static const char __pyx_k_no_since_in_unit_string[] = "no 'since' in unit_string";
-static const char __pyx_k_shape_cannot_be_altered[] = "shape cannot be altered";
-static const char __pyx_k_unlimited_name_s_size_s[] = " (unlimited): name = '%s', size = %s\n";
-static const char __pyx_k_Dataset_is_not_picklable[] = "Dataset is not picklable";
-static const char __pyx_k_MFDataset___getattribute[] = "MFDataset.__getattribute__";
-static const char __pyx_k_needsworkaround_issue485[] = "_needsworkaround_issue485";
-static const char __pyx_k_unlimited_dimensions_s_2[] = "unlimited dimensions = %s\n";
-static const char __pyx_k_EnumType_is_not_picklable[] = "EnumType is not picklable";
-static const char __pyx_k_Variable_is_not_picklable[] = "Variable is not picklable";
-static const char __pyx_k_MFDataset_is_not_picklable[] = "MFDataset is not picklable";
-static const char __pyx_k_has_nc_inq_format_extended[] = "__has_nc_inq_format_extended__";
-static const char __pyx_k_s_not_a_valid_variable_name[] = "%s not a valid variable name";
-static const char __pyx_k_dimensions_cannot_be_altered[] = "dimensions cannot be altered";
-static const char __pyx_k_s_not_a_valid_dimension_name[] = "%s not a valid dimension name";
-static const char __pyx_k_CompoundType_is_not_picklable[] = "CompoundType is not picklable";
-static const char __pyx_k_The_number_of_stored_elements[] = "The number of stored elements.";
-static const char __pyx_k_mode_must_be_w_r_a_or_r_got_s[] = "mode must be 'w', 'r', 'a' or 'r+', got '%s'";
-static const char __pyx_k_unrecognized_format_requested[] = "unrecognized format requested";
-static const char __pyx_k_Variable___orthogonal_indexing[] = "Variable.__orthogonal_indexing__";
-static const char __pyx_k_Variable_set_auto_maskandscale[] = "_Variable.set_auto_maskandscale";
-static const char __pyx_k_WARNING_Backwards_incompatible[] = "\nWARNING: Backwards incompatible files will be created with HDF5 1.10.x \nand netCDF < 4.4.1. Upgrading to netCDF4 >= 4.4.1 or downgrading to \nto HDF5 version 1.8.x is highly recommended \n(see https://github.com/Unidata/netcdf-c/issues/250).";
-static const char __pyx_k_filepath_method_not_enabled_To[] = "\nfilepath method not enabled. To enable, install Cython, make sure you have\nversion 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python.";
-static const char __pyx_k_path_shows_the_location_of_the[] = "`path` shows the location of the `netCDF4.Group` in\n the `netCDF4.Dataset` in a unix directory format (the names of groups in the\n hierarchy separated by backslashes). A `netCDF4.Dataset` instance is the root\n group, so the path is simply `'/'`.";
-static const char __pyx_k_renameGroup_method_not_enabled[] = "\nrenameGroup method not enabled. To enable, install Cython, make sure you have\nversion 4.3.1 or higher of the netcdf C lib, and rebuild netcdf4-python.";
-static const char __pyx_k_A_numpy_dtype_object_describing[] = "A numpy dtype object describing the\n variable's data type.";
-static const char __pyx_k_A_string_describing_the_name_of[] = "A string describing the name of the `netCDF4.Group`.";
-static const char __pyx_k_A_tuple_containing_the_names_of[] = "A tuple containing the names of the\n dimensions associated with this variable.";
-static const char __pyx_k_Always_True_Indicates_to_client[] = "Always `True`. Indicates to client code\n that the object supports 'orthogonal indexing', which means that slices\n that are 1d arrays or lists slice along each dimension independently. This\n behavior is similar to Fortran or Matlab, but different than numpy.";
-static const char __pyx_k_Class_for_reading_multi_file_ne[] = "\nClass for reading multi-file netCDF Datasets, making variables\nspanning multiple files appear as if they were in one file.\nDatasets must be in `NETCDF4_CLASSIC, NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET\nor NETCDF3_64BIT_DATA` format (`NETCDF4` Datasets won't work).\n\nAdapted from [pycdf](http://pysclint.sourceforge.net/pycdf) by Andre Gosselin.\n\nExample usage (See `netCDF4.MFDataset.__init__` for more details):\n\n ::: [...]
-static const 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.createDi [...]
-static const char __pyx_k_FillValue_attribute_must_be_set[] = "_FillValue attribute must be set when variable is ";
-static const 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 const char __pyx_k_Users_jswhit_python_netcdf4_pyt[] = "/Users/jswhit/python/netcdf4-python/netCDF4/_netCDF4.pyx";
-static const char __pyx_k_Variable_object_no_longer_valid[] = "Variable object no longer valid";
-static const char __pyx_k_Version_1_2_7_Introduction_netc[] = "\nVersion 1.2.7\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, a [...]
-static const char __pyx_k_assign_vlen_method_only_for_use[] = "_assign_vlen method only for use with VLEN variables";
-static const char __pyx_k_cannot_set__FillValue_attribute[] = "cannot set _FillValue attribute for VLEN or compound variable";
-static const char __pyx_k_cannot_specify_chunksizes_for_a[] = "cannot specify chunksizes for a contiguous dataset";
-static const 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 const 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 const char __pyx_k_endian_keyword_argument_must_be[] = "'endian' keyword argument must be 'little','big' or 'native', got '%s'";
-static const char __pyx_k_endian_ness_of_dtype_and_endian[] = "endian-ness of dtype and endian kwarg do not match, using endian kwarg";
-static const char __pyx_k_file_format_does_not_support_NC[] = "file format does not support NC_STRING attributes";
-static const 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. [...]
-static const char __pyx_k_illegal_data_type_for_attribute[] = "illegal data type for attribute, must be one of %s, got %s";
-static const char __pyx_k_name_s_numpy_dtype_s_fields_val[] = ": name = '%s', numpy dtype = %s, fields/values =%s\n";
-static const char __pyx_k_negative_reference_year_in_time[] = "negative reference year in time units, must be >= 1";
-static const char __pyx_k_netcdf_time_variable_is_missing[] = "netcdf time variable is missing a 'units' attribute";
-static const 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 const char __pyx_k_s_is_one_of_the_reserved_attrib[] = "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead.";
-static const char __pyx_k_same_as_data_model_retained_for[] = "same as `data_model`, retained for backwards compatibility.";
-static const char __pyx_k_wrong_data_type_in_object_array[] = "wrong data type in object array: should be %s, got %s";
-static const char __pyx_k_wrong_data_type_should_be_s_got[] = "wrong data type: should be %s, got %s";
-static const 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 const char __pyx_k_A_numpy_integer_dtype_object_des[] = "A numpy integer dtype object describing the base type for the Enum.";
-static const char __pyx_k_A_python_dictionary_describing_t[] = "A python dictionary describing the enum fields and values.";
-static const char __pyx_k_A_tuple_with_the_current_shape_l[] = "A tuple with the current shape (length of all dimensions).";
-static const char __pyx_k_Dataset_get_variables_by_attribu[] = "Dataset.get_variables_by_attributes (line 2550)";
-static const 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 const char __pyx_k_Dimension_object_no_longer_valid[] = "Dimension object no longer valid";
-static const 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 const 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 const char __pyx_k_MFNetCDF4_only_works_with_NETCDF[] = "MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4";
-static const char __pyx_k_MFTime_requires_that_the_same_ti[] = "MFTime requires that the same time calendar is used by all files.";
-static const char __pyx_k_MFTime_requires_that_the_time_va[] = "MFTime requires that the time variable in all files have a calendar attribute";
-static const 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 const 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 const 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 const 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 const char __pyx_k_The_number_of_variable_dimension[] = "The number of variable dimensions.";
-static const 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 const char __pyx_k_Unsupported_compound_type_elemen[] = "Unsupported compound type element";
-static const char __pyx_k_Variable_least_significant_digit[] = "Variable.least_significant_digit";
-static const 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 const char __pyx_k_WARNING_unsupported_Compound_typ[] = "WARNING: unsupported Compound type, skipping...";
-static const char __pyx_k_WARNING_unsupported_Enum_type_sk[] = "WARNING: unsupported Enum type, skipping...";
-static const char __pyx_k_WARNING_unsupported_VLEN_type_sk[] = "WARNING: unsupported VLEN type, skipping...";
-static const char __pyx_k_WARNING_variable_s_has_unsupport[] = "WARNING: variable '%s' has unsupported compound datatype, skipping ..";
-static const char __pyx_k_aggregation_variable_s_not_defin[] = "aggregation variable %s not defined in %s";
-static const char __pyx_k_attribute_s_has_unsupported_data[] = "attribute %s has unsupported datatype";
-static const 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 const char __pyx_k_cannot_close_a_netCDF4_Group_onl[] = "cannot close a `netCDF4.Group` (only applies to Dataset)";
-static const char __pyx_k_cannot_find_compound_type_in_thi[] = "cannot find compound type in this group or parent groups";
-static const char __pyx_k_cannot_use_utc_offset_for_refere[] = "cannot use utc_offset for reference years <= 0";
-static const char __pyx_k_cannot_using_file_globbing_for_r[] = "cannot using file globbing for remote (OPeNDAP) datasets";
-static const char __pyx_k_chunksize_cannot_exceed_dimensio[] = "chunksize cannot exceed dimension size";
-static const char __pyx_k_chunksizes_must_be_a_sequence_wi[] = "chunksizes must be a sequence with the same length as dimensions";
-static const char __pyx_k_compound_field_of_an_unsupported[] = "compound field of an unsupported data type";
-static const char __pyx_k_created_using_fill_value_keyword[] = "created (using fill_value keyword to createVariable)";
-static const char __pyx_k_data_can_only_be_assigned_to_VLE[] = "data can only be assigned to VLEN variables using integer indices";
-static const 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 const 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 const char __pyx_k_diskless_mode_requires_netcdf_li[] = "diskless mode requires netcdf lib >= 4.2.1, you have %s";
-static const char __pyx_k_dtype_must_string_or_unicode_S_o[] = "dtype must string or unicode ('S' or 'U')";
-static const char __pyx_k_filling_on_default__FillValue_of[] = "filling on, default _FillValue of %s ignored\n";
-static const char __pyx_k_format_not_supported_by_python_i[] = "format not supported by python interface";
-static const 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 const char __pyx_k_illegal_primitive_data_type_must[] = "illegal primitive data type, must be one of %s, got %s";
-static const char __pyx_k_invalid_scale_factor_or_add_offs[] = "invalid scale_factor or add_offset attribute, no unpacking done...";
-static const char __pyx_k_masked_arrays_cannot_be_assigned[] = "masked arrays cannot be assigned by VLEN str slices";
-static const char __pyx_k_master_dataset_s_does_not_have_a[] = "master dataset %s does not have a aggregation dimension";
-static const char __pyx_k_negative_strides_not_allowed_whe[] = "negative strides not allowed when slicing MFVariable Variable instance";
-static const char __pyx_k_numpy_data_type_for_primitive_da[] = "numpy data type (for primitive data types) or\n VLType/CompoundType/EnumType instance (for compound, vlen or enum\n data types).";
-static const char __pyx_k_only_endian_native_allowed_for_N[] = "only endian='native' allowed for NETCDF3 files";
-static const 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 const char __pyx_k_please_install_ordereddict_https[] = "please install ordereddict (https://pypi.python.org/pypi/ordereddict)";
-static const char __pyx_k_root_group_s_data_model_file_for[] = "root group (%s data model, file format %s):\n";
-static const char __pyx_k_size_of_data_array_does_not_conf[] = "size of data array does not conform to slice";
-static const char __pyx_k_strides_must_all_be_1_for_string[] = "strides must all be 1 for string variables";
-static const char __pyx_k_strides_must_all_be_1_for_vlen_v[] = "strides must all be 1 for vlen variables";
-static const char __pyx_k_to_assign_values_to_a_non_scalar[] = "to assign values to a non-scalar variable, use a slice";
-static const char __pyx_k_to_retrieve_values_from_a_non_sc[] = "to retrieve values from a non-scalar variable, use slicing";
-static const char __pyx_k_trying_to_assign_illegal_value_t[] = "trying to assign illegal value to Enum variable";
-static const char __pyx_k_type_must_string_or_unicode_S_or[] = "type must string or unicode ('S' or 'U')";
-static const char __pyx_k_unsupported_component_type_for_V[] = "unsupported component type for VLEN";
-static const char __pyx_k_unsupported_datatype_specified_f[] = "unsupported datatype specified for VLEN";
-static const char __pyx_k_variable_s_data_type_mismatch_be[] = "variable %s : data type mismatch between master %s (%s) and extension %s (%s)";
-static const char __pyx_k_variable_s_dimensions_mismatch_b[] = "variable %s : dimensions mismatch between master %s (%s) and extension %s (%s)";
-static const char __pyx_k_variable_s_rank_mismatch_between[] = "variable %s : rank mismatch between master %s (%s) and extension %s (%s)";
-static const char __pyx_k_variable_s_shape_mismatch_betwee[] = "variable %s : shape mismatch between master %s (%s) and extension %s (%s)";
-static const char __pyx_k_A_numpy_dtype_object_describing_2[] = "A numpy dtype object describing the compound data type.";
-static const char __pyx_k_A_numpy_dtype_object_describing_3[] = "A numpy dtype object describing the component type for the VLEN.";
-static const 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 const 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 const char __pyx_k_WARNING_variable_s_has_unsupport_2[] = "WARNING: variable '%s' has unsupported VLEN datatype, skipping ..";
-static const char __pyx_k_WARNING_variable_s_has_unsupport_3[] = "WARNING: variable '%s' has unsupported Enum datatype, skipping ..";
-static const char __pyx_k_WARNING_variable_s_has_unsupport_4[] = "WARNING: variable '%s' has unsupported datatype, skipping ..";
-static const char __pyx_k_filling_on_default__FillValue_of_2[] = "filling on, default _FillValue of %s used\n";
-static const char __pyx_k_master_dataset_s_does_not_have_a_2[] = "master dataset %s does not have any variables to aggregate";
-static const 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_10;
-static PyObject *__pyx_kp_s_1_2_7;
-static PyObject *__pyx_kp_s_4_2_1;
-static PyObject *__pyx_kp_s_4_4_0;
-static PyObject *__pyx_kp_s_4_4_1;
-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_is_not_picklable;
-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_is_not_picklable;
-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_is_not_picklable;
-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_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___reduce;
-static PyObject *__pyx_n_s_MFDataset___repr;
-static PyObject *__pyx_n_s_MFDataset___setattr;
-static PyObject *__pyx_n_s_MFDataset_close;
-static PyObject *__pyx_kp_s_MFDataset_is_not_picklable;
-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_MemoryError;
-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_NotImplementedError;
-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_n_s_UnicodeError;
-static PyObject *__pyx_kp_s_Unsupported_compound_type_elemen;
-static PyObject *__pyx_kp_s_Users_jswhit_python_netcdf4_pyt;
-static PyObject *__pyx_n_s_V;
-static PyObject *__pyx_kp_s_VLType_dtype;
-static PyObject *__pyx_kp_s_VLType_is_not_picklable;
-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_is_not_picklable;
-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_mask;
-static PyObject *__pyx_n_s_Variable_set_auto_maskandscale;
-static PyObject *__pyx_n_s_Variable_set_auto_scale;
-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_Backwards_incompatible;
-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__13;
-static PyObject *__pyx_kp_s__14;
-static PyObject *__pyx_kp_s__15;
-static PyObject *__pyx_kp_s__18;
-static PyObject *__pyx_kp_s__2;
-static PyObject *__pyx_kp_s__20;
-static PyObject *__pyx_kp_s__21;
-static PyObject *__pyx_kp_s__23;
-static PyObject *__pyx_kp_s__24;
-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_ascii;
-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_buffer;
-static PyObject *__pyx_n_s_byteorder;
-static PyObject *__pyx_n_s_bytestr;
-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_kp_s_data_can_only_be_assigned_to_VLE;
-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_encoding;
-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_kp_s_file_format_does_not_support_NC;
-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_lsd;
-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_isnative;
-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_memoryview;
-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_ndarray;
-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_num;
-static PyObject *__pyx_n_s_num2date;
-static PyObject *__pyx_n_s_numpy;
-static PyObject *__pyx_kp_s_numpy_data_type_for_primitive_da;
-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_reduce;
-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_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_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_n_s_to_ascii;
-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_valid_max;
-static PyObject *__pyx_n_s_valid_min;
-static PyObject *__pyx_n_s_valid_range;
-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_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_22genexpr(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_20__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_22sync(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_24_redef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_26_enddef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_28set_fill_on(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_30set_fill_off(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_32createDimension(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_34renameDimension(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_36createCompoundType(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_38createVLType(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_40createEnumType(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_42createVariable(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 [...]
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_44renameVariable(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_46createGroup(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_groupname); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_48ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_50setncattr(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_52setncattr_string(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_54setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_56getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_58__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_60delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_62__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_64__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_66renameAttribute(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_68renameGroup(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_70set_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_72set_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_74set_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_76get_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, [...]
-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_18setncattr_string(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_20setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_22getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_24delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_26filters(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_28endian(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_30chunking(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_32get_var_chunk_cache(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_34set_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_36__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_38__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_40__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_42renameAttribute(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_44__getitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_46_toma(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_48_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_50__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_52__len__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_54assignValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_56getValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_58set_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_60set_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_62set_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_64_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_66_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_68__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* 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 PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8_has_lsd___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */
-static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_has_lsd_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_has_lsd_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_6__reduce__(CYTHON_UNUSED 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_6__reduce__(CYTHON_UNUSED 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_6__reduce__(CYTHON_UNUSED 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_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytestr); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8_dateparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_timestr); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10stringtoarr(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_12stringtochar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_14chartostring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_16date2num(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_18num2date(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_20date2index(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_14__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_9MFDataset_12__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED 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_16set_auto_mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_18set_auto_scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_20__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_5;
-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__8;
-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__9;
-static PyObject *__pyx_slice__10;
-static PyObject *__pyx_slice__11;
-static PyObject *__pyx_slice__12;
-static PyObject *__pyx_slice__39;
-static PyObject *__pyx_slice__40;
-static PyObject *__pyx_slice__46;
-static PyObject *__pyx_slice__47;
-static PyObject *__pyx_slice__55;
-static PyObject *__pyx_slice__56;
-static PyObject *__pyx_slice__57;
-static PyObject *__pyx_slice__58;
-static PyObject *__pyx_slice__59;
-static PyObject *__pyx_slice__60;
-static PyObject *__pyx_slice__65;
-static PyObject *__pyx_slice__68;
-static PyObject *__pyx_slice__70;
-static PyObject *__pyx_slice__71;
-static PyObject *__pyx_slice__72;
-static PyObject *__pyx_slice__76;
-static PyObject *__pyx_slice__79;
-static PyObject *__pyx_slice__80;
-static PyObject *__pyx_slice__86;
-static PyObject *__pyx_slice__88;
-static PyObject *__pyx_slice__94;
-static PyObject *__pyx_slice__95;
-static PyObject *__pyx_slice__99;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__22;
-static PyObject *__pyx_tuple__25;
-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__45;
-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__53;
-static PyObject *__pyx_tuple__54;
-static PyObject *__pyx_tuple__61;
-static PyObject *__pyx_tuple__62;
-static PyObject *__pyx_tuple__63;
-static PyObject *__pyx_tuple__64;
-static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__67;
-static PyObject *__pyx_tuple__69;
-static PyObject *__pyx_tuple__73;
-static PyObject *__pyx_tuple__74;
-static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__77;
-static PyObject *__pyx_tuple__78;
-static PyObject *__pyx_tuple__81;
-static PyObject *__pyx_tuple__82;
-static PyObject *__pyx_tuple__83;
-static PyObject *__pyx_tuple__84;
-static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_tuple__87;
-static PyObject *__pyx_tuple__89;
-static PyObject *__pyx_tuple__90;
-static PyObject *__pyx_tuple__91;
-static PyObject *__pyx_tuple__92;
-static PyObject *__pyx_tuple__93;
-static PyObject *__pyx_tuple__96;
-static PyObject *__pyx_tuple__97;
-static PyObject *__pyx_tuple__98;
-static PyObject *__pyx_slice__100;
-static PyObject *__pyx_slice__109;
-static PyObject *__pyx_slice__114;
-static PyObject *__pyx_slice__115;
-static PyObject *__pyx_slice__116;
-static PyObject *__pyx_slice__117;
-static PyObject *__pyx_slice__121;
-static PyObject *__pyx_slice__122;
-static PyObject *__pyx_slice__123;
-static PyObject *__pyx_slice__125;
-static PyObject *__pyx_slice__134;
-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__108;
-static PyObject *__pyx_tuple__110;
-static PyObject *__pyx_tuple__111;
-static PyObject *__pyx_tuple__112;
-static PyObject *__pyx_tuple__113;
-static PyObject *__pyx_tuple__118;
-static PyObject *__pyx_tuple__119;
-static PyObject *__pyx_tuple__120;
-static PyObject *__pyx_tuple__124;
-static PyObject *__pyx_tuple__126;
-static PyObject *__pyx_tuple__127;
-static PyObject *__pyx_tuple__128;
-static PyObject *__pyx_tuple__129;
-static PyObject *__pyx_tuple__130;
-static PyObject *__pyx_tuple__133;
-static PyObject *__pyx_tuple__135;
-static PyObject *__pyx_tuple__136;
-static PyObject *__pyx_tuple__137;
-static PyObject *__pyx_tuple__138;
-static PyObject *__pyx_tuple__140;
-static PyObject *__pyx_tuple__142;
-static PyObject *__pyx_tuple__143;
-static PyObject *__pyx_tuple__145;
-static PyObject *__pyx_tuple__147;
-static PyObject *__pyx_tuple__149;
-static PyObject *__pyx_tuple__151;
-static PyObject *__pyx_tuple__153;
-static PyObject *__pyx_tuple__155;
-static PyObject *__pyx_tuple__157;
-static PyObject *__pyx_tuple__159;
-static PyObject *__pyx_tuple__161;
-static PyObject *__pyx_tuple__163;
-static PyObject *__pyx_tuple__165;
-static PyObject *__pyx_tuple__167;
-static PyObject *__pyx_tuple__169;
-static PyObject *__pyx_tuple__171;
-static PyObject *__pyx_tuple__173;
-static PyObject *__pyx_tuple__175;
-static PyObject *__pyx_tuple__177;
-static PyObject *__pyx_tuple__179;
-static PyObject *__pyx_tuple__181;
-static PyObject *__pyx_tuple__183;
-static PyObject *__pyx_tuple__185;
-static PyObject *__pyx_tuple__187;
-static PyObject *__pyx_tuple__189;
-static PyObject *__pyx_tuple__191;
-static PyObject *__pyx_tuple__193;
-static PyObject *__pyx_tuple__195;
-static PyObject *__pyx_tuple__197;
-static PyObject *__pyx_tuple__199;
-static PyObject *__pyx_tuple__201;
-static PyObject *__pyx_tuple__203;
-static PyObject *__pyx_tuple__204;
-static PyObject *__pyx_codeobj__131;
-static PyObject *__pyx_codeobj__132;
-static PyObject *__pyx_codeobj__139;
-static PyObject *__pyx_codeobj__141;
-static PyObject *__pyx_codeobj__144;
-static PyObject *__pyx_codeobj__146;
-static PyObject *__pyx_codeobj__148;
-static PyObject *__pyx_codeobj__150;
-static PyObject *__pyx_codeobj__152;
-static PyObject *__pyx_codeobj__154;
-static PyObject *__pyx_codeobj__156;
-static PyObject *__pyx_codeobj__158;
-static PyObject *__pyx_codeobj__160;
-static PyObject *__pyx_codeobj__162;
-static PyObject *__pyx_codeobj__164;
-static PyObject *__pyx_codeobj__166;
-static PyObject *__pyx_codeobj__168;
-static PyObject *__pyx_codeobj__170;
-static PyObject *__pyx_codeobj__172;
-static PyObject *__pyx_codeobj__174;
-static PyObject *__pyx_codeobj__176;
-static PyObject *__pyx_codeobj__178;
-static PyObject *__pyx_codeobj__180;
-static PyObject *__pyx_codeobj__182;
-static PyObject *__pyx_codeobj__184;
-static PyObject *__pyx_codeobj__186;
-static PyObject *__pyx_codeobj__188;
-static PyObject *__pyx_codeobj__190;
-static PyObject *__pyx_codeobj__192;
-static PyObject *__pyx_codeobj__194;
-static PyObject *__pyx_codeobj__196;
-static PyObject *__pyx_codeobj__198;
-static PyObject *__pyx_codeobj__200;
-static PyObject *__pyx_codeobj__202;
-static PyObject *__pyx_codeobj__205;
-static PyObject *__pyx_gb_7netCDF4_8_netCDF4_24generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "netCDF4/_netCDF4.pyx":1032
- * _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_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
- struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *__pyx_cur_scope;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __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_24generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!gen)) __PYX_ERR(0, 1032, __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_24generator(__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;
- __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_ERR(0, 1032, __pyx_L1_error)
- __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1032, __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_ERR(0, 1032, __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_ERR(0, 1032, __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_ERR(0, 1032, __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_ERR(0, 1032, __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_ERR(0, 1032, __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":958
- * # 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;
- __Pyx_RefNannySetupContext("_gethdf5libversion", 0);
-
- /* "netCDF4/_netCDF4.pyx":959
- *
- * def _gethdf5libversion():
- * majorvers = H5_VERS_MAJOR # <<<<<<<<<<<<<<
- * minorvers = H5_VERS_MINOR
- * releasevers = H5_VERS_RELEASE
- */
- __pyx_v_majorvers = H5_VERS_MAJOR;
-
- /* "netCDF4/_netCDF4.pyx":960
- * 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":961
- * 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":962
- * 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_ERR(0, 962, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_patchstring = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":963
- * 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_ERR(0, 963, __pyx_L1_error)
- __pyx_t_3 = ((!__pyx_t_2) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":964
- * 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_ERR(0, 964, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minorvers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_releasevers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __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_ERR(0, 964, __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":963
- * releasevers = H5_VERS_RELEASE
- * patchstring = H5_VERS_SUBRELEASE.decode('ascii')
- * if not patchstring: # <<<<<<<<<<<<<<
- * return '%d.%d.%d' % (majorvers,minorvers,releasevers)
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":966
- * 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_ERR(0, 966, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_minorvers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_releasevers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __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_ERR(0, 966, __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":958
- * # 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":968
- * 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;
- __Pyx_RefNannySetupContext("getlibversion", 0);
-
- /* "netCDF4/_netCDF4.pyx":975
- * used to build the module, and when it was built.
- * """
- * return (<char *>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_ERR(0, 975, __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":968
- * 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":1080
- * # 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;
- __Pyx_RefNannySetupContext("_get_att_names", 0);
-
- /* "netCDF4/_netCDF4.pyx":1084
- * 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":1085
- * 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":1086
- * 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":1085
- * 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":1084
- * 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":1088
- * 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":1089
- * else:
- * with nogil:
- * ierr = nc_inq_varnatts(grpid, varid, &numatts) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_varnatts(__pyx_v_grpid, __pyx_v_varid, (&__pyx_v_numatts));
- }
-
- /* "netCDF4/_netCDF4.pyx":1088
- * 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":1090
- * with nogil:
- * ierr = nc_inq_varnatts(grpid, varid, &numatts)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * attslist = []
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1091
- * ierr = nc_inq_varnatts(grpid, varid, &numatts)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1091, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __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_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __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_ERR(0, 1091, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1090
- * with nogil:
- * ierr = nc_inq_varnatts(grpid, varid, &numatts)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * attslist = []
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1092
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1092, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_attslist = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1093
- * raise AttributeError((<char *>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":1094
- * 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":1095
- * for n from 0 <= n < numatts:
- * with nogil:
- * ierr = nc_inq_attname(grpid, varid, n, namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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":1094
- * 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":1096
- * with nogil:
- * ierr = nc_inq_attname(grpid, varid, n, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>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":1097
- * ierr = nc_inq_attname(grpid, varid, n, namstring)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1097, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __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_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __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_ERR(0, 1097, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1096
- * with nogil:
- * ierr = nc_inq_attname(grpid, varid, n, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * attslist.append(namstring.decode(default_encoding,unicode_error))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1098
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1098, __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_ERR(0, 1098, __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_ERR(0, 1098, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1098, __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_ERR(0, 1098, __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_ERR(0, 1098, __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_ERR(0, 1098, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":1099
- * raise AttributeError((<char *>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":1080
- * # 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":1101
- * 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;
- nc_type __pyx_v_att_type;
- PyArrayObject *__pyx_v_value_arr = 0;
- PyObject *__pyx_v_bytestr = NULL;
- PyObject *__pyx_v_pstring = NULL;
- char **__pyx_v_values;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_type_att = NULL;
- size_t __pyx_v_j;
- 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;
- size_t __pyx_t_12;
- size_t __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_t_15;
- char const *__pyx_t_16;
- 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;
- char const *__pyx_t_23;
- PyObject *__pyx_t_24 = NULL;
- PyObject *__pyx_t_25 = NULL;
- PyObject *__pyx_t_26 = NULL;
- PyObject *__pyx_t_27 = NULL;
- PyObject *__pyx_t_28 = NULL;
- PyObject *__pyx_t_29 = NULL;
- PyObject *__pyx_t_30 = NULL;
- PyObject *__pyx_t_31 = NULL;
- __Pyx_RefNannySetupContext("_get_att", 0);
-
- /* "netCDF4/_netCDF4.pyx":1108
- * 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_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1109
- * 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_ERR(0, 1109, __pyx_L1_error)
- __pyx_v_attname = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1110
- * 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_ERR(0, 1110, __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_ERR(0, 1110, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_3;
-
- /* "netCDF4/_netCDF4.pyx":1111
- * 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":1112
- * _grpid = grp._grpid
- * with nogil:
- * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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":1111
- * 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":1113
- * with nogil:
- * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>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":1114
- * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1114, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __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_ERR(0, 1114, __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_ERR(0, 1114, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1113
- * with nogil:
- * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # attribute is a character or string ...
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1116
- * raise AttributeError((<char *>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":1117
- * # 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, <char *>value_arr.data)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __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_ERR(0, 1117, __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_ERR(0, 1117, __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_ERR(0, 1117, __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_ERR(0, 1117, __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_ERR(0, 1117, __pyx_L1_error)
- __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1118
- * if att_type == NC_CHAR:
- * value_arr = numpy.empty(att_len,'S1')
- * with nogil: # <<<<<<<<<<<<<<
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>value_arr.data)
- * if ierr != NC_NOERR:
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1119
- * value_arr = numpy.empty(att_len,'S1')
- * with nogil:
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>value_arr.data) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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":1118
- * if att_type == NC_CHAR:
- * value_arr = numpy.empty(att_len,'S1')
- * with nogil: # <<<<<<<<<<<<<<
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>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":1120
- * with nogil:
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>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":1121
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>value_arr.data)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1121, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1121, __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_ERR(0, 1121, __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_ERR(0, 1121, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1120
- * with nogil:
- * ierr = nc_get_att_text(_grpid, varid, attname, <char *>value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if name == '_FillValue' and python3:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1122
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 1122, __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_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1122, __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":1125
- * # make sure _FillValue for character arrays is a byte on python 3
- * # (issue 271).
- * pstring = value_arr.tostring() # <<<<<<<<<<<<<<
- * else:
- * pstring =\
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_tostring); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_pstring = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1122
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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":1128
- * 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_ERR(0, 1128, __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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1128, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_decode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __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_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1128, __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_ERR(0, 1128, __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_6);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_5);
- __pyx_t_6 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __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_1, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_pstring = __pyx_t_1;
- __pyx_t_1 = 0;
- }
- __pyx_L11:;
-
- /* "netCDF4/_netCDF4.pyx":1129
- * pstring =\
- * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','')
- * return pstring # <<<<<<<<<<<<<<
- * elif att_type == NC_STRING:
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_pstring);
- __pyx_r = __pyx_v_pstring;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1116
- * raise AttributeError((<char *>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":1130
- * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','')
- * return pstring
- * elif att_type == NC_STRING: # <<<<<<<<<<<<<<
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- * if not values:
- */
- case NC_STRING:
-
- /* "netCDF4/_netCDF4.pyx":1131
- * return pstring
- * elif att_type == NC_STRING:
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len) # <<<<<<<<<<<<<<
- * if not values:
- * raise MemoryError()
- */
- __pyx_v_values = ((char **)PyMem_Malloc(((sizeof(char *)) * __pyx_v_att_len)));
-
- /* "netCDF4/_netCDF4.pyx":1132
- * elif att_type == NC_STRING:
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- * if not values: # <<<<<<<<<<<<<<
- * raise MemoryError()
- * try:
- */
- __pyx_t_4 = ((!(__pyx_v_values != 0)) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":1133
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- * if not values:
- * raise MemoryError() # <<<<<<<<<<<<<<
- * try:
- * with nogil:
- */
- PyErr_NoMemory(); __PYX_ERR(0, 1133, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1132
- * elif att_type == NC_STRING:
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- * if not values: # <<<<<<<<<<<<<<
- * raise MemoryError()
- * try:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1134
- * if not values:
- * raise MemoryError()
- * try: # <<<<<<<<<<<<<<
- * with nogil:
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- */
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1135
- * raise MemoryError()
- * try:
- * with nogil: # <<<<<<<<<<<<<<
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- * if ierr != NC_NOERR:
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1136
- * try:
- * with nogil:
- * ierr = nc_get_att_string(_grpid, varid, attname, values) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_get_att_string(__pyx_v__grpid, __pyx_v_varid, __pyx_v_attname, __pyx_v_values);
- }
-
- /* "netCDF4/_netCDF4.pyx":1135
- * raise MemoryError()
- * try:
- * with nogil: # <<<<<<<<<<<<<<
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- * if ierr != NC_NOERR:
- */
- /*finally:*/ {
- /*normal exit:*/{
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- goto __pyx_L20;
- }
- __pyx_L20:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1137
- * with nogil:
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try:
- */
- __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":1138
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * try:
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','')
- */
- __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_ERR(0, 1138, __pyx_L16_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1138, __pyx_L16_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L16_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 1138, __pyx_L16_error)
-
- /* "netCDF4/_netCDF4.pyx":1137
- * with nogil:
- * ierr = nc_get_att_string(_grpid, varid, attname, values)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1139
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try: # <<<<<<<<<<<<<<
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','')
- * for j in range(att_len)]
- */
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1140
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try:
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<<
- * for j in range(att_len)]
- * finally:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":1141
- * try:
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','')
- * for j in range(att_len)] # <<<<<<<<<<<<<<
- * finally:
- * ierr = nc_free_string(att_len, values) # free memory in netcdf C lib
- */
- __pyx_t_12 = __pyx_v_att_len;
- for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
- __pyx_v_j = __pyx_t_13;
-
- /* "netCDF4/_netCDF4.pyx":1140
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try:
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<<
- * for j in range(att_len)]
- * finally:
- */
- __pyx_t_11 = __Pyx_PyBytes_FromString((__pyx_v_values[__pyx_v_j])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L23_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_14 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_14);
- if (__pyx_t_7) {
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_t_6);
- __pyx_t_11 = 0;
- __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1140, __pyx_L23_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __pyx_v_result = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":1143
- * for j in range(att_len)]
- * finally:
- * ierr = nc_free_string(att_len, values) # free memory in netcdf C lib # <<<<<<<<<<<<<<
- * finally:
- * PyMem_Free(values)
- */
- /*finally:*/ {
- /*normal exit:*/{
- __pyx_v_ierr = nc_free_string(__pyx_v_att_len, __pyx_v_values);
- goto __pyx_L24;
- }
- /*exception exit:*/{
- __Pyx_PyThreadState_declare
- __pyx_L23_error:;
- __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_17);
- __Pyx_XGOTREF(__pyx_t_18);
- __Pyx_XGOTREF(__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_21);
- __Pyx_XGOTREF(__pyx_t_22);
- __pyx_t_3 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
- {
- __pyx_v_ierr = nc_free_string(__pyx_v_att_len, __pyx_v_values);
- }
- __Pyx_PyThreadState_assign
- if (PY_MAJOR_VERSION >= 3) {
- __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);
- }
- __Pyx_XGIVEREF(__pyx_t_17);
- __Pyx_XGIVEREF(__pyx_t_18);
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
- __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
- __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
- goto __pyx_L16_error;
- }
- __pyx_L24:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1145
- * ierr = nc_free_string(att_len, values) # free memory in netcdf C lib
- * finally:
- * PyMem_Free(values) # <<<<<<<<<<<<<<
- *
- * if len(result) == 1:
- */
- /*finally:*/ {
- /*normal exit:*/{
- PyMem_Free(__pyx_v_values);
- goto __pyx_L17;
- }
- /*exception exit:*/{
- __Pyx_PyThreadState_declare
- __pyx_L16_error:;
- __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_22);
- __Pyx_XGOTREF(__pyx_t_21);
- __Pyx_XGOTREF(__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_18);
- __Pyx_XGOTREF(__pyx_t_17);
- __pyx_t_15 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
- {
- PyMem_Free(__pyx_v_values);
- }
- __Pyx_PyThreadState_assign
- if (PY_MAJOR_VERSION >= 3) {
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_XGIVEREF(__pyx_t_18);
- __Pyx_XGIVEREF(__pyx_t_17);
- __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
- }
- __Pyx_XGIVEREF(__pyx_t_22);
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
- __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
- __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_23;
- goto __pyx_L1_error;
- }
- __pyx_L17:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1147
- * PyMem_Free(values)
- *
- * if len(result) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * else:
- */
- __pyx_t_8 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1147, __pyx_L1_error)
- __pyx_t_4 = ((__pyx_t_8 == 1) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":1148
- *
- * if len(result) == 1:
- * return result[0] # <<<<<<<<<<<<<<
- * else:
- * return result
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1148, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1147
- * PyMem_Free(values)
- *
- * if len(result) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1150
- * return result[0]
- * else:
- * return result # <<<<<<<<<<<<<<
- * else:
- * # a regular numeric or compound type.
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":1130
- * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','')
- * return pstring
- * elif att_type == NC_STRING: # <<<<<<<<<<<<<<
- * values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
- * if not values:
- */
- break;
- default:
-
- /* "netCDF4/_netCDF4.pyx":1153
- * 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":1154
- * # 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":1153
- * else:
- * # a regular numeric or compound type.
- * if att_type == NC_LONG: # <<<<<<<<<<<<<<
- * att_type = NC_INT
- * try:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1155
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_17);
- __Pyx_XGOTREF(__pyx_t_18);
- __Pyx_XGOTREF(__pyx_t_19);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1156
- * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_att_type, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_type_att = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1157
- * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1157, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_14)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_8 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1157, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_14) {
- __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __pyx_t_14 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_type_att);
- __Pyx_GIVEREF(__pyx_v_type_att);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_type_att);
- __pyx_t_1 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1157, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) __PYX_ERR(0, 1157, __pyx_L33_error)
- __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1155
- * 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_17); __pyx_t_17 = 0;
- __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
- __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
- goto __pyx_L40_try_end;
- __pyx_L33_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1158
- * 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 = __Pyx_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_9, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1158, __pyx_L35_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "netCDF4/_netCDF4.pyx":1160
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1161
- * # 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_1 = __pyx_f_7netCDF4_8_netCDF4__read_compound(__pyx_v_grp, __pyx_v_att_type, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_type_att, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1162
- * 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_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_7 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_8 = 1;
- }
- }
- __pyx_t_24 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_24);
- if (__pyx_t_7) {
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_7); __pyx_t_7 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_8, __pyx_t_14);
- __Pyx_INCREF(__pyx_v_type_att);
- __Pyx_GIVEREF(__pyx_v_type_att);
- PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_8, __pyx_v_type_att);
- __pyx_t_14 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) __PYX_ERR(0, 1162, __pyx_L43_error)
- __Pyx_XDECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1160
- * 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_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_L50_try_end;
- __pyx_L43_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1163
- * 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_1, &__pyx_t_11, &__pyx_t_24) < 0) __PYX_ERR(0, 1163, __pyx_L45_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GOTREF(__pyx_t_24);
-
- /* "netCDF4/_netCDF4.pyx":1165
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
- __Pyx_XGOTREF(__pyx_t_25);
- __Pyx_XGOTREF(__pyx_t_26);
- __Pyx_XGOTREF(__pyx_t_27);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1166
- * # 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_14 = __pyx_f_7netCDF4_8_netCDF4__read_enum(__pyx_v_grp, __pyx_v_att_type, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1166, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_XDECREF_SET(__pyx_v_type_att, __pyx_t_14);
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1167
- * 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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_28 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_28);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_att, __pyx_n_s_dtype); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_29);
- __pyx_t_30 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_28))) {
- __pyx_t_30 = PyMethod_GET_SELF(__pyx_t_28);
- if (likely(__pyx_t_30)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_28);
- __Pyx_INCREF(__pyx_t_30);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_28, function);
- __pyx_t_8 = 1;
- }
- }
- __pyx_t_31 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_31);
- if (__pyx_t_30) {
- __Pyx_GIVEREF(__pyx_t_30); PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_30); __pyx_t_30 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_31, 0+__pyx_t_8, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_29);
- PyTuple_SET_ITEM(__pyx_t_31, 1+__pyx_t_8, __pyx_t_29);
- __pyx_t_7 = 0;
- __pyx_t_29 = 0;
- __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_28, __pyx_t_31, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
- __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
- if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) __PYX_ERR(0, 1167, __pyx_L53_error)
- __Pyx_XDECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_14));
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1165
- * 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_25); __pyx_t_25 = 0;
- __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
- __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
- goto __pyx_L60_try_end;
- __pyx_L53_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
- __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
- __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1168
- * 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_14, &__pyx_t_28, &__pyx_t_31) < 0) __PYX_ERR(0, 1168, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_GOTREF(__pyx_t_28);
- __Pyx_GOTREF(__pyx_t_31);
-
- /* "netCDF4/_netCDF4.pyx":1169
- * 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_29 = __Pyx_PyBytes_FromString(__pyx_v_attname); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1169, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_29);
- __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_attribute_s_has_unsupported_data, __pyx_t_29); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1169, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
- __pyx_t_29 = PyTuple_New(1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1169, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_29);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_29, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1169, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 1169, __pyx_L55_except_error)
- }
- __pyx_L55_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1165
- * 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_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_25);
- __Pyx_XGIVEREF(__pyx_t_26);
- __Pyx_XGIVEREF(__pyx_t_27);
- __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
- goto __pyx_L45_except_error;
- __pyx_L60_try_end:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- goto __pyx_L44_exception_handled;
- }
- __pyx_L45_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1160
- * 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_PyThreadState_assign
- __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_L35_except_error;
- __pyx_L44_exception_handled:;
- __Pyx_PyThreadState_assign
- __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);
- __pyx_L50_try_end:;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L34_exception_handled;
- }
- goto __pyx_L35_except_error;
- __pyx_L35_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1155
- * 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_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_17);
- __Pyx_XGIVEREF(__pyx_t_18);
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
- goto __pyx_L1_error;
- __pyx_L34_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_17);
- __Pyx_XGIVEREF(__pyx_t_18);
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
- __pyx_L40_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1170
- * 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":1171
- * 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((<char *>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":1170
- * 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_L65;
- }
- __pyx_L65:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1172
- * with nogil:
- * ierr = nc_get_att(_grpid, varid, attname, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>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":1173
- * ierr = nc_get_att(_grpid, varid, attname, value_arr.data)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_6 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 1173, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1172
- * with nogil:
- * ierr = nc_get_att(_grpid, varid, attname, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if value_arr.shape == ():
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1174
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if value_arr.shape == (): # <<<<<<<<<<<<<<
- * # return a scalar for a scalar array
- * return value_arr.item()
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1174, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":1176
- * 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __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":1174
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if value_arr.shape == (): # <<<<<<<<<<<<<<
- * # return a scalar for a scalar array
- * return value_arr.item()
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1177
- * # 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":1179
- * 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_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1177
- * # 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":1181
- * 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":1101
- * 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_14);
- __Pyx_XDECREF(__pyx_t_24);
- __Pyx_XDECREF(__pyx_t_28);
- __Pyx_XDECREF(__pyx_t_29);
- __Pyx_XDECREF(__pyx_t_30);
- __Pyx_XDECREF(__pyx_t_31);
- __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_result);
- __Pyx_XDECREF(__pyx_v_type_att);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":1183
- * 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;
- 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_ERR(0, 1183, __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_ERR(0, 1183, __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;
- __Pyx_RefNannySetupContext("_set_default_format", 0);
-
- /* "netCDF4/_netCDF4.pyx":1185
- * 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_ERR(0, 1185, __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_ERR(0, 1185, __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":1186
- * # 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__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __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_ERR(0, 1186, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1185
- * 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":1187
- * 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_ERR(0, 1187, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __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_ERR(0, 1187, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- nc_set_default_format(__pyx_t_5, NULL);
-
- /* "netCDF4/_netCDF4.pyx":1183
- * 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":1189
- * 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;
- __Pyx_RefNannySetupContext("_get_format", 0);
-
- /* "netCDF4/_netCDF4.pyx":1192
- * # 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":1193
- * cdef int ierr, formatp
- * with nogil:
- * ierr = nc_inq_format(grpid, &formatp) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_format(__pyx_v_grpid, (&__pyx_v_formatp));
- }
-
- /* "netCDF4/_netCDF4.pyx":1192
- * # 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":1194
- * with nogil:
- * ierr = nc_inq_format(grpid, &formatp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1195
- * ierr = nc_inq_format(grpid, &formatp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1195, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1195, __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_ERR(0, 1195, __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_ERR(0, 1195, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1194
- * with nogil:
- * ierr = nc_inq_format(grpid, &formatp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if formatp not in _reverse_format_dict:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1196
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1196, __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_ERR(0, 1196, __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_ERR(0, 1196, __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":1197
- * raise RuntimeError((<char *>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__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __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_ERR(0, 1197, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1196
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1198
- * 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_ERR(0, 1198, __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)) __PYX_ERR(0, 1198, __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":1189
- * 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":1200
- * 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":1223
- * return 'UNDEFINED'
- * ELSE:
- * return 'UNDEFINED' # <<<<<<<<<<<<<<
- *
- * cdef issue485_workaround(int grpid, int varid, char* attname):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_n_s_UNDEFINED);
- __pyx_r = __pyx_n_s_UNDEFINED;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1200
- * 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":1225
- * return 'UNDEFINED'
- *
- * cdef issue485_workaround(int grpid, int varid, char* attname): # <<<<<<<<<<<<<<
- * # check to see if attribute already exists
- * # and is NC_CHAR, if so delete it and re-create it
- */
-
-static PyObject *__pyx_f_7netCDF4_8_netCDF4_issue485_workaround(int __pyx_v_grpid, int __pyx_v_varid, char *__pyx_v_attname) {
- nc_type __pyx_v_att_type;
- size_t __pyx_v_att_len;
- 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;
- __Pyx_RefNannySetupContext("issue485_workaround", 0);
-
- /* "netCDF4/_netCDF4.pyx":1234
- * cdef size_t att_len
- *
- * if not _needsworkaround_issue485: # <<<<<<<<<<<<<<
- * return
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_needsworkaround_issue485); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1234, __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":1235
- *
- * if not _needsworkaround_issue485:
- * return # <<<<<<<<<<<<<<
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- * if ierr == NC_NOERR and att_type == NC_CHAR:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1234
- * cdef size_t att_len
- *
- * if not _needsworkaround_issue485: # <<<<<<<<<<<<<<
- * return
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1236
- * if not _needsworkaround_issue485:
- * return
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len) # <<<<<<<<<<<<<<
- * if ierr == NC_NOERR and att_type == NC_CHAR:
- * ierr = nc_del_att(grpid, varid, attname)
- */
- __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":1237
- * return
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- * if ierr == NC_NOERR and att_type == NC_CHAR: # <<<<<<<<<<<<<<
- * ierr = nc_del_att(grpid, varid, attname)
- * if ierr != NC_NOERR:
- */
- __pyx_t_2 = ((__pyx_v_ierr == NC_NOERR) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L5_bool_binop_done;
- }
- __pyx_t_2 = ((__pyx_v_att_type == NC_CHAR) != 0);
- __pyx_t_3 = __pyx_t_2;
- __pyx_L5_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1238
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- * if ierr == NC_NOERR and att_type == NC_CHAR:
- * ierr = nc_del_att(grpid, varid, attname) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_del_att(__pyx_v_grpid, __pyx_v_varid, __pyx_v_attname);
-
- /* "netCDF4/_netCDF4.pyx":1239
- * if ierr == NC_NOERR and att_type == NC_CHAR:
- * ierr = nc_del_att(grpid, varid, attname)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1240
- * ierr = nc_del_att(grpid, varid, attname)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- *
- * cdef _set_att(grp, int varid, name, value,\
- */
- __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_ERR(0, 1240, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __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_ERR(0, 1240, __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_ERR(0, 1240, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1239
- * if ierr == NC_NOERR and att_type == NC_CHAR:
- * ierr = nc_del_att(grpid, varid, attname)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1237
- * return
- * ierr = nc_inq_att(grpid, varid, attname, &att_type, &att_len)
- * if ierr == NC_NOERR and att_type == NC_CHAR: # <<<<<<<<<<<<<<
- * ierr = nc_del_att(grpid, varid, attname)
- * if ierr != NC_NOERR:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1225
- * return 'UNDEFINED'
- *
- * cdef issue485_workaround(int grpid, int varid, char* attname): # <<<<<<<<<<<<<<
- * # check to see if attribute already exists
- * # and is NC_CHAR, if so delete it and re-create it
- */
-
- /* 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_5);
- __Pyx_AddTraceback("netCDF4._netCDF4.issue485_workaround", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":1242
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * cdef _set_att(grp, int varid, name, value,\ # <<<<<<<<<<<<<<
- * nc_type xtype=-99, force_ncstring=False):
- * # Private function to set an attribute name/value pair
- */
-
-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);
-
- /* "netCDF4/_netCDF4.pyx":1243
- *
- * cdef _set_att(grp, int varid, name, value,\
- * nc_type xtype=-99, force_ncstring=False): # <<<<<<<<<<<<<<
- * # Private function to set an attribute name/value pair
- * cdef int ierr, lenarr
- */
- PyObject *__pyx_v_force_ncstring = ((PyObject *)Py_False);
- int __pyx_v_ierr;
- int __pyx_v_lenarr;
- char *__pyx_v_attname;
- char *__pyx_v_datstring;
- char **__pyx_v_string_ptrs;
- 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_N = NULL;
- PyObject *__pyx_v_strings = NULL;
- PyObject *__pyx_v_j = NULL;
- PyObject *__pyx_v_dats = NULL;
- PyObject *__pyx_v_value_arr1 = NULL;
- CYTHON_UNUSED PyObject *__pyx_v_dats_ascii = NULL;
- PyObject *__pyx_v_s = 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;
- size_t __pyx_t_10;
- Py_ssize_t __pyx_t_11;
- PyObject *(*__pyx_t_12)(PyObject *);
- Py_ssize_t __pyx_t_13;
- int __pyx_t_14;
- char const *__pyx_t_15;
- 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;
- nc_type __pyx_t_22;
- __Pyx_RefNannySetupContext("_set_att", 0);
- if (__pyx_optional_args) {
- if (__pyx_optional_args->__pyx_n > 0) {
- __pyx_v_xtype = __pyx_optional_args->xtype;
- if (__pyx_optional_args->__pyx_n > 1) {
- __pyx_v_force_ncstring = __pyx_optional_args->force_ncstring;
- }
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1250
- * cdef char **string_ptrs
- * 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_ERR(0, 1250, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1251
- * 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_ERR(0, 1251, __pyx_L1_error)
- __pyx_v_attname = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1253
- * 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_ERR(0, 1253, __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_ERR(0, 1253, __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_ERR(0, 1253, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1253, __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_ERR(0, 1253, __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_ERR(0, 1253, __pyx_L1_error)
- __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1256
- * # 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_ERR(0, 1256, __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_ERR(0, 1256, __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_ERR(0, 1256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_fmt = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1257
- * # 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_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1257, __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_ERR(0, 1257, __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_ERR(0, 1257, __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":1258
- * 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_ERR(0, 1258, __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_ERR(0, 1258, __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__8, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __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_ERR(0, 1258, __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_ERR(0, 1258, __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_ERR(0, 1258, __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":1259
- * 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_ERR(0, 1259, __pyx_L1_error)
- __pyx_t_7 = __pyx_t_9;
- __pyx_L6_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":1258
- * 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":1260
- * 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_ERR(0, 1260, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __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_ERR(0, 1260, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_5));
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1258
- * 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":1264
- * # if array contains unicode strings, and data model is NETCDF4,
- * # write as a string.
- * if value_arr.dtype.char in ['S','U']: # <<<<<<<<<<<<<<
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1:
- * N = value_arr.size
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __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_ERR(0, 1264, __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_ERR(0, 1264, __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_ERR(0, 1264, __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":1265
- * # write as a string.
- * if value_arr.dtype.char in ['S','U']:
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1: # <<<<<<<<<<<<<<
- * N = value_arr.size
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- */
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_is_netcdf3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error)
- __pyx_t_8 = ((!__pyx_t_7) != 0);
- if (__pyx_t_8) {
- } else {
- __pyx_t_9 = __pyx_t_8;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_force_ncstring); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error)
- if (__pyx_t_8) {
- } else {
- __pyx_t_9 = __pyx_t_8;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_9 = __pyx_t_8;
- __pyx_L13_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":1266
- * if value_arr.dtype.char in ['S','U']:
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1:
- * N = value_arr.size # <<<<<<<<<<<<<<
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- * if not string_ptrs:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1266, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_N = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1267
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1:
- * N = value_arr.size
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*)) # <<<<<<<<<<<<<<
- * if not string_ptrs:
- * raise MemoryError()
- */
- __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(char *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyNumber_Multiply(__pyx_v_N, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_string_ptrs = ((char **)PyMem_Malloc(__pyx_t_10));
-
- /* "netCDF4/_netCDF4.pyx":1268
- * N = value_arr.size
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- * if not string_ptrs: # <<<<<<<<<<<<<<
- * raise MemoryError()
- * try:
- */
- __pyx_t_9 = ((!(__pyx_v_string_ptrs != 0)) != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":1269
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- * if not string_ptrs:
- * raise MemoryError() # <<<<<<<<<<<<<<
- * try:
- * strings = [_strencode(s) for s in value_arr.flat]
- */
- PyErr_NoMemory(); __PYX_ERR(0, 1269, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1268
- * N = value_arr.size
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- * if not string_ptrs: # <<<<<<<<<<<<<<
- * raise MemoryError()
- * try:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1270
- * if not string_ptrs:
- * raise MemoryError()
- * try: # <<<<<<<<<<<<<<
- * strings = [_strencode(s) for s in value_arr.flat]
- * for j in range(N):
- */
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1271
- * raise MemoryError()
- * try:
- * strings = [_strencode(s) for s in value_arr.flat] # <<<<<<<<<<<<<<
- * for j in range(N):
- * if len(strings[j]) == 0:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_flat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
- __pyx_t_12 = NULL;
- } else {
- __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1271, __pyx_L18_error)
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- for (;;) {
- if (likely(!__pyx_t_12)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1271, __pyx_L18_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1271, __pyx_L18_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_12(__pyx_t_4);
- 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_ERR(0, 1271, __pyx_L18_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_s, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1271, __pyx_L18_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_strings = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1272
- * try:
- * strings = [_strencode(s) for s in value_arr.flat]
- * for j in range(N): # <<<<<<<<<<<<<<
- * if len(strings[j]) == 0:
- * strings[j] = _strencode('\x00')
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_N);
- __Pyx_GIVEREF(__pyx_v_N);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_N);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L18_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_11 = 0;
- __pyx_t_12 = NULL;
- } else {
- __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1272, __pyx_L18_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_12)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1272, __pyx_L18_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1272, __pyx_L18_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_12(__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_ERR(0, 1272, __pyx_L18_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1273
- * strings = [_strencode(s) for s in value_arr.flat]
- * for j in range(N):
- * if len(strings[j]) == 0: # <<<<<<<<<<<<<<
- * strings[j] = _strencode('\x00')
- * string_ptrs[j] = strings[j]
- */
- __pyx_t_4 = PyObject_GetItem(__pyx_v_strings, __pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1273, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 1273, __pyx_L18_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = ((__pyx_t_13 == 0) != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":1274
- * for j in range(N):
- * if len(strings[j]) == 0:
- * strings[j] = _strencode('\x00') # <<<<<<<<<<<<<<
- * string_ptrs[j] = strings[j]
- * issue485_workaround(grp._grpid, varid, attname)
- */
- __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_kp_s_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(PyObject_SetItem(__pyx_v_strings, __pyx_v_j, __pyx_t_4) < 0)) __PYX_ERR(0, 1274, __pyx_L18_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1273
- * strings = [_strencode(s) for s in value_arr.flat]
- * for j in range(N):
- * if len(strings[j]) == 0: # <<<<<<<<<<<<<<
- * strings[j] = _strencode('\x00')
- * string_ptrs[j] = strings[j]
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1275
- * if len(strings[j]) == 0:
- * strings[j] = _strencode('\x00')
- * string_ptrs[j] = strings[j] # <<<<<<<<<<<<<<
- * issue485_workaround(grp._grpid, varid, attname)
- * ierr = nc_put_att_string(grp._grpid, varid, attname, N, string_ptrs)
- */
- __pyx_t_4 = PyObject_GetItem(__pyx_v_strings, __pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1275, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L18_error)
- __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L18_error)
- (__pyx_v_string_ptrs[__pyx_t_13]) = __pyx_t_2;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1272
- * try:
- * strings = [_strencode(s) for s in value_arr.flat]
- * for j in range(N): # <<<<<<<<<<<<<<
- * if len(strings[j]) == 0:
- * strings[j] = _strencode('\x00')
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1276
- * strings[j] = _strencode('\x00')
- * string_ptrs[j] = strings[j]
- * issue485_workaround(grp._grpid, varid, attname) # <<<<<<<<<<<<<<
- * ierr = nc_put_att_string(grp._grpid, varid, attname, N, string_ptrs)
- * finally:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L18_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_ERR(0, 1276, __pyx_L18_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4_issue485_workaround(__pyx_t_6, __pyx_v_varid, __pyx_v_attname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L18_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1277
- * string_ptrs[j] = strings[j]
- * issue485_workaround(grp._grpid, varid, attname)
- * ierr = nc_put_att_string(grp._grpid, varid, attname, N, string_ptrs) # <<<<<<<<<<<<<<
- * finally:
- * PyMem_Free(string_ptrs)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __pyx_L18_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_ERR(0, 1277, __pyx_L18_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_N); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L18_error)
- __pyx_v_ierr = nc_put_att_string(__pyx_t_6, __pyx_v_varid, __pyx_v_attname, __pyx_t_10, __pyx_v_string_ptrs);
- }
-
- /* "netCDF4/_netCDF4.pyx":1279
- * ierr = nc_put_att_string(grp._grpid, varid, attname, N, string_ptrs)
- * finally:
- * PyMem_Free(string_ptrs) # <<<<<<<<<<<<<<
- * else:
- * if not value_arr.shape:
- */
- /*finally:*/ {
- /*normal exit:*/{
- PyMem_Free(__pyx_v_string_ptrs);
- goto __pyx_L19;
- }
- /*exception exit:*/{
- __Pyx_PyThreadState_declare
- __pyx_L18_error:;
- __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __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;
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
- __Pyx_XGOTREF(__pyx_t_16);
- __Pyx_XGOTREF(__pyx_t_17);
- __Pyx_XGOTREF(__pyx_t_18);
- __Pyx_XGOTREF(__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_21);
- __pyx_t_6 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
- {
- PyMem_Free(__pyx_v_string_ptrs);
- }
- __Pyx_PyThreadState_assign
- if (PY_MAJOR_VERSION >= 3) {
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
- }
- __Pyx_XGIVEREF(__pyx_t_16);
- __Pyx_XGIVEREF(__pyx_t_17);
- __Pyx_XGIVEREF(__pyx_t_18);
- __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
- __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
- __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
- goto __pyx_L1_error;
- }
- __pyx_L19:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1265
- * # write as a string.
- * if value_arr.dtype.char in ['S','U']:
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1: # <<<<<<<<<<<<<<
- * N = value_arr.size
- * string_ptrs = <char**>PyMem_Malloc(N * sizeof(char*))
- */
- goto __pyx_L12;
- }
-
- /* "netCDF4/_netCDF4.pyx":1281
- * PyMem_Free(string_ptrs)
- * else:
- * if not value_arr.shape: # <<<<<<<<<<<<<<
- * dats = _strencode(value_arr.item())
- * else:
- */
- /*else*/ {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1281, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = ((!__pyx_t_9) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":1282
- * else:
- * if not value_arr.shape:
- * dats = _strencode(value_arr.item()) # <<<<<<<<<<<<<<
- * else:
- * value_arr1 = value_arr.ravel()
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __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_ERR(0, 1282, __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_ERR(0, 1282, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_dats = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1281
- * PyMem_Free(string_ptrs)
- * else:
- * if not value_arr.shape: # <<<<<<<<<<<<<<
- * dats = _strencode(value_arr.item())
- * else:
- */
- goto __pyx_L27;
- }
-
- /* "netCDF4/_netCDF4.pyx":1284
- * 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_ERR(0, 1284, __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_ERR(0, 1284, __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_ERR(0, 1284, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_value_arr1 = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1285
- * 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_ERR(0, 1285, __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_ERR(0, 1285, __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_ERR(0, 1285, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_dats = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L27:;
-
- /* "netCDF4/_netCDF4.pyx":1286
- * value_arr1 = value_arr.ravel()
- * dats = _strencode(''.join(value_arr1.tolist()))
- * lenarr = len(dats) # <<<<<<<<<<<<<<
- * datstring = dats
- * if lenarr == 0:
- */
- __pyx_t_11 = PyObject_Length(__pyx_v_dats); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1286, __pyx_L1_error)
- __pyx_v_lenarr = __pyx_t_11;
-
- /* "netCDF4/_netCDF4.pyx":1287
- * 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_ERR(0, 1287, __pyx_L1_error)
- __pyx_v_datstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1288
- * lenarr = len(dats)
- * datstring = dats
- * if lenarr == 0: # <<<<<<<<<<<<<<
- * # write null byte
- * lenarr=1; datstring = '\x00'
- */
- __pyx_t_8 = ((__pyx_v_lenarr == 0) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":1290
- * if lenarr == 0:
- * # write null byte
- * lenarr=1; datstring = '\x00' # <<<<<<<<<<<<<<
- * if (force_ncstring or value_arr.dtype.char == 'U') and not is_netcdf3:
- * # try to convert to ascii string, write as NC_CHAR
- */
- __pyx_v_lenarr = 1;
- __pyx_v_datstring = ((char *)"\000");
-
- /* "netCDF4/_netCDF4.pyx":1288
- * lenarr = len(dats)
- * datstring = dats
- * if lenarr == 0: # <<<<<<<<<<<<<<
- * # write null byte
- * lenarr=1; datstring = '\x00'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1291
- * # write null byte
- * lenarr=1; datstring = '\x00'
- * if (force_ncstring or value_arr.dtype.char == 'U') and not is_netcdf3: # <<<<<<<<<<<<<<
- * # try to convert to ascii string, write as NC_CHAR
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- */
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_force_ncstring); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1291, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- goto __pyx_L31_next_and;
- }
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1291, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_9) {
- } else {
- __pyx_t_8 = __pyx_t_9;
- goto __pyx_L30_bool_binop_done;
- }
- __pyx_L31_next_and:;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_is_netcdf3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1291, __pyx_L1_error)
- __pyx_t_7 = ((!__pyx_t_9) != 0);
- __pyx_t_8 = __pyx_t_7;
- __pyx_L30_bool_binop_done:;
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":1294
- * # try to convert to ascii string, write as NC_CHAR
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- * try: # <<<<<<<<<<<<<<
- * if force_ncstring: raise UnicodeError
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_21);
- __Pyx_XGOTREF(__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_19);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":1295
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- * try:
- * if force_ncstring: raise UnicodeError # <<<<<<<<<<<<<<
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- */
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_force_ncstring); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1295, __pyx_L33_error)
- if (__pyx_t_8) {
- __Pyx_Raise(__pyx_builtin_UnicodeError, 0, 0, 0);
- __PYX_ERR(0, 1295, __pyx_L33_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":1296
- * try:
- * if force_ncstring: raise UnicodeError
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string # <<<<<<<<<<<<<<
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * except UnicodeError:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_dats);
- __Pyx_GIVEREF(__pyx_v_dats);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_dats);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L33_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_v_dats_ascii = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1297
- * if force_ncstring: raise UnicodeError
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) # <<<<<<<<<<<<<<
- * except UnicodeError:
- * issue485_workaround(grp._grpid, varid, attname)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L33_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1297, __pyx_L33_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_ierr = nc_put_att_text(__pyx_t_14, __pyx_v_varid, __pyx_v_attname, __pyx_v_lenarr, __pyx_v_datstring);
-
- /* "netCDF4/_netCDF4.pyx":1294
- * # try to convert to ascii string, write as NC_CHAR
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- * try: # <<<<<<<<<<<<<<
- * if force_ncstring: raise UnicodeError
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- */
- }
- __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
- __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
- goto __pyx_L40_try_end;
- __pyx_L33_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1298
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * except UnicodeError: # <<<<<<<<<<<<<<
- * issue485_workaround(grp._grpid, varid, attname)
- * ierr = nc_put_att_string(grp._grpid, varid, attname, 1, &datstring)
- */
- __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeError);
- if (__pyx_t_14) {
- __Pyx_AddTraceback("netCDF4._netCDF4._set_att", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 1298, __pyx_L35_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netCDF4/_netCDF4.pyx":1299
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * except UnicodeError:
- * issue485_workaround(grp._grpid, varid, attname) # <<<<<<<<<<<<<<
- * ierr = nc_put_att_string(grp._grpid, varid, attname, 1, &datstring)
- * else:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1299, __pyx_L35_except_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L35_except_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4_issue485_workaround(__pyx_t_14, __pyx_v_varid, __pyx_v_attname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1299, __pyx_L35_except_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1300
- * except UnicodeError:
- * issue485_workaround(grp._grpid, varid, attname)
- * 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1300, __pyx_L35_except_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L35_except_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_ierr = nc_put_att_string(__pyx_t_14, __pyx_v_varid, __pyx_v_attname, 1, (&__pyx_v_datstring));
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L34_exception_handled;
- }
- goto __pyx_L35_except_error;
- __pyx_L35_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1294
- * # try to convert to ascii string, write as NC_CHAR
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- * try: # <<<<<<<<<<<<<<
- * if force_ncstring: raise UnicodeError
- * dats_ascii = _to_ascii(dats) # try to encode bytes as ascii string
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
- goto __pyx_L1_error;
- __pyx_L34_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
- __pyx_L40_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1291
- * # write null byte
- * lenarr=1; datstring = '\x00'
- * if (force_ncstring or value_arr.dtype.char == 'U') and not is_netcdf3: # <<<<<<<<<<<<<<
- * # try to convert to ascii string, write as NC_CHAR
- * # else it's a unicode string, write as NC_STRING (if NETCDF4)
- */
- goto __pyx_L29;
- }
-
- /* "netCDF4/_netCDF4.pyx":1302
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ierr = nc_put_att_text(__pyx_t_14, __pyx_v_varid, __pyx_v_attname, __pyx_v_lenarr, __pyx_v_datstring);
- }
- __pyx_L29:;
- }
- __pyx_L12:;
-
- /* "netCDF4/_netCDF4.pyx":1303
- * else:
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # a 'regular' array type ('f4','i4','f8' etc)
- */
- __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":1304
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __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_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __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_ERR(0, 1304, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1303
- * else:
- * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # a 'regular' array type ('f4','i4','f8' etc)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1264
- * # if array contains unicode strings, and data model is NETCDF4,
- * # write as a string.
- * if value_arr.dtype.char in ['S','U']: # <<<<<<<<<<<<<<
- * if not is_netcdf3 and force_ncstring and value_arr.size > 1:
- * N = value_arr.size
- */
- goto __pyx_L9;
- }
-
- /* "netCDF4/_netCDF4.pyx":1307
- * # 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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_V, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1307, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":1308
- * 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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__find_cmptype(__pyx_v_grp, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_22 = __Pyx_PyInt_As_nc_type(__pyx_t_3); if (unlikely((__pyx_t_22 == (nc_type)-1) && PyErr_Occurred())) __PYX_ERR(0, 1308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_xtype = __pyx_t_22;
-
- /* "netCDF4/_netCDF4.pyx":1307
- * # 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_L45;
- }
-
- /* "netCDF4/_netCDF4.pyx":1309
- * 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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __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_supportedtypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_4, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":1310
- * 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__11, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
- __pyx_t_4 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_data_type_for_attribute, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 1310, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1309
- * 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":1311
- * 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_7 = ((__pyx_v_xtype == -99L) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":1312
- * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __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_ERR(0, 1312, __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_ERR(0, 1312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_22 = __Pyx_PyInt_As_nc_type(__pyx_t_4); if (unlikely((__pyx_t_22 == (nc_type)-1) && PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_xtype = __pyx_t_22;
-
- /* "netCDF4/_netCDF4.pyx":1311
- * 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_L45:;
-
- /* "netCDF4/_netCDF4.pyx":1313
- * 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":1314
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_ierr = nc_put_att(__pyx_t_14, __pyx_v_varid, __pyx_v_attname, __pyx_v_xtype, __pyx_v_lenarr, __pyx_v_value_arr->data);
-
- /* "netCDF4/_netCDF4.pyx":1315
- * lenarr = PyArray_SIZE(value_arr)
- * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":1316
- * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- *
- * cdef _get_types(group):
- */
- __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_ERR(0, 1316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __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_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __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_ERR(0, 1316, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1315
- * lenarr = PyArray_SIZE(value_arr)
- * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
- }
- __pyx_L9:;
-
- /* "netCDF4/_netCDF4.pyx":1242
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * cdef _set_att(grp, int varid, name, value,\ # <<<<<<<<<<<<<<
- * nc_type xtype=-99, force_ncstring=False):
- * # Private function to set an attribute name/value pair
- */
-
- /* 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_N);
- __Pyx_XDECREF(__pyx_v_strings);
- __Pyx_XDECREF(__pyx_v_j);
- __Pyx_XDECREF(__pyx_v_dats);
- __Pyx_XDECREF(__pyx_v_value_arr1);
- __Pyx_XDECREF(__pyx_v_dats_ascii);
- __Pyx_XDECREF(__pyx_v_s);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":1318
- * raise AttributeError((<char *>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;
- __Pyx_RefNannySetupContext("_get_types", 0);
-
- /* "netCDF4/_netCDF4.pyx":1326
- * 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_ERR(0, 1326, __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_ERR(0, 1326, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1328
- * _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":1329
- * # 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_typeids(__pyx_v__grpid, (&__pyx_v_ntypes), NULL);
- }
-
- /* "netCDF4/_netCDF4.pyx":1328
- * _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":1330
- * with nogil:
- * ierr = nc_inq_typeids(_grpid, &ntypes, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ntypes > 0:
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1331
- * ierr = nc_inq_typeids(_grpid, &ntypes, NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * if ntypes > 0:
- * typeids = <nc_type *>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_ERR(0, 1331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __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_ERR(0, 1331, __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_ERR(0, 1331, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1330
- * with nogil:
- * ierr = nc_inq_typeids(_grpid, &ntypes, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ntypes > 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1332
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ntypes > 0: # <<<<<<<<<<<<<<
- * typeids = <nc_type *>malloc(sizeof(nc_type) * ntypes)
- * with nogil:
- */
- __pyx_t_3 = ((__pyx_v_ntypes > 0) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1333
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ntypes > 0:
- * typeids = <nc_type *>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":1334
- * if ntypes > 0:
- * typeids = <nc_type *>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":1335
- * typeids = <nc_type *>malloc(sizeof(nc_type) * ntypes)
- * with nogil:
- * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_typeids(__pyx_v__grpid, (&__pyx_v_ntypes), __pyx_v_typeids);
- }
-
- /* "netCDF4/_netCDF4.pyx":1334
- * if ntypes > 0:
- * typeids = <nc_type *>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":1336
- * with nogil:
- * ierr = nc_inq_typeids(_grpid, &ntypes, typeids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1337
- * ierr = nc_inq_typeids(_grpid, &ntypes, typeids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __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_ERR(0, 1337, __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_ERR(0, 1337, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1336
- * with nogil:
- * ierr = nc_inq_typeids(_grpid, &ntypes, typeids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create empty dictionary for CompoundType instances.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1332
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ntypes > 0: # <<<<<<<<<<<<<<
- * typeids = <nc_type *>malloc(sizeof(nc_type) * ntypes)
- * with nogil:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1339
- * raise RuntimeError((<char *>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_ERR(0, 1339, __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_ERR(0, 1339, __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_ERR(0, 1339, __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":1340
- * # 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_ERR(0, 1340, __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_ERR(0, 1340, __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_ERR(0, 1340, __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":1341
- * 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_ERR(0, 1341, __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_ERR(0, 1341, __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_ERR(0, 1341, __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":1342
- * 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":1343
- * 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":1344
- * 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":1345
- * 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":1346
- * 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":1345
- * 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":1348
- * ierr = nc_inq_user_type(_grpid, xtype, namstring,
- * NULL,NULL,NULL,&classp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1349
- * NULL,NULL,NULL,&classp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1349, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __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_ERR(0, 1349, __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_ERR(0, 1349, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1348
- * ierr = nc_inq_user_type(_grpid, xtype, namstring,
- * NULL,NULL,NULL,&classp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if classp == NC_COMPOUND: # a compound
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1350
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1351
- * raise RuntimeError((<char *>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_ERR(0, 1351, __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_ERR(0, 1351, __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_ERR(0, 1351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1351, __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_ERR(0, 1351, __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_ERR(0, 1351, __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":1354
- * # read the compound type info from the file,
- * # create a CompoundType instance from it.
- * try: # <<<<<<<<<<<<<<
- * cmptype = _read_compound(group, xtype)
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1355
- * # 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_ERR(0, 1355, __pyx_L21_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_cmptype, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1354
- * # 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_PyThreadState_assign
- __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":1356
- * try:
- * cmptype = _read_compound(group, xtype)
- * except KeyError: # <<<<<<<<<<<<<<
- * msg='WARNING: unsupported Compound type, skipping...'
- * warnings.warn(msg)
- */
- __pyx_t_14 = __Pyx_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_ERR(0, 1356, __pyx_L23_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_10);
-
- /* "netCDF4/_netCDF4.pyx":1357
- * 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":1358
- * 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_ERR(0, 1358, __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_ERR(0, 1358, __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_ERR(0, 1358, __pyx_L23_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1358, __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_ERR(0, 1358, __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":1359
- * 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":1354
- * # read the compound type info from the file,
- * # create a CompoundType instance from it.
- * try: # <<<<<<<<<<<<<<
- * cmptype = _read_compound(group, xtype)
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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_PyThreadState_assign
- __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":1360
- * 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_ERR(0, 1360, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1350
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1361
- * 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":1362
- * 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_ERR(0, 1362, __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_ERR(0, 1362, __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_ERR(0, 1362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1362, __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_ERR(0, 1362, __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_ERR(0, 1362, __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":1365
- * # read the VLEN type info from the file,
- * # create a VLType instance from it.
- * try: # <<<<<<<<<<<<<<
- * vltype = _read_vlen(group, xtype)
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1366
- * # 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_ERR(0, 1366, __pyx_L31_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_XDECREF_SET(__pyx_v_vltype, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1365
- * # 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_PyThreadState_assign
- __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":1367
- * try:
- * vltype = _read_vlen(group, xtype)
- * except KeyError: # <<<<<<<<<<<<<<
- * msg='WARNING: unsupported VLEN type, skipping...'
- * warnings.warn(msg)
- */
- __pyx_t_14 = __Pyx_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_ERR(0, 1367, __pyx_L33_except_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_15);
-
- /* "netCDF4/_netCDF4.pyx":1368
- * 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":1369
- * 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_ERR(0, 1369, __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_ERR(0, 1369, __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_ERR(0, 1369, __pyx_L33_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __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_ERR(0, 1369, __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":1370
- * 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":1365
- * # read the VLEN type info from the file,
- * # create a VLType instance from it.
- * try: # <<<<<<<<<<<<<<
- * vltype = _read_vlen(group, xtype)
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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_PyThreadState_assign
- __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":1371
- * 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_ERR(0, 1371, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1361
- * 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":1372
- * 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":1373
- * 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_ERR(0, 1373, __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_ERR(0, 1373, __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_ERR(0, 1373, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __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_ERR(0, 1373, __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_ERR(0, 1373, __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":1376
- * # read the Enum type info from the file,
- * # create a EnumType instance from it.
- * try: # <<<<<<<<<<<<<<
- * enumtype = _read_enum(group, xtype)
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1377
- * # 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_ERR(0, 1377, __pyx_L41_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_XDECREF_SET(__pyx_v_enumtype, __pyx_t_15);
- __pyx_t_15 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1376
- * # 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_PyThreadState_assign
- __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":1378
- * try:
- * enumtype = _read_enum(group, xtype)
- * except KeyError: # <<<<<<<<<<<<<<
- * msg='WARNING: unsupported Enum type, skipping...'
- * warnings.warn(msg)
- */
- __pyx_t_14 = __Pyx_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_ERR(0, 1378, __pyx_L43_except_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netCDF4/_netCDF4.pyx":1379
- * 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":1380
- * 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_ERR(0, 1380, __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_ERR(0, 1380, __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_ERR(0, 1380, __pyx_L43_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __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_ERR(0, 1380, __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":1381
- * 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":1376
- * # read the Enum type info from the file,
- * # create a EnumType instance from it.
- * try: # <<<<<<<<<<<<<<
- * enumtype = _read_enum(group, xtype)
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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_PyThreadState_assign
- __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":1382
- * 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_ERR(0, 1382, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1372
- * 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":1383
- * continue
- * enumtypes[name] = enumtype
- * free(typeids) # <<<<<<<<<<<<<<
- * return cmptypes, vltypes, enumtypes
- *
- */
- free(__pyx_v_typeids);
-
- /* "netCDF4/_netCDF4.pyx":1342
- * vltypes = OrderedDict()
- * enumtypes = OrderedDict()
- * if ntypes > 0: # <<<<<<<<<<<<<<
- * for n from 0 <= n < ntypes:
- * xtype = typeids[n]
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1384
- * 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_ERR(0, 1384, __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":1318
- * raise AttributeError((<char *>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":1386
- * 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;
- __Pyx_RefNannySetupContext("_get_dims", 0);
-
- /* "netCDF4/_netCDF4.pyx":1393
- * 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_ERR(0, 1393, __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_ERR(0, 1393, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1394
- * # 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":1395
- * _grpid = group._grpid
- * with nogil:
- * ierr = nc_inq_ndims(_grpid, &numdims) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_ndims(__pyx_v__grpid, (&__pyx_v_numdims));
- }
-
- /* "netCDF4/_netCDF4.pyx":1394
- * # 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":1396
- * with nogil:
- * ierr = nc_inq_ndims(_grpid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1397
- * ierr = nc_inq_ndims(_grpid, &numdims)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __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_ERR(0, 1397, __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_ERR(0, 1397, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1396
- * with nogil:
- * ierr = nc_inq_ndims(_grpid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create empty dictionary for dimensions.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1399
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create empty dictionary for dimensions.
- * dimensions = OrderedDict() # <<<<<<<<<<<<<<
- * if numdims > 0:
- * dimids = <int *>malloc(sizeof(int) * numdims)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __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_ERR(0, 1399, __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_ERR(0, 1399, __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":1400
- * # create empty dictionary for dimensions.
- * dimensions = OrderedDict()
- * if numdims > 0: # <<<<<<<<<<<<<<
- * dimids = <int *>malloc(sizeof(int) * numdims)
- * if group.data_model == 'NETCDF4':
- */
- __pyx_t_3 = ((__pyx_v_numdims > 0) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1401
- * dimensions = OrderedDict()
- * if numdims > 0:
- * dimids = <int *>malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<<
- * if group.data_model == 'NETCDF4':
- * with nogil:
- */
- __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims)));
-
- /* "netCDF4/_netCDF4.pyx":1402
- * if numdims > 0:
- * dimids = <int *>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_ERR(0, 1402, __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_ERR(0, 1402, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1403
- * dimids = <int *>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":1404
- * if group.data_model == 'NETCDF4':
- * with nogil:
- * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_dimids(__pyx_v__grpid, (&__pyx_v_numdims), __pyx_v_dimids, 0);
- }
-
- /* "netCDF4/_netCDF4.pyx":1403
- * dimids = <int *>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":1405
- * with nogil:
- * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1406
- * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1406, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __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_ERR(0, 1406, __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_ERR(0, 1406, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1405
- * with nogil:
- * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1402
- * if numdims > 0:
- * dimids = <int *>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":1408
- * raise RuntimeError((<char *>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":1409
- * 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":1410
- * 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":1411
- * 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":1412
- * for n from 0 <= n < numdims:
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1411
- * 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":1413
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, dimids[n], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1414
- * ierr = nc_inq_dimname(_grpid, dimids[n], namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1414, __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_ERR(0, 1414, __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_ERR(0, 1414, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1413
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, dimids[n], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1415
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1415, __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_ERR(0, 1415, __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_ERR(0, 1415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1415, __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_ERR(0, 1415, __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_ERR(0, 1415, __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":1416
- * raise RuntimeError((<char *>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_ERR(0, 1416, __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_ERR(0, 1416, __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_ERR(0, 1416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_id, __pyx_t_10) < 0) __PYX_ERR(0, 1416, __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_ERR(0, 1416, __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_ERR(0, 1416, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":1417
- * 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":1400
- * # create empty dictionary for dimensions.
- * dimensions = OrderedDict()
- * if numdims > 0: # <<<<<<<<<<<<<<
- * dimids = <int *>malloc(sizeof(int) * numdims)
- * if group.data_model == 'NETCDF4':
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1418
- * 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":1386
- * 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":1420
- * 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;
- __Pyx_RefNannySetupContext("_get_grps", 0);
-
- /* "netCDF4/_netCDF4.pyx":1427
- * 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_ERR(0, 1427, __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_ERR(0, 1427, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1428
- * # 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":1429
- * _grpid = group._grpid
- * with nogil:
- * ierr = nc_inq_grps(_grpid, &numgrps, NULL) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_grps(__pyx_v__grpid, (&__pyx_v_numgrps), NULL);
- }
-
- /* "netCDF4/_netCDF4.pyx":1428
- * # 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":1430
- * with nogil:
- * ierr = nc_inq_grps(_grpid, &numgrps, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1431
- * ierr = nc_inq_grps(_grpid, &numgrps, NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1431, __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_ERR(0, 1431, __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_ERR(0, 1431, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1430
- * with nogil:
- * ierr = nc_inq_grps(_grpid, &numgrps, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create dictionary containing `netCDF4.Group` instances for groups in this group
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1433
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create dictionary containing `netCDF4.Group` instances for groups in this group
- * groups = OrderedDict() # <<<<<<<<<<<<<<
- * if numgrps > 0:
- * grpids = <int *>malloc(sizeof(int) * numgrps)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __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_ERR(0, 1433, __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_ERR(0, 1433, __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":1434
- * # create dictionary containing `netCDF4.Group` instances for groups in this group
- * groups = OrderedDict()
- * if numgrps > 0: # <<<<<<<<<<<<<<
- * grpids = <int *>malloc(sizeof(int) * numgrps)
- * with nogil:
- */
- __pyx_t_3 = ((__pyx_v_numgrps > 0) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1435
- * groups = OrderedDict()
- * if numgrps > 0:
- * grpids = <int *>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":1436
- * if numgrps > 0:
- * grpids = <int *>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":1437
- * grpids = <int *>malloc(sizeof(int) * numgrps)
- * with nogil:
- * ierr = nc_inq_grps(_grpid, NULL, grpids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_grps(__pyx_v__grpid, NULL, __pyx_v_grpids);
- }
-
- /* "netCDF4/_netCDF4.pyx":1436
- * if numgrps > 0:
- * grpids = <int *>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":1438
- * with nogil:
- * ierr = nc_inq_grps(_grpid, NULL, grpids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1439
- * ierr = nc_inq_grps(_grpid, NULL, grpids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1439, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1439, __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_ERR(0, 1439, __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_ERR(0, 1439, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1438
- * with nogil:
- * ierr = nc_inq_grps(_grpid, NULL, grpids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * for n from 0 <= n < numgrps:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1440
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1441
- * raise RuntimeError((<char *>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":1442
- * for n from 0 <= n < numgrps:
- * with nogil:
- * ierr = nc_inq_grpname(grpids[n], namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_grpname((__pyx_v_grpids[__pyx_v_n]), __pyx_v_namstring);
- }
-
- /* "netCDF4/_netCDF4.pyx":1441
- * raise RuntimeError((<char *>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":1443
- * with nogil:
- * ierr = nc_inq_grpname(grpids[n], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1444
- * ierr = nc_inq_grpname(grpids[n], namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __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_ERR(0, 1444, __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_ERR(0, 1444, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1443
- * with nogil:
- * ierr = nc_inq_grpname(grpids[n], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1445
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1445, __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_ERR(0, 1445, __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_ERR(0, 1445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1445, __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_ERR(0, 1445, __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_ERR(0, 1445, __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":1446
- * raise RuntimeError((<char *>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_ERR(0, 1446, __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_ERR(0, 1446, __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_ERR(0, 1446, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_id, __pyx_t_10) < 0) __PYX_ERR(0, 1446, __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_ERR(0, 1446, __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_ERR(0, 1446, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":1447
- * 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":1434
- * # create dictionary containing `netCDF4.Group` instances for groups in this group
- * groups = OrderedDict()
- * if numgrps > 0: # <<<<<<<<<<<<<<
- * grpids = <int *>malloc(sizeof(int) * numgrps)
- * with nogil:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1448
- * 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":1420
- * 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":1450
- * 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;
- __Pyx_RefNannySetupContext("_get_vars", 0);
-
- /* "netCDF4/_netCDF4.pyx":1460
- * 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_ERR(0, 1460, __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_ERR(0, 1460, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":1461
- * # 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":1462
- * _grpid = group._grpid
- * with nogil:
- * ierr = nc_inq_nvars(_grpid, &numvars) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_nvars(__pyx_v__grpid, (&__pyx_v_numvars));
- }
-
- /* "netCDF4/_netCDF4.pyx":1461
- * # 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":1463
- * with nogil:
- * ierr = nc_inq_nvars(_grpid, &numvars)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1464
- * ierr = nc_inq_nvars(_grpid, &numvars)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1464, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1464, __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_ERR(0, 1464, __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_ERR(0, 1464, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1463
- * with nogil:
- * ierr = nc_inq_nvars(_grpid, &numvars)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # create empty dictionary for variables.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1466
- * raise RuntimeError((<char *>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_ERR(0, 1466, __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_ERR(0, 1466, __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_ERR(0, 1466, __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":1467
- * # create empty dictionary for variables.
- * variables = OrderedDict()
- * if numvars > 0: # <<<<<<<<<<<<<<
- * # get variable ids.
- * varids = <int *>malloc(sizeof(int) * numvars)
- */
- __pyx_t_3 = ((__pyx_v_numvars > 0) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1469
- * if numvars > 0:
- * # get variable ids.
- * varids = <int *>malloc(sizeof(int) * numvars) # <<<<<<<<<<<<<<
- * if group.data_model == 'NETCDF4':
- * with nogil:
- */
- __pyx_v_varids = ((int *)malloc(((sizeof(int)) * __pyx_v_numvars)));
-
- /* "netCDF4/_netCDF4.pyx":1470
- * # get variable ids.
- * varids = <int *>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_ERR(0, 1470, __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_ERR(0, 1470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1471
- * varids = <int *>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":1472
- * if group.data_model == 'NETCDF4':
- * with nogil:
- * ierr = nc_inq_varids(_grpid, &numvars, varids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_varids(__pyx_v__grpid, (&__pyx_v_numvars), __pyx_v_varids);
- }
-
- /* "netCDF4/_netCDF4.pyx":1471
- * varids = <int *>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":1473
- * with nogil:
- * ierr = nc_inq_varids(_grpid, &numvars, varids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1474
- * ierr = nc_inq_varids(_grpid, &numvars, varids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1474, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1474, __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_ERR(0, 1474, __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_ERR(0, 1474, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1473
- * with nogil:
- * ierr = nc_inq_varids(_grpid, &numvars, varids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1470
- * # get variable ids.
- * varids = <int *>malloc(sizeof(int) * numvars)
- * if group.data_model == 'NETCDF4': # <<<<<<<<<<<<<<
- * with nogil:
- * ierr = nc_inq_varids(_grpid, &numvars, varids)
- */
- goto __pyx_L8;
- }
-
- /* "netCDF4/_netCDF4.pyx":1476
- * raise RuntimeError((<char *>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":1477
- * 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":1479
- * 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":1480
- * # 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":1482
- * 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":1483
- * # get variable name.
- * with nogil:
- * ierr = nc_inq_varname(_grpid, varid, namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_varname(__pyx_v__grpid, __pyx_v_varid, __pyx_v_namstring);
- }
-
- /* "netCDF4/_netCDF4.pyx":1482
- * 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":1484
- * with nogil:
- * ierr = nc_inq_varname(_grpid, varid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1485
- * ierr = nc_inq_varname(_grpid, varid, namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __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_ERR(0, 1485, __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_ERR(0, 1485, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1484
- * with nogil:
- * ierr = nc_inq_varname(_grpid, varid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1486
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1486, __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_ERR(0, 1486, __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_ERR(0, 1486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1486, __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_ERR(0, 1486, __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_ERR(0, 1486, __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":1487
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # get variable type.
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":1488
- * name = namstring.decode(default_encoding,unicode_error)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1488, __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_ERR(0, 1488, __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_ERR(0, 1488, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1487
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # get variable type.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1490
- * raise RuntimeError((<char *>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":1491
- * # get variable type.
- * with nogil:
- * ierr = nc_inq_vartype(_grpid, varid, &xtype) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_vartype(__pyx_v__grpid, __pyx_v_varid, (&__pyx_v_xtype));
- }
-
- /* "netCDF4/_netCDF4.pyx":1490
- * raise RuntimeError((<char *>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":1492
- * with nogil:
- * ierr = nc_inq_vartype(_grpid, varid, &xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1493
- * ierr = nc_inq_vartype(_grpid, varid, &xtype)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1493, __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_ERR(0, 1493, __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_ERR(0, 1493, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1492
- * with nogil:
- * ierr = nc_inq_vartype(_grpid, varid, &xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # get endian-ness of variable.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1495
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # get endian-ness of variable.
- * endianness = None # <<<<<<<<<<<<<<
- * with nogil:
- * ierr = nc_inq_var_endian(_grpid, varid, &iendian)
- */
- __Pyx_INCREF(Py_None);
- __Pyx_XDECREF_SET(__pyx_v_endianness, Py_None);
-
- /* "netCDF4/_netCDF4.pyx":1496
- * # get endian-ness of variable.
- * endianness = None
- * 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":1497
- * endianness = None
- * 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":1496
- * # get endian-ness of variable.
- * endianness = None
- * 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_L34;
- }
- __pyx_L34:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1498
- * 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":1499
- * 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":1500
- * if ierr == NC_NOERR:
- * if iendian == NC_ENDIAN_LITTLE:
- * endianness = '<' # <<<<<<<<<<<<<<
- * elif iendian == NC_ENDIAN_BIG:
- * endianness = '>'
- */
- __Pyx_INCREF(__pyx_kp_s__13);
- __Pyx_DECREF_SET(__pyx_v_endianness, __pyx_kp_s__13);
-
- /* "netCDF4/_netCDF4.pyx":1499
- * 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":1501
- * 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":1502
- * endianness = '<'
- * elif iendian == NC_ENDIAN_BIG:
- * endianness = '>' # <<<<<<<<<<<<<<
- * # check to see if it is a supported user-defined type.
- * try:
- */
- __Pyx_INCREF(__pyx_kp_s__14);
- __Pyx_DECREF_SET(__pyx_v_endianness, __pyx_kp_s__14);
-
- /* "netCDF4/_netCDF4.pyx":1501
- * 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":1498
- * with nogil:
- * ierr = nc_inq_var_endian(_grpid, varid, &iendian)
- * if ierr == NC_NOERR: # <<<<<<<<<<<<<<
- * if iendian == NC_ENDIAN_LITTLE:
- * endianness = '<'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1504
- * endianness = '>'
- * # check to see if it is a supported user-defined type.
- * try: # <<<<<<<<<<<<<<
- * datatype = _nctonptype[xtype]
- * if endianness is not None:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1505
- * # 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_ERR(0, 1505, __pyx_L36_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)) __PYX_ERR(0, 1505, __pyx_L36_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":1506
- * 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":1507
- * 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_ERR(0, 1507, __pyx_L36_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1506
- * try:
- * datatype = _nctonptype[xtype]
- * if endianness is not None: # <<<<<<<<<<<<<<
- * datatype = endianness + datatype
- * except KeyError:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1504
- * 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_L43_try_end;
- __pyx_L36_error:;
- __Pyx_PyThreadState_assign
- __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":1508
- * if endianness is not None:
- * datatype = endianness + datatype
- * except KeyError: # <<<<<<<<<<<<<<
- * if xtype == NC_STRING:
- * datatype = str
- */
- __pyx_t_15 = __Pyx_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_ERR(0, 1508, __pyx_L38_except_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_10);
-
- /* "netCDF4/_netCDF4.pyx":1509
- * 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":1510
- * 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":1509
- * datatype = endianness + datatype
- * except KeyError:
- * if xtype == NC_STRING: # <<<<<<<<<<<<<<
- * datatype = str
- * else:
- */
- goto __pyx_L47;
- }
-
- /* "netCDF4/_netCDF4.pyx":1512
- * 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":1513
- * 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":1512
- * 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_L52;
- }
- __pyx_L52:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1515
- * 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":1517
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1518
- * # 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_ERR(0, 1518, __pyx_L53_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1517
- * 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_L60_try_end;
- __pyx_L53_error:;
- __Pyx_PyThreadState_assign
- __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":1519
- * 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 = __Pyx_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_ERR(0, 1519, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netCDF4/_netCDF4.pyx":1520
- * 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_ERR(0, 1520, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20));
- __pyx_t_20 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1521
- * 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_ERR(0, 1521, __pyx_L55_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_ERR(0, 1521, __pyx_L55_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_ERR(0, 1521, __pyx_L55_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- } else {
- __pyx_t_23 = PyTuple_New(1+1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1521, __pyx_L55_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_ERR(0, 1521, __pyx_L55_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":1522
- * 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_L62_except_continue;
- __pyx_L62_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_L59_try_continue;
- }
- goto __pyx_L55_except_error;
- __pyx_L55_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1517
- * 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_PyThreadState_assign
- __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_L38_except_error;
- __pyx_L59_try_continue:;
- __Pyx_PyThreadState_assign
- __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_L46_except_continue;
- __pyx_L60_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1515
- * 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":1523
- * 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":1525
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1526
- * # 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_ERR(0, 1526, __pyx_L63_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_8);
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1525
- * 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_L70_try_end;
- __pyx_L63_error:;
- __Pyx_PyThreadState_assign
- __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":1527
- * 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 = __Pyx_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_ERR(0, 1527, __pyx_L65_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":1528
- * 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_ERR(0, 1528, __pyx_L65_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20));
- __pyx_t_20 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1529
- * 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_ERR(0, 1529, __pyx_L65_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_ERR(0, 1529, __pyx_L65_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_ERR(0, 1529, __pyx_L65_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- } else {
- __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1529, __pyx_L65_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_ERR(0, 1529, __pyx_L65_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":1530
- * 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_L72_except_continue;
- __pyx_L72_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_L69_try_continue;
- }
- goto __pyx_L65_except_error;
- __pyx_L65_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1525
- * 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_PyThreadState_assign
- __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_L38_except_error;
- __pyx_L69_try_continue:;
- __Pyx_PyThreadState_assign
- __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_L46_except_continue;
- __pyx_L70_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1523
- * warnings.warn(msg)
- * continue
- * elif classp == NC_VLEN: # a compound type # <<<<<<<<<<<<<<
- * # create VLType instance describing this compound type.
- * try:
- */
- break;
-
- /* "netCDF4/_netCDF4.pyx":1531
- * warnings.warn(msg)
- * continue
- * elif classp == NC_ENUM: # <<<<<<<<<<<<<<
- * # create EnumType instance describing this compound type.
- * try:
- */
- case NC_ENUM:
-
- /* "netCDF4/_netCDF4.pyx":1533
- * elif classp == NC_ENUM:
- * # create EnumType instance describing this compound type.
- * try: # <<<<<<<<<<<<<<
- * datatype = _read_enum(group, xtype, endian=endianness)
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":1534
- * # 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_ERR(0, 1534, __pyx_L73_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1533
- * 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_L80_try_end;
- __pyx_L73_error:;
- __Pyx_PyThreadState_assign
- __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":1535
- * 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 = __Pyx_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_ERR(0, 1535, __pyx_L75_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netCDF4/_netCDF4.pyx":1536
- * 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_ERR(0, 1536, __pyx_L75_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20));
- __pyx_t_20 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1537
- * 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_ERR(0, 1537, __pyx_L75_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_ERR(0, 1537, __pyx_L75_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_ERR(0, 1537, __pyx_L75_except_error)
- __Pyx_GOTREF(__pyx_t_20);
- } else {
- __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1537, __pyx_L75_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_ERR(0, 1537, __pyx_L75_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":1538
- * 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_L82_except_continue;
- __pyx_L82_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_L79_try_continue;
- }
- goto __pyx_L75_except_error;
- __pyx_L75_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1533
- * elif classp == NC_ENUM:
- * # create EnumType instance describing this compound type.
- * try: # <<<<<<<<<<<<<<
- * datatype = _read_enum(group, xtype, endian=endianness)
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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_L38_except_error;
- __pyx_L79_try_continue:;
- __Pyx_PyThreadState_assign
- __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_L46_except_continue;
- __pyx_L80_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1531
- * warnings.warn(msg)
- * continue
- * elif classp == NC_ENUM: # <<<<<<<<<<<<<<
- * # create EnumType instance describing this compound type.
- * try:
- */
- break;
- default:
-
- /* "netCDF4/_netCDF4.pyx":1540
- * 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_ERR(0, 1540, __pyx_L38_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_8));
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1541
- * 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_ERR(0, 1541, __pyx_L38_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_ERR(0, 1541, __pyx_L38_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_ERR(0, 1541, __pyx_L38_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1541, __pyx_L38_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_ERR(0, 1541, __pyx_L38_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":1542
- * msg="WARNING: variable '%s' has unsupported datatype, skipping .." % name
- * warnings.warn(msg)
- * continue # <<<<<<<<<<<<<<
- * # get number of dimensions.
- * with nogil:
- */
- goto __pyx_L46_except_continue;
- break;
- }
- }
- __pyx_L47:;
- __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_L37_exception_handled;
- __pyx_L46_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_L42_try_continue;
- }
- goto __pyx_L38_except_error;
- __pyx_L38_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":1504
- * endianness = '>'
- * # check to see if it is a supported user-defined type.
- * try: # <<<<<<<<<<<<<<
- * datatype = _nctonptype[xtype]
- * if endianness is not None:
- */
- __Pyx_PyThreadState_assign
- __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_L42_try_continue:;
- __Pyx_PyThreadState_assign
- __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_L37_exception_handled:;
- __Pyx_PyThreadState_assign
- __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_L43_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1544
- * 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":1545
- * # get number of dimensions.
- * with nogil:
- * ierr = nc_inq_varndims(_grpid, varid, &numdims) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_varndims(__pyx_v__grpid, __pyx_v_varid, (&__pyx_v_numdims));
- }
-
- /* "netCDF4/_netCDF4.pyx":1544
- * 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_L87;
- }
- __pyx_L87:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1546
- * with nogil:
- * ierr = nc_inq_varndims(_grpid, varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims)
- */
- __pyx_t_14 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":1547
- * ierr = nc_inq_varndims(_grpid, varid, &numdims)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * dimids = <int *>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_ERR(0, 1547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __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_ERR(0, 1547, __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_ERR(0, 1547, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1546
- * with nogil:
- * ierr = nc_inq_varndims(_grpid, varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1548
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<<
- * # get dimension ids.
- * with nogil:
- */
- __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims)));
-
- /* "netCDF4/_netCDF4.pyx":1550
- * dimids = <int *>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":1551
- * # get dimension ids.
- * with nogil:
- * ierr = nc_inq_vardimid(_grpid, varid, dimids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_vardimid(__pyx_v__grpid, __pyx_v_varid, __pyx_v_dimids);
- }
-
- /* "netCDF4/_netCDF4.pyx":1550
- * dimids = <int *>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_L93;
- }
- __pyx_L93:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1552
- * with nogil:
- * ierr = nc_inq_vardimid(_grpid, varid, dimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1553
- * ierr = nc_inq_vardimid(_grpid, varid, dimids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __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_ERR(0, 1553, __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_ERR(0, 1553, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1552
- * with nogil:
- * ierr = nc_inq_vardimid(_grpid, varid, dimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # loop over dimensions, retrieve names.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1559
- * # 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_ERR(0, 1559, __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":1560
- * # 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":1561
- * 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":1562
- * 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":1563
- * 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":1564
- * 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_ERR(0, 1564, __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_ERR(0, 1564, __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_ERR(0, 1564, __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_ERR(0, 1564, __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_ERR(0, 1564, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_26 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1564, __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_ERR(0, 1564, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1564, __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_ERR(0, 1564, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1564, __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_ERR(0, 1564, __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_ERR(0, 1564, __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_ERR(0, 1564, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1564, __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_ERR(0, 1564, __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_L101_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_L101_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_27(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
- __pyx_t_27 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L102_unpacking_done;
- __pyx_L101_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_27 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 1564, __pyx_L1_error)
- __pyx_L102_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":1565
- * 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_ERR(0, 1565, __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_ERR(0, 1565, __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_ERR(0, 1565, __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_ERR(0, 1565, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":1566
- * 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_ERR(0, 1566, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1567
- * if value._dimid == dimids[nn]:
- * dimensions.append(key)
- * found = True # <<<<<<<<<<<<<<
- * break
- * grp = grp.parent
- */
- __pyx_v_found = 1;
-
- /* "netCDF4/_netCDF4.pyx":1568
- * dimensions.append(key)
- * found = True
- * break # <<<<<<<<<<<<<<
- * grp = grp.parent
- * free(dimids)
- */
- goto __pyx_L100_break;
-
- /* "netCDF4/_netCDF4.pyx":1565
- * while not found:
- * for key, value in grp.dimensions.items():
- * if value._dimid == dimids[nn]: # <<<<<<<<<<<<<<
- * dimensions.append(key)
- * found = True
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1564
- * found = False
- * while not found:
- * for key, value in grp.dimensions.items(): # <<<<<<<<<<<<<<
- * if value._dimid == dimids[nn]:
- * dimensions.append(key)
- */
- }
- __pyx_L100_break:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1569
- * 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_ERR(0, 1569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_grp, __pyx_t_6);
- __pyx_t_6 = 0;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":1570
- * break
- * grp = grp.parent
- * free(dimids) # <<<<<<<<<<<<<<
- * # create new variable instance.
- * if endianness == '>':
- */
- free(__pyx_v_dimids);
-
- /* "netCDF4/_netCDF4.pyx":1572
- * 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__14, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1572, __pyx_L1_error)
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":1573
- * # 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_ERR(0, 1573, __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_ERR(0, 1573, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1573, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_8) < 0) __PYX_ERR(0, 1573, __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_ERR(0, 1573, __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_ERR(0, 1573, __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_ERR(0, 1573, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1572
- * free(dimids)
- * # create new variable instance.
- * if endianness == '>': # <<<<<<<<<<<<<<
- * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big')
- * elif endianness == '<':
- */
- goto __pyx_L104;
- }
-
- /* "netCDF4/_netCDF4.pyx":1574
- * 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__13, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1574, __pyx_L1_error)
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":1575
- * 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_ERR(0, 1575, __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_ERR(0, 1575, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1575, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_6) < 0) __PYX_ERR(0, 1575, __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_ERR(0, 1575, __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_ERR(0, 1575, __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_ERR(0, 1575, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1574
- * 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_L104;
- }
-
- /* "netCDF4/_netCDF4.pyx":1577
- * 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_ERR(0, 1577, __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_ERR(0, 1577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_8) < 0) __PYX_ERR(0, 1577, __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_ERR(0, 1577, __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_ERR(0, 1577, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __pyx_L104:;
- __pyx_L15_continue:;
- }
-
- /* "netCDF4/_netCDF4.pyx":1578
- * 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":1467
- * # create empty dictionary for variables.
- * variables = OrderedDict()
- * if numvars > 0: # <<<<<<<<<<<<<<
- * # get variable ids.
- * varids = <int *>malloc(sizeof(int) * numvars)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1579
- * 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":1450
- * 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":1714
- * 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, keepweakref=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 [...]
-#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_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":1715
- *
- * 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_ERR(0, 1714, __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_ERR(0, 1714, __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":1714
- * 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 *);
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":1784
- * 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":1785
- * # 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_ERR(0, 1785, __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_ERR(0, 1785, __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_ERR(0, 1785, __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_ERR(0, 1785, __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":1787
- * 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_ERR(0, 1787, __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_ERR(0, 1787, __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_ERR(0, 1787, __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_ERR(0, 1787, __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_ERR(0, 1787, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1785
- * # 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":1788
- * #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_ERR(0, 1788, __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_ERR(0, 1788, __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_ERR(0, 1788, __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":1789
- * 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_ERR(0, 1789, __pyx_L1_error)
- __pyx_v_path = __pyx_t_5;
-
- /* "netCDF4/_netCDF4.pyx":1790
- * 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_ERR(0, 1790, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1791
- * 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_ERR(0, 1791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_format, __pyx_v_format) < 0) __PYX_ERR(0, 1791, __pyx_L1_error)
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1791, __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":1792
- * 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_ERR(0, 1792, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1793
- * _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_ERR(0, 1793, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1794
- * 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_ERR(0, 1794, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1795
- * 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_ERR(0, 1795, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1795, __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_ERR(0, 1795, __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_ERR(0, 1795, __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":1794
- * if clobber:
- * if diskless:
- * if persist: # <<<<<<<<<<<<<<
- * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid)
- * else:
- */
- goto __pyx_L9;
- }
-
- /* "netCDF4/_netCDF4.pyx":1797
- * 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_ERR(0, 1797, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __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_ERR(0, 1797, __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_ERR(0, 1797, __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":1793
- * _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":1799
- * 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":1792
- * if mode == 'w':
- * _set_default_format(format=format)
- * if clobber: # <<<<<<<<<<<<<<
- * if diskless:
- * if persist:
- */
- goto __pyx_L7;
- }
-
- /* "netCDF4/_netCDF4.pyx":1801
- * 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_ERR(0, 1801, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1802
- * 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_ERR(0, 1802, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1803
- * 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_ERR(0, 1803, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1803, __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_ERR(0, 1803, __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_ERR(0, 1803, __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":1802
- * else:
- * if diskless:
- * if persist: # <<<<<<<<<<<<<<
- * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid)
- * else:
- */
- goto __pyx_L11;
- }
-
- /* "netCDF4/_netCDF4.pyx":1805
- * 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_ERR(0, 1805, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __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_ERR(0, 1805, __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_ERR(0, 1805, __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":1801
- * 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":1807
- * 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":1812
- * # 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_ERR(0, 1812, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __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_ERR(0, 1812, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1812, __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":1790
- * bytestr = _strencode(str(filename))
- * path = bytestr
- * if mode == 'w': # <<<<<<<<<<<<<<
- * _set_default_format(format=format)
- * if clobber:
- */
- goto __pyx_L6;
- }
-
- /* "netCDF4/_netCDF4.pyx":1813
- * # 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_ERR(0, 1813, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1814
- * _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_ERR(0, 1814, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1815
- * 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_ERR(0, 1815, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1815, __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_ERR(0, 1815, __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_ERR(0, 1815, __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":1814
- * _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":1817
- * 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":1813
- * # 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":1818
- * 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_ERR(0, 1818, __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_ERR(0, 1818, __pyx_L1_error)
- __pyx_t_1 = __pyx_t_2;
- __pyx_L13_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1819
- * 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_ERR(0, 1819, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1820
- * 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_ERR(0, 1820, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1820, __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_ERR(0, 1820, __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_ERR(0, 1820, __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":1819
- * 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":1822
- * 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":1818
- * 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":1823
- * 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_ERR(0, 1823, __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_ERR(0, 1823, __pyx_L1_error)
- __pyx_t_1 = __pyx_t_2;
- __pyx_L16_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1824
- * 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_ERR(0, 1824, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1825
- * 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_ERR(0, 1825, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1825, __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_ERR(0, 1825, __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_ERR(0, 1825, __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":1824
- * 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":1827
- * 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":1823
- * 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":1828
- * 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_ERR(0, 1828, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1829
- * 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_ERR(0, 1829, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1830
- * 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_ERR(0, 1830, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1831
- * 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_ERR(0, 1831, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1832
- * 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_ERR(0, 1832, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __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_ERR(0, 1832, __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_ERR(0, 1832, __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":1831
- * 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":1834
- * 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_ERR(0, 1834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __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_ERR(0, 1834, __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_ERR(0, 1834, __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":1830
- * 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":1836
- * 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":1829
- * ierr = nc_open(path, NC_SHARE, &grpid)
- * elif mode == 'ws':
- * if clobber: # <<<<<<<<<<<<<<
- * if diskless:
- * if persist:
- */
- goto __pyx_L19;
- }
-
- /* "netCDF4/_netCDF4.pyx":1838
- * 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_ERR(0, 1838, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1839
- * 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_ERR(0, 1839, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1840
- * 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_ERR(0, 1840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1840, __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_ERR(0, 1840, __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_ERR(0, 1840, __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":1839
- * 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":1842
- * 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_ERR(0, 1842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __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_ERR(0, 1842, __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_ERR(0, 1842, __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":1838
- * 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":1844
- * 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":1828
- * else:
- * ierr = nc_open(path, NC_SHARE, &grpid)
- * elif mode == 'ws': # <<<<<<<<<<<<<<
- * if clobber:
- * if diskless:
- */
- goto __pyx_L6;
- }
-
- /* "netCDF4/_netCDF4.pyx":1846
- * 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 IOError((<char *>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_ERR(0, 1846, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1846, __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_ERR(0, 1846, __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_ERR(0, 1846, __pyx_L1_error)
- }
- __pyx_L6:;
-
- /* "netCDF4/_netCDF4.pyx":1847
- * else:
- * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise IOError((<char *>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":1848
- * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode)
- * if ierr != NC_NOERR:
- * raise IOError((<char *>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_ERR(0, 1848, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1848, __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_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1848, __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_ERR(0, 1848, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1847
- * else:
- * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise IOError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # data model and file format attributes
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1850
- * raise IOError((<char *>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_ERR(0, 1850, __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":1853
- * # 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":1854
- * # 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_ERR(0, 1854, __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":1859
- * #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":1860
- * # 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":1861
- * self._grpid = grpid
- * self._isopen = 1
- * self.path = '/' # <<<<<<<<<<<<<<
- * self.parent = None
- * self.keepweakref = keepweakref
- */
- __Pyx_INCREF(__pyx_kp_s__15);
- __Pyx_GIVEREF(__pyx_kp_s__15);
- __Pyx_GOTREF(__pyx_v_self->path);
- __Pyx_DECREF(__pyx_v_self->path);
- __pyx_v_self->path = __pyx_kp_s__15;
-
- /* "netCDF4/_netCDF4.pyx":1862
- * 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":1863
- * 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":1865
- * 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_ERR(0, 1865, __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_ERR(0, 1865, __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_ERR(0, 1865, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1865, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1865, __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_ERR(0, 1865, __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_ERR(0, 1865, __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_ERR(0, 1865, __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":1867
- * 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_ERR(0, 1867, __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":1869
- * 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_ERR(0, 1869, __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":1871
- * 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_ERR(0, 1871, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":1872
- * # 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_ERR(0, 1872, __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":1871
- * 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":1874
- * 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_ERR(0, 1874, __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_ERR(0, 1874, __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_ERR(0, 1874, __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":1714
- * 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":1877
- *
- * # 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":1878
- * # 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":1877
- *
- * # 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":1879
- * 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;
- 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_ERR(0, 1879, __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_ERR(0, 1879, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 1879, __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_ERR(0, 1879, __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;
- __Pyx_RefNannySetupContext("__exit__", 0);
-
- /* "netCDF4/_netCDF4.pyx":1880
- * 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_ERR(0, 1880, __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_ERR(0, 1880, __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_ERR(0, 1880, __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":1879
- * 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":1882
- * 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;
- __Pyx_RefNannySetupContext("__getitem__", 0);
- __Pyx_INCREF(__pyx_v_elem);
-
- /* "netCDF4/_netCDF4.pyx":1885
- * # 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_ERR(0, 1885, __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_ERR(0, 1885, __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_ERR(0, 1885, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __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_ERR(0, 1885, __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":1887
- * 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_ERR(0, 1887, __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_ERR(0, 1887, __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_ERR(0, 1887, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __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_ERR(0, 1887, __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_ERR(0, 1887, __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_ERR(0, 1887, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __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_ERR(0, 1887, __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_ERR(0, 1887, __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_ERR(0, 1887, __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":1888
- * # 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_ERR(0, 1888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1888, __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":1889
- * 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":1891
- * 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_ERR(0, 1891, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1891, __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_ERR(0, 1891, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __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_ERR(0, 1891, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __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_ERR(0, 1891, __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":1892
- * # 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_ERR(0, 1892, __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_ERR(0, 1892, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __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":1891
- * 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":1894
- * 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_ERR(0, 1894, __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_ERR(0, 1894, __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":1895
- * # 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_ERR(0, 1895, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_v_lastname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __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":1894
- * 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":1896
- * 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_ERR(0, 1896, __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_ERR(0, 1896, __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":1897
- * 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_ERR(0, 1897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_v_lastname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1897, __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":1896
- * if lastname in group.groups:
- * return group.groups[lastname]
- * elif lastname in group.variables: # <<<<<<<<<<<<<<
- * return group.variables[lastname]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1899
- * 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_ERR(0, 1899, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1899, __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_ERR(0, 1899, __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_ERR(0, 1899, __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_ERR(0, 1899, __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_ERR(0, 1899, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":1882
- * 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":1901
- * 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;
- __Pyx_RefNannySetupContext("filepath", 0);
-
- /* "netCDF4/_netCDF4.pyx":1928
- * return py_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":1931
- * 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_ERR(0, 1931, __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_ERR(0, 1931, __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_ERR(0, 1931, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1901
- * 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":1933
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":1934
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1934, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":1935
- * 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_ERR(0, 1935, __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_ERR(0, 1935, __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_ERR(0, 1935, __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":1934
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1937
- * 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_ERR(0, 1937, __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_ERR(0, 1937, __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_ERR(0, 1937, __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_ERR(0, 1937, __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_ERR(0, 1937, __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_ERR(0, 1937, __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_ERR(0, 1937, __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":1933
- * 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":1939
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":1940
- *
- * 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_ERR(0, 1940, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1940, __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":1941
- * 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_ERR(0, 1941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netCDF4/_netCDF4.pyx":1942
- * 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_ERR(0, 1942, __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_ERR(0, 1942, __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_ERR(0, 1942, __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_ERR(0, 1942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __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_ERR(0, 1942, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1942, __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_ERR(0, 1942, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1942, __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_ERR(0, 1942, __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":1941
- * 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_ERR(0, 1941, __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_ERR(0, 1941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1941, __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_ERR(0, 1941, __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)) __PYX_ERR(0, 1941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1941, __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_ERR(0, 1941, __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_ERR(0, 1941, __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_ERR(0, 1941, __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_ERR(0, 1941, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1942
- * 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":1941
- * 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_ERR(0, 1941, __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":1944
- * 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_ERR(0, 1944, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netCDF4/_netCDF4.pyx":1949
- * .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_ERR(0, 1949, __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_ERR(0, 1949, __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_ERR(0, 1949, __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_ERR(0, 1949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1949, __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_ERR(0, 1949, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __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_ERR(0, 1949, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __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_ERR(0, 1949, __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":1944
- * 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_ERR(0, 1944, __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)) __PYX_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __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_ERR(0, 1944, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1945
- * 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_ERR(0, 1945, __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)) __PYX_ERR(0, 1945, __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_ERR(0, 1945, __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_ERR(0, 1945, __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_ERR(0, 1945, __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_ERR(0, 1945, __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":1946
- * [_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_ERR(0, 1946, __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__17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1947
- * (((_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_ERR(0, 1947, __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__19, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1947, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1948
- * .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_ERR(0, 1948, __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__22, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1949
- * .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_ERR(0, 1949, __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__25, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1944
- * 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_ERR(0, 1944, __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_ERR(0, 1944, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1949
- * .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":1943
- * 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_ERR(0, 1943, __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":1950
- * .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_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __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_ERR(0, 1950, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __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_ERR(0, 1950, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __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_ERR(0, 1950, __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":1951
- * .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__15, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1951, __pyx_L1_error)
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":1953
- * 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_ERR(0, 1953, __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":1952
- * 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_ERR(0, 1952, __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_ERR(0, 1952, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1951
- * .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":1955
- * (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_ERR(0, 1955, __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_ERR(0, 1955, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_L9:;
-
- /* "netCDF4/_netCDF4.pyx":1956
- * 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_ERR(0, 1956, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "netCDF4/_netCDF4.pyx":1957
- * 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_ERR(0, 1957, __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_ERR(0, 1957, __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_ERR(0, 1957, __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_ERR(0, 1957, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1957, __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_ERR(0, 1957, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1957, __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_ERR(0, 1957, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1957, __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_ERR(0, 1957, __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":1956
- * 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_ERR(0, 1956, __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_ERR(0, 1956, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __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_ERR(0, 1956, __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_ERR(0, 1956, __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_ERR(0, 1956, __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_ERR(0, 1956, __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":1958
- * 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_ERR(0, 1958, __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":1959
- * 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__20, __pyx_v_dimnames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1959, __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_ERR(0, 1959, __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_ERR(0, 1959, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1960
- * 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__20, __pyx_v_varnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1960, __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_ERR(0, 1960, __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_ERR(0, 1960, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1961
- * 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__20, __pyx_v_grpnames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1961, __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_ERR(0, 1961, __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_ERR(0, 1961, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1962
- * 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_ERR(0, 1962, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1939
- * 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":1964
- * 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;
- __Pyx_RefNannySetupContext("close", 0);
-
- /* "netCDF4/_netCDF4.pyx":1971
- * """
- * cdef int ierr
- * ierr = nc_close(self._grpid) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_close(__pyx_v_self->_grpid);
-
- /* "netCDF4/_netCDF4.pyx":1972
- * cdef int ierr
- * ierr = nc_close(self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":1973
- * ierr = nc_close(self._grpid)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 1973, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1973, __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_ERR(0, 1973, __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_ERR(0, 1973, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1972
- * cdef int ierr
- * ierr = nc_close(self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * self._isopen = 0 # indicates file already closed, checked by __dealloc__
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1974
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":1964
- * 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":1976
- * 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;
- __Pyx_RefNannySetupContext("isopen", 0);
-
- /* "netCDF4/_netCDF4.pyx":1982
- * 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_ERR(0, 1982, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1982, __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_ERR(0, 1982, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":1976
- * 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":1984
- * 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":1987
- * # 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":1988
- * cdef int ierr
- * if self._isopen:
- * ierr = nc_close(self._grpid) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_v_ierr = nc_close(__pyx_v_self->_grpid);
-
- /* "netCDF4/_netCDF4.pyx":1987
- * # close file when there are no references to object left
- * cdef int ierr
- * if self._isopen: # <<<<<<<<<<<<<<
- * ierr = nc_close(self._grpid)
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1984
- * 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":1990
- * ierr = nc_close(self._grpid)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a Dataset object.
- * raise NotImplementedError('Dataset is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_20__reduce__(((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_20__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":1992
- * def __reduce__(self):
- * # raise error is user tries to pickle a Dataset object.
- * raise NotImplementedError('Dataset is not picklable') # <<<<<<<<<<<<<<
- *
- * def sync(self):
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __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_ERR(0, 1992, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1990
- * ierr = nc_close(self._grpid)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a Dataset object.
- * raise NotImplementedError('Dataset is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":1994
- * raise NotImplementedError('Dataset is not picklable')
- *
- * def sync(self): # <<<<<<<<<<<<<<
- * """
- * **`sync(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_22sync[] = "\n**`sync(self)`**\n\nWrites all buffered data in the `netCDF4.Dataset` to the disk file.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23sync(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_22sync(((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_22sync(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;
- __Pyx_RefNannySetupContext("sync", 0);
-
- /* "netCDF4/_netCDF4.pyx":2000
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_sync(__pyx_v_self->_grpid);
-
- /* "netCDF4/_netCDF4.pyx":2001
- * cdef int ierr
- * ierr = nc_sync(self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2002
- * ierr = nc_sync(self._grpid)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2002, __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_ERR(0, 2002, __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_ERR(0, 2002, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2001
- * cdef int ierr
- * ierr = nc_sync(self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1994
- * raise NotImplementedError('Dataset is not picklable')
- *
- * 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":2004
- * raise RuntimeError((<char *>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_25_redef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_25_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_24_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_24_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":2006
- * 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":2004
- * raise RuntimeError((<char *>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":2008
- * 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_27_enddef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_27_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_26_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_26_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":2010
- * 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":2008
- * 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":2012
- * ierr = nc_enddef(self._grpid)
- *
- * def set_fill_on(self): # <<<<<<<<<<<<<<
- * """
- * **`set_fill_on(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_29set_fill_on(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_28set_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 corresponds to `set_fill_on`. [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_29set_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_28set_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_28set_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;
- __Pyx_RefNannySetupContext("set_fill_on", 0);
-
- /* "netCDF4/_netCDF4.pyx":2026
- * to."""
- * cdef int ierr, oldmode
- * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_set_fill(__pyx_v_self->_grpid, NC_FILL, (&__pyx_v_oldmode));
-
- /* "netCDF4/_netCDF4.pyx":2027
- * cdef int ierr, oldmode
- * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2028
- * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2028, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2028, __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_ERR(0, 2028, __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_ERR(0, 2028, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2027
- * cdef int ierr, oldmode
- * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2012
- * 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":2030
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * def set_fill_off(self): # <<<<<<<<<<<<<<
- * """
- * **`set_fill_off(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_31set_fill_off(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_30set_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_31set_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_30set_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_30set_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;
- __Pyx_RefNannySetupContext("set_fill_off", 0);
-
- /* "netCDF4/_netCDF4.pyx":2040
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_set_fill(__pyx_v_self->_grpid, NC_NOFILL, (&__pyx_v_oldmode));
-
- /* "netCDF4/_netCDF4.pyx":2041
- * cdef int ierr, oldmode
- * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2042
- * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2042, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2042, __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_ERR(0, 2042, __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_ERR(0, 2042, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2041
- * cdef int ierr, oldmode
- * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2030
- * raise RuntimeError((<char *>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":2044
- * raise RuntimeError((<char *>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_33createDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_32createDimension[] = "\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 dim [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_33createDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dimname = 0;
- PyObject *__pyx_v_size = 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_ERR(0, 2044, __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_ERR(0, 2044, __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_32createDimension(((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_32createDimension(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;
- __Pyx_RefNannySetupContext("createDimension", 0);
-
- /* "netCDF4/_netCDF4.pyx":2057
- * 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_ERR(0, 2057, __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_ERR(0, 2057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 2057, __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_ERR(0, 2057, __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_ERR(0, 2057, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2058
- * `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)) __PYX_ERR(0, 2058, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2044
- * raise RuntimeError((<char *>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":2060
- * return self.dimensions[dimname]
- *
- * def renameDimension(self, oldname, newname): # <<<<<<<<<<<<<<
- * """
- * **`renameDimension(self, oldname, newname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_35renameDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_34renameDimension[] = "\n**`renameDimension(self, oldname, newname)`**\n\nrename a `netCDF4.Dimension` named `oldname` to `newname`.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_35renameDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_oldname = 0;
- PyObject *__pyx_v_newname = 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_ERR(0, 2060, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameDimension") < 0)) __PYX_ERR(0, 2060, __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_ERR(0, 2060, __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_34renameDimension(((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_34renameDimension(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;
- __Pyx_RefNannySetupContext("renameDimension", 0);
-
- /* "netCDF4/_netCDF4.pyx":2066
- * 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_ERR(0, 2066, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2067
- * 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_ERR(0, 2067, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2068
- * 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_ERR(0, 2068, __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_ERR(0, 2068, __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_ERR(0, 2068, __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_ERR(0, 2068, __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":2069
- * namstring = bytestr
- * if self.data_model != 'NETCDF4': self._redef()
- * try: # <<<<<<<<<<<<<<
- * dim = self.dimensions[oldname]
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":2070
- * 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)) __PYX_ERR(0, 2070, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_dim = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2069
- * 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_PyThreadState_assign
- __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":2071
- * 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 = __Pyx_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_ERR(0, 2071, __pyx_L6_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netCDF4/_netCDF4.pyx":2072
- * 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_ERR(0, 2072, __pyx_L6_except_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2072, __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_ERR(0, 2072, __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_ERR(0, 2072, __pyx_L6_except_error)
- }
- goto __pyx_L6_except_error;
- __pyx_L6_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":2069
- * namstring = bytestr
- * if self.data_model != 'NETCDF4': self._redef()
- * try: # <<<<<<<<<<<<<<
- * dim = self.dimensions[oldname]
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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":2073
- * 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_ERR(0, 2073, __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_ERR(0, 2073, __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":2074
- * 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((<char *>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_ERR(0, 2074, __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_ERR(0, 2074, __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_ERR(0, 2074, __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_ERR(0, 2074, __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":2075
- * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":2076
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2076, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2076, __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_ERR(0, 2076, __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_ERR(0, 2076, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2075
- * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # remove old key from dimensions dict.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2078
- * raise RuntimeError((<char *>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_ERR(0, 2078, __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_ERR(0, 2078, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2078, __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_ERR(0, 2078, __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":2080
- * 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_ERR(0, 2080, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2060
- * 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":2084
- * # 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_37createCompoundType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_36createCompoundType[] = "\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 retur [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_37createCompoundType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_datatype = 0;
- PyObject *__pyx_v_datatype_name = 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_ERR(0, 2084, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCompoundType") < 0)) __PYX_ERR(0, 2084, __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_ERR(0, 2084, __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_36createCompoundType(((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_36createCompoundType(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;
- __Pyx_RefNannySetupContext("createCompoundType", 0);
-
- /* "netCDF4/_netCDF4.pyx":2098
- * 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_ERR(0, 2098, __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_ERR(0, 2098, __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_ERR(0, 2098, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2100
- * 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)) __PYX_ERR(0, 2100, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2084
- * # 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":2102
- * 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_39createVLType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_38createVLType[] = "\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_39createVLType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_datatype = 0;
- PyObject *__pyx_v_datatype_name = 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_ERR(0, 2102, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVLType") < 0)) __PYX_ERR(0, 2102, __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_ERR(0, 2102, __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_38createVLType(((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_38createVLType(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;
- __Pyx_RefNannySetupContext("createVLType", 0);
-
- /* "netCDF4/_netCDF4.pyx":2111
- * 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_ERR(0, 2111, __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_ERR(0, 2111, __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_ERR(0, 2111, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2112
- * 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)) __PYX_ERR(0, 2112, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2102
- * 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":2114
- * 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_41createEnumType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_40createEnumType[] = "\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_41createEnumType(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;
- 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_ERR(0, 2114, __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_ERR(0, 2114, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEnumType") < 0)) __PYX_ERR(0, 2114, __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_ERR(0, 2114, __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_40createEnumType(((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_40createEnumType(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;
- __Pyx_RefNannySetupContext("createEnumType", 0);
-
- /* "netCDF4/_netCDF4.pyx":2124
- * 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_ERR(0, 2124, __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_ERR(0, 2124, __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_ERR(0, 2124, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2126
- * 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)) __PYX_ERR(0, 2126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2114
- * 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":2128
- * 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_43createVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_42createVariable[] = "\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 [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_43createVariable(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;
- 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":2129
- *
- * 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":2130
- * 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":2131
- * 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_ERR(0, 2128, __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_ERR(0, 2128, __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_ERR(0, 2128, __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_42createVariable(((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":2128
- * 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_42createVariable(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 [...]
- 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;
- __Pyx_RefNannySetupContext("createVariable", 0);
- __Pyx_INCREF(__pyx_v_varname);
-
- /* "netCDF4/_netCDF4.pyx":2255
- * 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_ERR(0, 2255, __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_ERR(0, 2255, __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_ERR(0, 2255, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2255, __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_ERR(0, 2255, __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":2256
- * # 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_ERR(0, 2256, __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_ERR(0, 2256, __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_ERR(0, 2256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2256, __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_ERR(0, 2256, __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_ERR(0, 2256, __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_ERR(0, 2256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2256, __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_ERR(0, 2256, __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_ERR(0, 2256, __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_ERR(0, 2256, __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":2258
- * 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_ERR(0, 2258, __pyx_L1_error)
- __pyx_t_7 = ((!__pyx_t_6) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":2259
- * # 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":2258
- * 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":2261
- * 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_ERR(0, 2261, __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_ERR(0, 2261, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2261, __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_ERR(0, 2261, __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":2263
- * 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_ERR(0, 2263, __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":2264
- * # 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_ERR(0, 2264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimensions, __pyx_v_dimensions) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_zlib, __pyx_v_zlib) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_complevel, __pyx_v_complevel) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2265
- * 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_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_contiguous, __pyx_v_contiguous) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunksizes, __pyx_v_chunksizes) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2266
- * 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_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2267
- * 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_ERR(0, 2264, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_cache, __pyx_v_chunk_cache) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2263
- * 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_ERR(0, 2263, __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_ERR(0, 2263, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_varname, __pyx_t_3) < 0)) __PYX_ERR(0, 2263, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2268
- * 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_ERR(0, 2268, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_v_varname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __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":2128
- * 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":2270
- * return group.variables[varname]
- *
- * def renameVariable(self, oldname, newname): # <<<<<<<<<<<<<<
- * """
- * **`renameVariable(self, oldname, newname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_45renameVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_44renameVariable[] = "\n**`renameVariable(self, oldname, newname)`**\n\nrename a `netCDF4.Variable` named `oldname` to `newname`";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_45renameVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_oldname = 0;
- PyObject *__pyx_v_newname = 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_ERR(0, 2270, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameVariable") < 0)) __PYX_ERR(0, 2270, __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_ERR(0, 2270, __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_44renameVariable(((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_44renameVariable(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;
- __Pyx_RefNannySetupContext("renameVariable", 0);
-
- /* "netCDF4/_netCDF4.pyx":2276
- * rename a `netCDF4.Variable` named `oldname` to `newname`"""
- * cdef char *namstring
- * try: # <<<<<<<<<<<<<<
- * var = self.variables[oldname]
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":2277
- * 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)) __PYX_ERR(0, 2277, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_var = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2276
- * 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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2278
- * try:
- * var = self.variables[oldname]
- * except KeyError: # <<<<<<<<<<<<<<
- * raise KeyError('%s not a valid variable name' % oldname)
- * bytestr = _strencode(newname)
- */
- __pyx_t_5 = __Pyx_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_ERR(0, 2278, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":2279
- * 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_ERR(0, 2279, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2279, __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_ERR(0, 2279, __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_ERR(0, 2279, __pyx_L5_except_error)
- }
- goto __pyx_L5_except_error;
- __pyx_L5_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":2276
- * rename a `netCDF4.Variable` named `oldname` to `newname`"""
- * cdef char *namstring
- * try: # <<<<<<<<<<<<<<
- * var = self.variables[oldname]
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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":2280
- * 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_ERR(0, 2280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_bytestr = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2281
- * 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_ERR(0, 2281, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_10;
-
- /* "netCDF4/_netCDF4.pyx":2282
- * 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_ERR(0, 2282, __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_ERR(0, 2282, __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_ERR(0, 2282, __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_ERR(0, 2282, __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":2283
- * 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_ERR(0, 2283, __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_ERR(0, 2283, __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":2284
- * 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((<char *>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_ERR(0, 2284, __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_ERR(0, 2284, __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_ERR(0, 2284, __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_ERR(0, 2284, __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":2285
- * ierr = nc_rename_var(self._grpid, var._varid, namstring)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":2286
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2286, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2286, __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_ERR(0, 2286, __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_ERR(0, 2286, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2285
- * ierr = nc_rename_var(self._grpid, var._varid, namstring)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # remove old key from dimensions dict.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2288
- * raise RuntimeError((<char *>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_ERR(0, 2288, __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_ERR(0, 2288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2288, __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_ERR(0, 2288, __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":2290
- * 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_ERR(0, 2290, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2270
- * 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":2292
- * self.variables[newname] = var
- *
- * def createGroup(self, groupname): # <<<<<<<<<<<<<<
- * """
- * **`createGroup(self, groupname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_47createGroup(PyObject *__pyx_v_self, PyObject *__pyx_v_groupname); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_46createGroup[] = "\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(analogous 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' [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_47createGroup(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_46createGroup(((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_46createGroup(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;
- __Pyx_RefNannySetupContext("createGroup", 0);
- __Pyx_INCREF(__pyx_v_groupname);
-
- /* "netCDF4/_netCDF4.pyx":2308
- * 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_ERR(0, 2308, __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_ERR(0, 2308, __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_ERR(0, 2308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2308, __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_ERR(0, 2308, __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":2309
- * # 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_ERR(0, 2309, __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_ERR(0, 2309, __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":2310
- * 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":2313
- * # 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_ERR(0, 2313, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2313, __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_ERR(0, 2313, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2313, __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_ERR(0, 2313, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2313, __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_ERR(0, 2313, __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":2314
- * # 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_ERR(0, 2314, __pyx_L1_error)
- __pyx_t_8 = ((!__pyx_t_7) != 0);
- if (__pyx_t_8) {
- goto __pyx_L3_continue;
- }
-
- /* "netCDF4/_netCDF4.pyx":2315
- * 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_ERR(0, 2315, __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_ERR(0, 2315, __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":2316
- * 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_ERR(0, 2316, __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_ERR(0, 2316, __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_ERR(0, 2316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_g, __pyx_t_4) < 0)) __PYX_ERR(0, 2316, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2315
- * 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":2317
- * 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_ERR(0, 2317, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2317, __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":2313
- * # 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":2320
- * # 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":2292
- * 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":2322
- * return group
- *
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * """
- * **`ncattrs(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_49ncattrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_48ncattrs[] = "\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_49ncattrs(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_48ncattrs(((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_48ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("ncattrs", 0);
-
- /* "netCDF4/_netCDF4.pyx":2327
- *
- * 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_ERR(0, 2327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2322
- * 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":2329
- * 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_51setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_50setncattr[] = "\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_51setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_v_value = 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_ERR(0, 2329, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) __PYX_ERR(0, 2329, __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_ERR(0, 2329, __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_50setncattr(((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_50setncattr(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;
- __Pyx_RefNannySetupContext("setncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":2336
- * 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_ERR(0, 2336, __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_ERR(0, 2336, __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_ERR(0, 2336, __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_ERR(0, 2336, __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":2337
- * 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_ERR(0, 2337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2338
- * if self.data_model != 'NETCDF4': self._redef()
- * _set_att(self, NC_GLOBAL, name, value)
- * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<<
- *
- * def setncattr_string(self,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_ERR(0, 2338, __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_ERR(0, 2338, __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_ERR(0, 2338, __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_ERR(0, 2338, __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":2329
- * 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":2340
- * if self.data_model != 'NETCDF4': self._enddef()
- *
- * def setncattr_string(self,name,value): # <<<<<<<<<<<<<<
- * """
- * **`setncattr_string(self,name,value)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_53setncattr_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_52setncattr_string[] = "\n**`setncattr_string(self,name,value)`**\n\nset a netCDF dataset or group string attribute using name,value pair.\nUse if you need to ensure that a netCDF attribute is created with type\n`NC_STRING` if the file format is `NETCDF4`.\nUse if you need to set an attribute to an array of variable-length strings.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_53setncattr_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_v_value = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("setncattr_string (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_string", 1, 2, 2, 1); __PYX_ERR(0, 2340, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr_string") < 0)) __PYX_ERR(0, 2340, __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_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2340, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_52setncattr_string(((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_52setncattr_string(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
- nc_type __pyx_v_xtype;
- PyObject *__pyx_v_msg = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att __pyx_t_4;
- __Pyx_RefNannySetupContext("setncattr_string", 0);
-
- /* "netCDF4/_netCDF4.pyx":2349
- * Use if you need to set an attribute to an array of variable-length strings."""
- * cdef nc_type xtype
- * xtype=-99 # <<<<<<<<<<<<<<
- * if self.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes'
- */
- __pyx_v_xtype = -99;
-
- /* "netCDF4/_netCDF4.pyx":2350
- * cdef nc_type xtype
- * xtype=-99
- * if self.data_model != 'NETCDF4': # <<<<<<<<<<<<<<
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- */
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2350, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2351
- * xtype=-99
- * if self.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes' # <<<<<<<<<<<<<<
- * raise IOError(msg)
- * _set_att(self, NC_GLOBAL, name, value, xtype=xtype, force_ncstring=True)
- */
- __Pyx_INCREF(__pyx_kp_s_file_format_does_not_support_NC);
- __pyx_v_msg = __pyx_kp_s_file_format_does_not_support_NC;
-
- /* "netCDF4/_netCDF4.pyx":2352
- * if self.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg) # <<<<<<<<<<<<<<
- * _set_att(self, NC_GLOBAL, name, value, xtype=xtype, force_ncstring=True)
- *
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2352, __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_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 2352, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2350
- * cdef nc_type xtype
- * xtype=-99
- * if self.data_model != 'NETCDF4': # <<<<<<<<<<<<<<
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2353
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- * _set_att(self, NC_GLOBAL, name, value, xtype=xtype, force_ncstring=True) # <<<<<<<<<<<<<<
- *
- * def setncatts(self,attdict):
- */
- __pyx_t_4.__pyx_n = 2;
- __pyx_t_4.xtype = __pyx_v_xtype;
- __pyx_t_4.force_ncstring = Py_True;
- __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__set_att(((PyObject *)__pyx_v_self), NC_GLOBAL, __pyx_v_name, __pyx_v_value, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2353, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2340
- * if self.data_model != 'NETCDF4': self._enddef()
- *
- * def setncattr_string(self,name,value): # <<<<<<<<<<<<<<
- * """
- * **`setncattr_string(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_AddTraceback("netCDF4._netCDF4.Dataset.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":2355
- * _set_att(self, NC_GLOBAL, name, value, xtype=xtype, force_ncstring=True)
- *
- * def setncatts(self,attdict): # <<<<<<<<<<<<<<
- * """
- * **`setncatts(self,attdict)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_55setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_54setncatts[] = "\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_55setncatts(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_54setncatts(((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_54setncatts(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 *);
- __Pyx_RefNannySetupContext("setncatts", 0);
-
- /* "netCDF4/_netCDF4.pyx":2363
- * 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_ERR(0, 2363, __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_ERR(0, 2363, __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_ERR(0, 2363, __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_ERR(0, 2363, __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":2364
- * 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_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2364, __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_ERR(0, 2364, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __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_ERR(0, 2364, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __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_ERR(0, 2364, __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":2365
- * 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_ERR(0, 2365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2364
- * 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":2366
- * 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_ERR(0, 2366, __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_ERR(0, 2366, __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_ERR(0, 2366, __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_ERR(0, 2366, __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":2355
- * _set_att(self, NC_GLOBAL, name, value, xtype=xtype, force_ncstring=True)
- *
- * 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":2368
- * if self.data_model != 'NETCDF4': self._enddef()
- *
- * def getncattr(self,name): # <<<<<<<<<<<<<<
- * """
- * **`getncattr(self,name)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_57getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_56getncattr[] = "\n**`getncattr(self,name)`**\n\nretrieve 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_57getncattr(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_56getncattr(((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_56getncattr(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;
- __Pyx_RefNannySetupContext("getncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":2375
- * 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_ERR(0, 2375, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2368
- * 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":2377
- * 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_59__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_59__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_58__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_58__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;
- __Pyx_RefNannySetupContext("__delattr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2379
- * 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_ERR(0, 2379, __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_ERR(0, 2379, __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":2380
- * # 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_ERR(0, 2380, __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_ERR(0, 2380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __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_ERR(0, 2380, __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":2379
- * 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":2382
- * 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":2383
- * 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_ERR(0, 2383, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2383, __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_ERR(0, 2383, __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_ERR(0, 2383, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2382
- * 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_ERR(0, 2382, __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_ERR(0, 2382, __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_ERR(0, 2382, __pyx_L1_error)
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":2377
- * 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":2385
- * "'%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_61delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_60delncattr[] = "\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_61delncattr(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_60delncattr(((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_60delncattr(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;
- __Pyx_RefNannySetupContext("delncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":2394
- * 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_ERR(0, 2394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2395
- * 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_ERR(0, 2395, __pyx_L1_error)
- __pyx_v_attname = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2396
- * 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_ERR(0, 2396, __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_ERR(0, 2396, __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_ERR(0, 2396, __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_ERR(0, 2396, __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":2397
- * 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":2398
- * 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 AttributeError((<char *>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_ERR(0, 2398, __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_ERR(0, 2398, __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_ERR(0, 2398, __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_ERR(0, 2398, __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":2399
- * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2400
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 2400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2400, __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_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2400, __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_ERR(0, 2400, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2399
- * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname)
- * if self.data_model != 'NETCDF4': self._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2385
- * "'%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":2402
- * raise AttributeError((<char *>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_63__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_63__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_62__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_62__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;
- __Pyx_RefNannySetupContext("__setattr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2405
- * # 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_ERR(0, 2405, __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_ERR(0, 2405, __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":2406
- * # 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_ERR(0, 2406, __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_ERR(0, 2406, __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_ERR(0, 2406, __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":2405
- * # 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":2407
- * 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_ERR(0, 2407, __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_ERR(0, 2407, __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_ERR(0, 2407, __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":2408
- * 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_ERR(0, 2408, __pyx_L1_error)
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2410
- * 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_ERR(0, 2410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2410, __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_ERR(0, 2410, __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_ERR(0, 2410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2409
- * 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_ERR(0, 2409, __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_ERR(0, 2409, __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_ERR(0, 2409, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2408
- * 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":2412
- * "'%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_ERR(0, 2412, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 2412, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":2407
- * 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":2402
- * raise AttributeError((<char *>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":2414
- * 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_65__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_65__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_64__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_64__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;
- __Pyx_RefNannySetupContext("__getattr__", 0);
- __Pyx_INCREF(__pyx_v_name);
-
- /* "netCDF4/_netCDF4.pyx":2417
- * # 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_ERR(0, 2417, __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_ERR(0, 2417, __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_ERR(0, 2417, __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_ERR(0, 2417, __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_ERR(0, 2417, __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_ERR(0, 2417, __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":2419
- * 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_ERR(0, 2419, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2420
- * # 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_ERR(0, 2420, __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_ERR(0, 2420, __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_ERR(0, 2420, __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":2421
- * 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_ERR(0, 2421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_values = ((PyObject*)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2422
- * 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_ERR(0, 2422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2422, __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_ERR(0, 2422, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2422, __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_ERR(0, 2422, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2422, __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_ERR(0, 2422, __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":2423
- * 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_ERR(0, 2423, __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_ERR(0, 2423, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2422
- * 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":2424
- * 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_ERR(0, 2424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2424, __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_ERR(0, 2424, __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_ERR(0, 2424, __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_ERR(0, 2424, __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_ERR(0, 2424, __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_ERR(0, 2424, __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":2419
- * 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":2426
- * 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_ERR(0, 2426, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":2417
- * # 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":2427
- * 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_ERR(0, 2427, __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_ERR(0, 2427, __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":2428
- * 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_ERR(0, 2428, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2428, __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":2427
- * else:
- * raise AttributeError
- * elif name in _private_atts: # <<<<<<<<<<<<<<
- * return self.__dict__[name]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2430
- * 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_ERR(0, 2430, __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_ERR(0, 2430, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2430, __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_ERR(0, 2430, __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":2414
- * 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":2432
- * return self.getncattr(name)
- *
- * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<<
- * """
- * **`renameAttribute(self, oldname, newname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_67renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_66renameAttribute[] = "\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_67renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_oldname = 0;
- PyObject *__pyx_v_newname = 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_ERR(0, 2432, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameAttribute") < 0)) __PYX_ERR(0, 2432, __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_ERR(0, 2432, __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_66renameAttribute(((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_66renameAttribute(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;
- __Pyx_RefNannySetupContext("renameAttribute", 0);
-
- /* "netCDF4/_netCDF4.pyx":2440
- * 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_ERR(0, 2440, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2441
- * 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_ERR(0, 2441, __pyx_L1_error)
- __pyx_v_oldnamec = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2442
- * 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_ERR(0, 2442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2443
- * 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_ERR(0, 2443, __pyx_L1_error)
- __pyx_v_newnamec = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2444
- * bytestr = _strencode(newname)
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":2445
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2446
- * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2446, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2446, __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_ERR(0, 2446, __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_ERR(0, 2446, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2445
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2432
- * 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":2448
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * def renameGroup(self, oldname, newname): # <<<<<<<<<<<<<<
- * """
- * **`renameGroup(self, oldname, newname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_69renameGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_68renameGroup[] = "\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_69renameGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- CYTHON_UNUSED PyObject *__pyx_v_oldname = 0;
- CYTHON_UNUSED PyObject *__pyx_v_newname = 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_ERR(0, 2448, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameGroup") < 0)) __PYX_ERR(0, 2448, __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_ERR(0, 2448, __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_68renameGroup(((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_68renameGroup(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;
- __Pyx_RefNannySetupContext("renameGroup", 0);
-
- /* "netCDF4/_netCDF4.pyx":2470
- * 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":2473
- * 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_ERR(0, 2473, __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_ERR(0, 2473, __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_ERR(0, 2473, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2448
- * raise RuntimeError((<char *>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":2475
- * 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_71set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_70set_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 af [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_71set_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_70set_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_70set_auto_maskandscale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) {
- PyObject *__pyx_v__vars = NULL;
- 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;
- 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)(PyObject *);
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- Py_ssize_t __pyx_t_12;
- PyObject *(*__pyx_t_13)(PyObject *);
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- __Pyx_RefNannySetupContext("set_auto_maskandscale", 0);
-
- /* "netCDF4/_netCDF4.pyx":2491
- * # this is a hack to make inheritance work in MFDataset
- * # (which stores variables in _vars)
- * _vars = self.variables # <<<<<<<<<<<<<<
- * if _vars is None: _vars = self._vars
- * for var in _vars.values():
- */
- __pyx_t_1 = __pyx_v_self->variables;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v__vars = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2492
- * # (which stores variables in _vars)
- * _vars = self.variables
- * if _vars is None: _vars = self._vars # <<<<<<<<<<<<<<
- * for var in _vars.values():
- * var.set_auto_maskandscale(value)
- */
- __pyx_t_2 = (__pyx_v__vars == Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v__vars, __pyx_t_1);
- __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":2493
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for var in _vars.values(): # <<<<<<<<<<<<<<
- * var.set_auto_maskandscale(value)
- *
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__vars, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2493, __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_ERR(0, 2493, __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_ERR(0, 2493, __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_6 = 0;
- __pyx_t_7 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2493, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_7)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2493, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2493, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_7(__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_ERR(0, 2493, __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":2494
- * if _vars is None: _vars = self._vars
- * for var in _vars.values():
- * var.set_auto_maskandscale(value) # <<<<<<<<<<<<<<
- *
- * for groups in _walk_grps(self):
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_maskandscale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2494, __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_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_value);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2493
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for var in _vars.values(): # <<<<<<<<<<<<<<
- * var.set_auto_maskandscale(value)
- *
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2496
- * 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_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __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_6 = 0;
- __pyx_t_7 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2496, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_7)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2496, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2496, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_7(__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_ERR(0, 2496, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_groups, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2497
- *
- * 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_4 = __pyx_v_groups; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_groups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2497, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2497, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2497, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_11(__pyx_t_4);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2497, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2498
- * for groups in _walk_grps(self):
- * for group in groups:
- * for var in group.variables.values(): # <<<<<<<<<<<<<<
- * var.set_auto_maskandscale(value)
- *
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2498, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
- __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
- __pyx_t_13 = NULL;
- } else {
- __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2498, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- for (;;) {
- if (likely(!__pyx_t_13)) {
- if (likely(PyList_CheckExact(__pyx_t_8))) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2498, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2498, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_13(__pyx_t_8);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2498, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2499
- * for group in groups:
- * for var in group.variables.values():
- * var.set_auto_maskandscale(value) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_maskandscale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_14)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- if (!__pyx_t_14) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- } else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_value);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2498
- * 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_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2497
- *
- * 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_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2496
- * 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":2475
- * 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_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_auto_maskandscale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v__vars);
- __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":2502
- *
- *
- * def set_auto_mask(self, value): # <<<<<<<<<<<<<<
- * """
- * **`set_auto_mask(self, True_or_False)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_73set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_72set_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\n [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_73set_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_72set_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_72set_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;
- __Pyx_RefNannySetupContext("set_auto_mask", 0);
-
- /* "netCDF4/_netCDF4.pyx":2516
- * """
- *
- * 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_ERR(0, 2516, __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_ERR(0, 2516, __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_ERR(0, 2516, __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_ERR(0, 2516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2516, __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_ERR(0, 2516, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2516, __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_ERR(0, 2516, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2516, __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_ERR(0, 2516, __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":2517
- *
- * 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_ERR(0, 2517, __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_ERR(0, 2517, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2517, __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_ERR(0, 2517, __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":2516
- * """
- *
- * for var in self.variables.values(): # <<<<<<<<<<<<<<
- * var.set_auto_mask(value)
- *
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2519
- * 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_ERR(0, 2519, __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_ERR(0, 2519, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2519, __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_ERR(0, 2519, __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_ERR(0, 2519, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2519, __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_ERR(0, 2519, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __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_ERR(0, 2519, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __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_ERR(0, 2519, __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":2520
- *
- * 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_ERR(0, 2520, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2520, __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_ERR(0, 2520, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2520, __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_ERR(0, 2520, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2520, __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_ERR(0, 2520, __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":2521
- * 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_ERR(0, 2521, __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_ERR(0, 2521, __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_ERR(0, 2521, __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_ERR(0, 2521, __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_ERR(0, 2521, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2521, __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_ERR(0, 2521, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2521, __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_ERR(0, 2521, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2521, __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_ERR(0, 2521, __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":2522
- * 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_ERR(0, 2522, __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_ERR(0, 2522, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2522, __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_ERR(0, 2522, __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":2521
- * 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":2520
- *
- * 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":2519
- * 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":2502
- *
- *
- * 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":2524
- * 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_75set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_74set_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 ca [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_75set_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_74set_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_74set_auto_scale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) {
- PyObject *__pyx_v__vars = NULL;
- 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;
- 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)(PyObject *);
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- Py_ssize_t __pyx_t_12;
- PyObject *(*__pyx_t_13)(PyObject *);
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- __Pyx_RefNannySetupContext("set_auto_scale", 0);
-
- /* "netCDF4/_netCDF4.pyx":2540
- * # this is a hack to make inheritance work in MFDataset
- * # (which stores variables in _vars)
- * _vars = self.variables # <<<<<<<<<<<<<<
- * if _vars is None: _vars = self._vars
- * for var in _vars.values():
- */
- __pyx_t_1 = __pyx_v_self->variables;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v__vars = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2541
- * # (which stores variables in _vars)
- * _vars = self.variables
- * if _vars is None: _vars = self._vars # <<<<<<<<<<<<<<
- * for var in _vars.values():
- * var.set_auto_scale(value)
- */
- __pyx_t_2 = (__pyx_v__vars == Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v__vars, __pyx_t_1);
- __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":2542
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for var in _vars.values(): # <<<<<<<<<<<<<<
- * var.set_auto_scale(value)
- *
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__vars, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2542, __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_ERR(0, 2542, __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_ERR(0, 2542, __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_6 = 0;
- __pyx_t_7 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2542, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_7)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2542, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2542, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_7(__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_ERR(0, 2542, __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":2543
- * if _vars is None: _vars = self._vars
- * for var in _vars.values():
- * var.set_auto_scale(value) # <<<<<<<<<<<<<<
- *
- * for groups in _walk_grps(self):
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_scale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __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_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_value);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2542
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for var in _vars.values(): # <<<<<<<<<<<<<<
- * var.set_auto_scale(value)
- *
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2545
- * 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_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)__pyx_v_self));
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __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_6 = 0;
- __pyx_t_7 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2545, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_7)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2545, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2545, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_7(__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_ERR(0, 2545, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_groups, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2546
- *
- * 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_4 = __pyx_v_groups; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_groups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2546, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2546, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2546, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_11(__pyx_t_4);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2546, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2547
- * for groups in _walk_grps(self):
- * for group in groups:
- * for var in group.variables.values(): # <<<<<<<<<<<<<<
- * var.set_auto_scale(value)
- *
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
- __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
- __pyx_t_13 = NULL;
- } else {
- __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2547, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- for (;;) {
- if (likely(!__pyx_t_13)) {
- if (likely(PyList_CheckExact(__pyx_t_8))) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2547, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2547, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_13(__pyx_t_8);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2547, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2548
- * for group in groups:
- * for var in group.variables.values():
- * var.set_auto_scale(value) # <<<<<<<<<<<<<<
- *
- * def get_variables_by_attributes(self, **kwargs):
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_scale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2548, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_14)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- if (!__pyx_t_14) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2548, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- } else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2548, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_value);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2548, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2547
- * 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_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2546
- *
- * 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_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2545
- * 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":2524
- * 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_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_auto_scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v__vars);
- __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":2550
- * 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_77get_variables_by_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_76get_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\" attri [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_77get_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_76get_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_76get_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__vars = 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;
- int __pyx_t_2;
- int __pyx_t_3;
- 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 *);
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- PyObject *(*__pyx_t_13)(PyObject *);
- PyObject *__pyx_t_14 = NULL;
- int __pyx_t_15;
- int __pyx_t_16;
- __Pyx_RefNannySetupContext("get_variables_by_attributes", 0);
-
- /* "netCDF4/_netCDF4.pyx":2578
- * >>> 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_ERR(0, 2578, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_vs = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2580
- * vs = []
- *
- * has_value_flag = False # <<<<<<<<<<<<<<
- * # this is a hack to make inheritance work in MFDataset
- * # (which stores variables in _vars)
- */
- __Pyx_INCREF(Py_False);
- __pyx_v_has_value_flag = Py_False;
-
- /* "netCDF4/_netCDF4.pyx":2583
- * # this is a hack to make inheritance work in MFDataset
- * # (which stores variables in _vars)
- * _vars = self.variables # <<<<<<<<<<<<<<
- * if _vars is None: _vars = self._vars
- * for vname in _vars:
- */
- __pyx_t_1 = __pyx_v_self->variables;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v__vars = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2584
- * # (which stores variables in _vars)
- * _vars = self.variables
- * if _vars is None: _vars = self._vars # <<<<<<<<<<<<<<
- * for vname in _vars:
- * var = _vars[vname]
- */
- __pyx_t_2 = (__pyx_v__vars == Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v__vars, __pyx_t_1);
- __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":2585
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for vname in _vars: # <<<<<<<<<<<<<<
- * var = _vars[vname]
- * for k, v in kwargs.items():
- */
- if (likely(PyList_CheckExact(__pyx_v__vars)) || PyTuple_CheckExact(__pyx_v__vars)) {
- __pyx_t_1 = __pyx_v__vars; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v__vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2585, __pyx_L1_error)
- }
- 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_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2585, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2585, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2585, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2585, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_5(__pyx_t_1);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2585, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_vname, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2586
- * if _vars is None: _vars = self._vars
- * for vname in _vars:
- * var = _vars[vname] # <<<<<<<<<<<<<<
- * for k, v in kwargs.items():
- * if callable(v):
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v__vars, __pyx_v_vname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2586, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2587
- * for vname in _vars:
- * var = _vars[vname]
- * for k, v in kwargs.items(): # <<<<<<<<<<<<<<
- * if callable(v):
- * has_value_flag = v(getattr(var, k, None))
- */
- __pyx_t_6 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
- __pyx_t_9 = NULL;
- } else {
- __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2587, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2587, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2587, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_9(__pyx_t_7);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 2587, __pyx_L1_error)
- }
- break;
- }
- __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 != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 2587, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_11);
- #else
- __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- #endif
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2587, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
- index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_10);
- index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_11);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 2587, __pyx_L1_error)
- __pyx_t_13 = NULL;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- goto __pyx_L9_unpacking_done;
- __pyx_L8_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_13 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 2587, __pyx_L1_error)
- __pyx_L9_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
- __pyx_t_10 = 0;
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_11);
- __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2588
- * var = _vars[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_3 = __Pyx_PyCallable_Check(__pyx_v_v); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2588, __pyx_L1_error)
- __pyx_t_2 = (__pyx_t_3 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":2589
- * 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_11 = __Pyx_GetAttr3(__pyx_v_var, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2589, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_v_v);
- __pyx_t_10 = __pyx_v_v; __pyx_t_12 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- }
- }
- if (!__pyx_t_12) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2589, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2589, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2589, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF_SET(__pyx_v_has_value_flag, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2590
- * 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_2 = (__pyx_v_has_value_flag == Py_False);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2591
- * 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_L7_break;
-
- /* "netCDF4/_netCDF4.pyx":2590
- * 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":2588
- * var = _vars[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_L10;
- }
-
- /* "netCDF4/_netCDF4.pyx":2592
- * if has_value_flag is False:
- * break
- * elif hasattr(var, k) and getattr(var, k) == v: # <<<<<<<<<<<<<<
- * has_value_flag = True
- * else:
- */
- __pyx_t_2 = PyObject_HasAttr(__pyx_v_var, __pyx_v_k); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2592, __pyx_L1_error)
- __pyx_t_15 = (__pyx_t_2 != 0);
- if (__pyx_t_15) {
- } else {
- __pyx_t_3 = __pyx_t_15;
- goto __pyx_L12_bool_binop_done;
- }
- __pyx_t_6 = __Pyx_GetAttr(__pyx_v_var, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2592, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_6, __pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2592, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 2592, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_3 = __pyx_t_15;
- __pyx_L12_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2593
- * 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":2592
- * if has_value_flag is False:
- * break
- * elif hasattr(var, k) and getattr(var, k) == v: # <<<<<<<<<<<<<<
- * has_value_flag = True
- * else:
- */
- goto __pyx_L10;
- }
-
- /* "netCDF4/_netCDF4.pyx":2595
- * 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":2596
- * else:
- * has_value_flag = False
- * break # <<<<<<<<<<<<<<
- *
- * if has_value_flag is True:
- */
- goto __pyx_L7_break;
- }
- __pyx_L10:;
-
- /* "netCDF4/_netCDF4.pyx":2587
- * for vname in _vars:
- * var = _vars[vname]
- * for k, v in kwargs.items(): # <<<<<<<<<<<<<<
- * if callable(v):
- * has_value_flag = v(getattr(var, k, None))
- */
- }
- __pyx_L7_break:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2598
- * break
- *
- * if has_value_flag is True: # <<<<<<<<<<<<<<
- * vs.append(_vars[vname])
- *
- */
- __pyx_t_3 = (__pyx_v_has_value_flag == Py_True);
- __pyx_t_15 = (__pyx_t_3 != 0);
- if (__pyx_t_15) {
-
- /* "netCDF4/_netCDF4.pyx":2599
- *
- * if has_value_flag is True:
- * vs.append(_vars[vname]) # <<<<<<<<<<<<<<
- *
- * return vs
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v__vars, __pyx_v_vname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2599, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_vs, __pyx_t_7); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 2599, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2598
- * break
- *
- * if has_value_flag is True: # <<<<<<<<<<<<<<
- * vs.append(_vars[vname])
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2585
- * _vars = self.variables
- * if _vars is None: _vars = self._vars
- * for vname in _vars: # <<<<<<<<<<<<<<
- * var = _vars[vname]
- * for k, v in kwargs.items():
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2601
- * vs.append(_vars[vname])
- *
- * return vs # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_vs);
- __pyx_r = __pyx_v_vs;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2550
- * 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- __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__vars);
- __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":1659
- * """
- * 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;
- __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_ERR(0, 1659, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1659, __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":1660
- * 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;
- __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_ERR(0, 1660, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1660, __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":1661
- * 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":1662
- * 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":1663
- * 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":2623
- * __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` insta [...]
-#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_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_ERR(0, 2623, __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_ERR(0, 2623, __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_ERR(0, 2623, __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;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2640
- * 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":2642
- * 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_ERR(0, 2642, __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":2643
- * # 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_ERR(0, 2643, __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":2645
- * 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_ERR(0, 2645, __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_ERR(0, 2645, __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_ERR(0, 2645, __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_ERR(0, 2645, __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_ERR(0, 2645, __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":2647
- * 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":2649
- * 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_ERR(0, 2649, __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":2650
- * # 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_ERR(0, 2650, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":2651
- * 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)) __PYX_ERR(0, 2651, __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_ERR(0, 2651, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_self->__pyx_base._grpid = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":2653
- * 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_ERR(0, 2653, __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_ERR(0, 2653, __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_ERR(0, 2653, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2653, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __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_ERR(0, 2653, __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_ERR(0, 2653, __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_ERR(0, 2653, __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":2655
- * 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_ERR(0, 2655, __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":2657
- * 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_ERR(0, 2657, __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":2659
- * 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_ERR(0, 2659, __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":2650
- * # 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":2661
- * 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_ERR(0, 2661, __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)
- * 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_ERR(0, 2662, __pyx_L1_error)
- __pyx_v_groupname = __pyx_t_11;
-
- /* "netCDF4/_netCDF4.pyx":2663
- * bytestr = _strencode(name)
- * groupname = bytestr
- * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2663, __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_ERR(0, 2663, __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":2664
- * groupname = bytestr
- * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * self.cmptypes = OrderedDict()
- */
- __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":2665
- * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __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_ERR(0, 2665, __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_ERR(0, 2665, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2664
- * groupname = bytestr
- * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * self.cmptypes = OrderedDict()
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2666
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2666, __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_ERR(0, 2666, __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_ERR(0, 2666, __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":2667
- * raise RuntimeError((<char *>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_ERR(0, 2667, __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_ERR(0, 2667, __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_ERR(0, 2667, __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":2668
- * 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_ERR(0, 2668, __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_ERR(0, 2668, __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_ERR(0, 2668, __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":2669
- * 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_ERR(0, 2669, __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_ERR(0, 2669, __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_ERR(0, 2669, __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":2670
- * 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_ERR(0, 2670, __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_ERR(0, 2670, __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_ERR(0, 2670, __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":2671
- * 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_ERR(0, 2671, __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_ERR(0, 2671, __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_ERR(0, 2671, __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":2623
- * __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":2673
- * 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;
- __Pyx_RefNannySetupContext("close", 0);
-
- /* "netCDF4/_netCDF4.pyx":2679
- * 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_ERR(0, 2679, __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_ERR(0, 2679, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2673
- * 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":2681
- * 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;
- __Pyx_RefNannySetupContext("_getname", 0);
-
- /* "netCDF4/_netCDF4.pyx":2685
- * 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":2686
- * cdef char namstring[NC_MAX_NAME+1]
- * with nogil:
- * ierr = nc_inq_grpname(self._grpid, namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_grpname(__pyx_v_self->__pyx_base._grpid, __pyx_v_namstring);
- }
-
- /* "netCDF4/_netCDF4.pyx":2685
- * 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":2687
- * with nogil:
- * ierr = nc_inq_grpname(self._grpid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":2688
- * ierr = nc_inq_grpname(self._grpid, namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2688, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __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_ERR(0, 2688, __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_ERR(0, 2688, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2687
- * with nogil:
- * ierr = nc_inq_grpname(self._grpid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2689
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2689, __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_ERR(0, 2689, __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_ERR(0, 2689, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2689, __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_ERR(0, 2689, __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_ERR(0, 2689, __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":2681
- * 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":2693
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2694
- * """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_ERR(0, 2694, __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_ERR(0, 2694, __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_ERR(0, 2694, __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":2693
- * 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":2695
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2696
- * 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_ERR(0, 2696, __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_ERR(0, 2696, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2695
- * 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":2724
- * `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.cre [...]
-#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_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_ERR(0, 2724, __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_ERR(0, 2724, __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_ERR(0, 2724, __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;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2743
- * 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_ERR(0, 2743, __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_ERR(0, 2743, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_self->_grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2746
- * # 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_ERR(0, 2746, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2746, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2747
- * # 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_ERR(0, 2747, __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_ERR(0, 2747, __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_ERR(0, 2747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2747, __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_ERR(0, 2747, __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":2746
- * # 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":2749
- * 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":2750
- * 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_ERR(0, 2750, __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":2751
- * 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":2752
- * 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_ERR(0, 2752, __pyx_L1_error)
- __pyx_t_7 = (__pyx_t_3 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":2753
- * 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)) __PYX_ERR(0, 2753, __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_ERR(0, 2753, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_self->_dimid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2752
- * self._data_model = grp.data_model
- * self._name = name
- * if 'id' in kwargs: # <<<<<<<<<<<<<<
- * self._dimid = kwargs['id']
- * else:
- */
- goto __pyx_L4;
- }
-
- /* "netCDF4/_netCDF4.pyx":2755
- * 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_ERR(0, 2755, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2756
- * 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_ERR(0, 2756, __pyx_L1_error)
- __pyx_v_dimname = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":2757
- * 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":2758
- * 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_ERR(0, 2758, __pyx_L1_error)
- __pyx_v_lendim = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":2757
- * bytestr = _strencode(name)
- * dimname = bytestr
- * if size is not None: # <<<<<<<<<<<<<<
- * lendim = size
- * else:
- */
- goto __pyx_L5;
- }
-
- /* "netCDF4/_netCDF4.pyx":2760
- * 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":2761
- * 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_ERR(0, 2761, __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_ERR(0, 2761, __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_ERR(0, 2761, __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_ERR(0, 2761, __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_ERR(0, 2761, __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":2762
- * 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":2763
- * 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((<char *>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_ERR(0, 2763, __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_ERR(0, 2763, __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_ERR(0, 2763, __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_ERR(0, 2763, __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_ERR(0, 2763, __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":2764
- * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid)
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":2765
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2765, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2765, __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_ERR(0, 2765, __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_ERR(0, 2765, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2764
- * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid)
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
- }
- __pyx_L4:;
-
- /* "netCDF4/_netCDF4.pyx":2724
- * `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":2767
- * raise RuntimeError((<char *>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;
- __Pyx_RefNannySetupContext("_getname", 0);
-
- /* "netCDF4/_netCDF4.pyx":2771
- * 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_ERR(0, 2771, __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_ERR(0, 2771, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":2772
- * 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":2773
- * _grpid = self._grp._grpid
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_dimname(__pyx_v__grpid, __pyx_v_self->_dimid, __pyx_v_namstring);
- }
-
- /* "netCDF4/_netCDF4.pyx":2772
- * 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":2774
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, self._dimid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":2775
- * ierr = nc_inq_dimname(_grpid, self._dimid, namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2775, __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_ERR(0, 2775, __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_ERR(0, 2775, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2774
- * with nogil:
- * ierr = nc_inq_dimname(_grpid, self._dimid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2776
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2776, __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_ERR(0, 2776, __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_ERR(0, 2776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2776, __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_ERR(0, 2776, __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_ERR(0, 2776, __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":2767
- * raise RuntimeError((<char *>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":2780
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2781
- * """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_ERR(0, 2781, __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_ERR(0, 2781, __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_ERR(0, 2781, __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":2780
- * 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":2782
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2783
- * 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_ERR(0, 2783, __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_ERR(0, 2783, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2782
- * 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":2787
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2788
- * """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_ERR(0, 2788, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2787
- * 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":2789
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2790
- * 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_ERR(0, 2790, __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_ERR(0, 2790, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2789
- * 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":2792
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2793
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2793, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":2794
- * 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_ERR(0, 2794, __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_ERR(0, 2794, __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_ERR(0, 2794, __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":2793
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2796
- * 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_ERR(0, 2796, __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_ERR(0, 2796, __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_ERR(0, 2796, __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_ERR(0, 2796, __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_ERR(0, 2796, __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_ERR(0, 2796, __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_ERR(0, 2796, __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":2792
- * 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":2798
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2799
- *
- * 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_ERR(0, 2799, __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_ERR(0, 2799, __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":2800
- * 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":2799
- *
- * def __unicode__(self):
- * if not dir(self._grp): # <<<<<<<<<<<<<<
- * return 'Dimension object no longer valid'
- * if self.isunlimited():
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2801
- * 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_ERR(0, 2801, __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_ERR(0, 2801, __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_ERR(0, 2801, __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_ERR(0, 2801, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":2802
- * 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_ERR(0, 2802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2802, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2802, __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_ERR(0, 2802, __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_ERR(0, 2802, __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":2801
- * 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":2804
- * 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_ERR(0, 2804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2804, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2804, __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_ERR(0, 2804, __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_ERR(0, 2804, __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":2798
- * 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":2806
- * 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;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "netCDF4/_netCDF4.pyx":2810
- * 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":2811
- * cdef size_t lengthp
- * with nogil:
- * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":2810
- * 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":2812
- * with nogil:
- * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return lengthp
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2813
- * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2813, __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_ERR(0, 2813, __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_ERR(0, 2813, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2812
- * with nogil:
- * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return lengthp
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2814
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return lengthp # <<<<<<<<<<<<<<
- *
- * def group(self):
- */
- __pyx_r = __pyx_v_lengthp;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2806
- * 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":2816
- * 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":2821
- *
- * 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":2816
- * return lengthp
- *
- * def group(self): # <<<<<<<<<<<<<<
- * """
- * **`group(self)`**
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":2823
- * 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;
- __Pyx_RefNannySetupContext("isunlimited", 0);
-
- /* "netCDF4/_netCDF4.pyx":2830
- * 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_ERR(0, 2830, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2831
- * cdef int *unlimdimids
- * if self._data_model == 'NETCDF4':
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_unlimdims(__pyx_v_self->_grpid, (&__pyx_v_numunlimdims), NULL);
-
- /* "netCDF4/_netCDF4.pyx":2832
- * if self._data_model == 'NETCDF4':
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if numunlimdims == 0:
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2833
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2833, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2833, __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_ERR(0, 2833, __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_ERR(0, 2833, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2832
- * if self._data_model == 'NETCDF4':
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if numunlimdims == 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2834
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":2835
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if numunlimdims == 0:
- * return False # <<<<<<<<<<<<<<
- * else:
- * unlimdimids = <int *>malloc(sizeof(int) * numunlimdims)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":2834
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if numunlimdims == 0: # <<<<<<<<<<<<<<
- * return False
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2837
- * return False
- * else:
- * unlimdimids = <int *>malloc(sizeof(int) * numunlimdims) # <<<<<<<<<<<<<<
- * dimid = self._dimid
- * with nogil:
- */
- /*else*/ {
- __pyx_v_unlimdimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numunlimdims)));
-
- /* "netCDF4/_netCDF4.pyx":2838
- * else:
- * unlimdimids = <int *>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":2839
- * unlimdimids = <int *>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":2840
- * dimid = self._dimid
- * with nogil:
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_unlimdims(__pyx_v_self->_grpid, (&__pyx_v_numunlimdims), __pyx_v_unlimdimids);
- }
-
- /* "netCDF4/_netCDF4.pyx":2839
- * unlimdimids = <int *>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":2841
- * with nogil:
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * unlimdim_ids = []
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":2842
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2842, __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_ERR(0, 2842, __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_ERR(0, 2842, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":2841
- * with nogil:
- * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * unlimdim_ids = []
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2843
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 2843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_unlimdim_ids = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2844
- * raise RuntimeError((<char *>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":2845
- * 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_ERR(0, 2845, __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_ERR(0, 2845, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":2846
- * 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":2847
- * 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_ERR(0, 2847, __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_ERR(0, 2847, __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":2848
- * 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":2847
- * unlimdim_ids.append(unlimdimids[n])
- * free(unlimdimids)
- * if dimid in unlimdim_ids: # <<<<<<<<<<<<<<
- * return True
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2850
- * 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":2830
- * 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":2853
- * 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":2854
- * # 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":2853
- * 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":2855
- * 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":2856
- * 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":2855
- * with nogil:
- * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid)
- * if self._dimid == xdimid: # <<<<<<<<<<<<<<
- * return True
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2858
- * 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":2823
- * 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":2717
- * `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;
- __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_ERR(0, 2717, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2717, __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;
- __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_ERR(0, 2717, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2717, __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":2718
- * """
- * 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":2954
- * """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 [...]
-#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_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":2955
- *
- * 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":2956
- * 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":2957
- * 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_ERR(0, 2954, __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_ERR(0, 2954, __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_ERR(0, 2954, __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_ERR(0, 2954, __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":2954
- * """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, [...]
- 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;
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_datatype);
- __Pyx_INCREF(__pyx_v_dimensions);
- __Pyx_INCREF(__pyx_v_zlib);
-
- /* "netCDF4/_netCDF4.pyx":3056
- * 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":3058
- * 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_ERR(0, 3058, __pyx_L1_error)
- __pyx_t_2 = ((!__pyx_t_1) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3059
- * # 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":3058
- * 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":3063
- * # 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_ERR(0, 3063, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3063, __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_ERR(0, 3063, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3063, __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_ERR(0, 3063, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3063, __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":3064
- * # 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_ERR(0, 3064, __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":3063
- * # 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":3065
- * 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_ERR(0, 3065, __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_ERR(0, 3065, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_self->_grpid = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":3068
- * # 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_ERR(0, 3068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3068, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3069
- * # 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_ERR(0, 3069, __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_ERR(0, 3069, __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_ERR(0, 3069, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3069, __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_ERR(0, 3069, __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":3068
- * # 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":3071
- * 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":3072
- * 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_ERR(0, 3072, __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":3073
- * 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_ERR(0, 3073, __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":3074
- * 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_ERR(0, 3074, __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":3075
- * 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_ERR(0, 3075, __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":3077
- * 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_ERR(0, 3077, __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_ERR(0, 3077, __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_ERR(0, 3077, __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_ERR(0, 3077, __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_ERR(0, 3077, __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":3078
- * # 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_ERR(0, 3078, __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_ERR(0, 3078, __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_ERR(0, 3078, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3078, __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_ERR(0, 3078, __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":3077
- * 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":3081
- * # 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_ERR(0, 3081, __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_ERR(0, 3081, __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_ERR(0, 3081, __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":3082
- * # 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_ERR(0, 3082, __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_ERR(0, 3082, __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_ERR(0, 3082, __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_ERR(0, 3082, __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_ERR(0, 3082, __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":3083
- * 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_ERR(0, 3083, __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_ERR(0, 3083, __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":3081
- * # 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":3084
- * ((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":3085
- * 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":3081
- * # 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":3087
- * 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_ERR(0, 3087, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_dtype_endian = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3088
- * # 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_ERR(0, 3088, __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":3089
- * 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__14, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3089, __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":3090
- * 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__13, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3090, __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":3091
- * 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_ERR(0, 3091, __pyx_L1_error)
- if (__pyx_t_2) {
- __Pyx_INCREF(Py_None);
- __Pyx_DECREF_SET(__pyx_v_dtype_endian, Py_None);
- }
-
- /* "netCDF4/_netCDF4.pyx":3092
- * 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_ERR(0, 3092, __pyx_L1_error)
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3092, __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":3093
- * 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_ERR(0, 3093, __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_ERR(0, 3093, __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_ERR(0, 3093, __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_ERR(0, 3093, __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_ERR(0, 3093, __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":3097
- * 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":3099
- * 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_ERR(0, 3099, __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_ERR(0, 3099, __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_ERR(0, 3099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3099, __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_ERR(0, 3099, __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":3092
- * 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":3102
- * #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":3103
- * # 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":3104
- * 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":3105
- * 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":3106
- * 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_ERR(0, 3106, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3107
- * 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":3108
- * 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":3109
- * 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":3107
- * self._isenum = False
- * if user_type:
- * if isinstance(datatype, CompoundType): # <<<<<<<<<<<<<<
- * self._iscompound = True
- * self._cmptype = datatype
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3110
- * 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_ERR(0, 3110, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3110, __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":3111
- * 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":3112
- * 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":3110
- * self._iscompound = True
- * self._cmptype = datatype
- * if isinstance(datatype, VLType) or datatype==str: # <<<<<<<<<<<<<<
- * self._isvlen = True
- * self._vltype = datatype
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3113
- * 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":3114
- * 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":3115
- * 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":3113
- * self._isvlen = True
- * self._vltype = datatype
- * if isinstance(datatype, EnumType): # <<<<<<<<<<<<<<
- * self._isenum = True
- * self._enumtype = datatype
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3116
- * 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_ERR(0, 3116, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3116, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3117
- * 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_ERR(0, 3117, __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_ERR(0, 3117, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3118
- * 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_ERR(0, 3118, __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_ERR(0, 3118, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3117
- * self._enumtype = datatype
- * if datatype==str:
- * if grp.data_model != 'NETCDF4': # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Variable length strings are only supported for the '
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3123
- * '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_ERR(0, 3123, __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_ERR(0, 3123, __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":3124
- * '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":3116
- * self._isenum = True
- * self._enumtype = datatype
- * if datatype==str: # <<<<<<<<<<<<<<
- * if grp.data_model != 'NETCDF4':
- * raise ValueError(
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3125
- * 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_ERR(0, 3125, __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_ERR(0, 3125, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_xtype = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":3127
- * 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_ERR(0, 3127, __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":3106
- * self._isvlen = False
- * self._isenum = False
- * if user_type: # <<<<<<<<<<<<<<
- * if isinstance(datatype, CompoundType):
- * self._iscompound = True
- */
- goto __pyx_L31;
- }
-
- /* "netCDF4/_netCDF4.pyx":3128
- * # 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_ERR(0, 3128, __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_ERR(0, 3128, __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_ERR(0, 3128, __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_ERR(0, 3128, __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":3129
- * 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":3132
- * # 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_ERR(0, 3132, __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_ERR(0, 3132, __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_ERR(0, 3132, __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)) __PYX_ERR(0, 3132, __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_ERR(0, 3132, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_xtype = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":3134
- * 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":3128
- * # 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":3136
- * 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_ERR(0, 3136, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3136, __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_ERR(0, 3136, __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_ERR(0, 3136, __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_ERR(0, 3136, __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_ERR(0, 3136, __pyx_L1_error)
- }
- __pyx_L31:;
-
- /* "netCDF4/_netCDF4.pyx":3137
- * 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_ERR(0, 3137, __pyx_L1_error)
- __pyx_t_1 = (__pyx_t_8 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3138
- * 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)) __PYX_ERR(0, 3138, __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_ERR(0, 3138, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_self->_varid = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":3137
- * 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":3140
- * 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_ERR(0, 3140, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_bytestr = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3141
- * 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_ERR(0, 3141, __pyx_L1_error)
- __pyx_v_varname = __pyx_t_10;
-
- /* "netCDF4/_netCDF4.pyx":3142
- * 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_ERR(0, 3142, __pyx_L1_error)
- __pyx_v_ndims = __pyx_t_11;
-
- /* "netCDF4/_netCDF4.pyx":3144
- * ndims = len(dimensions)
- * # find dimension ids.
- * if ndims: # <<<<<<<<<<<<<<
- * dims = []
- * dimids = <int *>malloc(sizeof(int) * ndims)
- */
- __pyx_t_1 = (__pyx_v_ndims != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3145
- * # find dimension ids.
- * if ndims:
- * dims = [] # <<<<<<<<<<<<<<
- * dimids = <int *>malloc(sizeof(int) * ndims)
- * for n from 0 <= n < ndims:
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_dims = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3146
- * if ndims:
- * dims = []
- * dimids = <int *>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":3147
- * dims = []
- * dimids = <int *>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":3148
- * dimids = <int *>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)) __PYX_ERR(0, 3148, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3151
- * # 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_ERR(0, 3151, __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_ERR(0, 3151, __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_ERR(0, 3151, __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":3152
- * # 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":3153
- * 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_ERR(0, 3153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3153, __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_ERR(0, 3153, __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_ERR(0, 3153, __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_ERR(0, 3153, __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_ERR(0, 3153, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3152
- * # 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":3154
- * 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_ERR(0, 3154, __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_ERR(0, 3154, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- (__pyx_v_dimids[__pyx_v_n]) = __pyx_t_12;
-
- /* "netCDF4/_netCDF4.pyx":3155
- * 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_ERR(0, 3155, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":3144
- * ndims = len(dimensions)
- * # find dimension ids.
- * if ndims: # <<<<<<<<<<<<<<
- * dims = []
- * dimids = <int *>malloc(sizeof(int) * ndims)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3159
- * # 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_ERR(0, 3159, __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_ERR(0, 3159, __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_ERR(0, 3159, __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_ERR(0, 3159, __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_ERR(0, 3159, __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":3161
- * 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":3162
- * # 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":3164
- * 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":3161
- * 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":3166
- * 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":3167
- * 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":3172
- * # 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_ERR(0, 3172, __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_ERR(0, 3172, __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_ERR(0, 3172, __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_ERR(0, 3172, __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":3173
- * # 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":3175
- * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep,
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3176
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3176, __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_ERR(0, 3176, __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_ERR(0, 3176, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3175
- * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep,
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # reset chunk cache size, leave other parameters unchanged.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3178
- * raise RuntimeError((<char *>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_ERR(0, 3178, __pyx_L1_error)
- __pyx_v_sizep = __pyx_t_14;
-
- /* "netCDF4/_netCDF4.pyx":3179
- * # 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":3181
- * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep,
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3182
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3182, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3182, __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_ERR(0, 3182, __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_ERR(0, 3182, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3181
- * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep,
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ierr != NC_NOERR:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3172
- * # 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":3183
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":3184
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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_ERR(0, 3184, __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_ERR(0, 3184, __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_ERR(0, 3184, __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_ERR(0, 3184, __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_ERR(0, 3184, __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":3185
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3185, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3185, __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_ERR(0, 3185, __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_ERR(0, 3185, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3183
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3192
- * # 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_ERR(0, 3192, __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_ERR(0, 3192, __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_ERR(0, 3192, __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":3194
- * 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_ERR(0, 3194, __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":3195
- * # 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_ERR(0, 3195, __pyx_L1_error)
- __pyx_v_ideflate_level = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":3196
- * 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_ERR(0, 3196, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3197
- * 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":3196
- * 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":3199
- * 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":3200
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3201
- * 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((<char *>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_ERR(0, 3201, __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_ERR(0, 3201, __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_ERR(0, 3201, __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_ERR(0, 3201, __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_ERR(0, 3201, __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":3202
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3202, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3202, __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_ERR(0, 3202, __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_ERR(0, 3202, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3200
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3194
- * 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":3204
- * raise RuntimeError((<char *>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_ERR(0, 3204, __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":3205
- * # 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":3206
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3207
- * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1)
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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_ERR(0, 3207, __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_ERR(0, 3207, __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_ERR(0, 3207, __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_ERR(0, 3207, __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_ERR(0, 3207, __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":3208
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3208, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3208, __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_ERR(0, 3208, __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_ERR(0, 3208, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3206
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3204
- * raise RuntimeError((<char *>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":3210
- * raise RuntimeError((<char *>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":3211
- * # 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_ERR(0, 3211, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3212
- * 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":3213
- * 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":3214
- * 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_ERR(0, 3214, __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_ERR(0, 3214, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3213
- * if contiguous:
- * icontiguous = NC_CONTIGUOUS
- * if chunksizes is not None: # <<<<<<<<<<<<<<
- * raise ValueError('cannot specify chunksizes for a contiguous dataset')
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3211
- * # 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":3216
- * 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":3217
- * 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":3218
- * icontiguous = NC_CHUNKED
- * if chunksizes is None:
- * chunksizesp = NULL # <<<<<<<<<<<<<<
- * else:
- * if len(chunksizes) != len(dimensions):
- */
- __pyx_v_chunksizesp = NULL;
-
- /* "netCDF4/_netCDF4.pyx":3217
- * else:
- * icontiguous = NC_CHUNKED
- * if chunksizes is None: # <<<<<<<<<<<<<<
- * chunksizesp = NULL
- * else:
- */
- goto __pyx_L70;
- }
-
- /* "netCDF4/_netCDF4.pyx":3220
- * 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_ERR(0, 3220, __pyx_L1_error)
- __pyx_t_15 = PyObject_Length(__pyx_v_dimensions); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 3220, __pyx_L1_error)
- __pyx_t_2 = ((__pyx_t_11 != __pyx_t_15) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3221
- * 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 = <size_t *>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_ERR(0, 3221, __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_ERR(0, 3221, __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_ERR(0, 3221, __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_ERR(0, 3221, __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_ERR(0, 3221, __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":3222
- * 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 = <size_t *>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_ERR(0, 3222, __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_ERR(0, 3222, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3220
- * 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":3223
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise ValueError('chunksizes must be a sequence with the same length as dimensions')
- * chunksizesp = <size_t *>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":3224
- * raise ValueError('chunksizes must be a sequence with the same length as dimensions')
- * chunksizesp = <size_t *>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":3225
- * chunksizesp = <size_t *>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_ERR(0, 3225, __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)) __PYX_ERR(0, 3225, __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_ERR(0, 3225, __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_ERR(0, 3225, __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_ERR(0, 3225, __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_ERR(0, 3225, __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":3226
- * 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)) __PYX_ERR(0, 3226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(!__pyx_v_dims)) { __Pyx_RaiseUnboundLocalError("dims"); __PYX_ERR(0, 3226, __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)) __PYX_ERR(0, 3226, __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_ERR(0, 3226, __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_ERR(0, 3226, __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_ERR(0, 3226, __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":3225
- * chunksizesp = <size_t *>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":3227
- * 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":3228
- * 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_ERR(0, 3228, __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_ERR(0, 3228, __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_ERR(0, 3228, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3225
- * chunksizesp = <size_t *>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":3229
- * 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)) __PYX_ERR(0, 3229, __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_ERR(0, 3229, __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":3230
- * 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_ERR(0, 3230, __pyx_L1_error)
- __pyx_t_2 = __pyx_t_8;
- __pyx_L79_bool_binop_done:;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3231
- * 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":3232
- * 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":3233
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3234
- * free(chunksizesp)
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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_ERR(0, 3234, __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_ERR(0, 3234, __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_ERR(0, 3234, __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_ERR(0, 3234, __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_ERR(0, 3234, __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":3235
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3235, __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_ERR(0, 3235, __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_ERR(0, 3235, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3233
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3230
- * 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":3210
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # set chunking stuff.
- * if ndims: # don't bother for scalar variable. # <<<<<<<<<<<<<<
- * if contiguous:
- * icontiguous = NC_CONTIGUOUS
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3237
- * raise RuntimeError((<char *>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_ERR(0, 3237, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3238
- * # 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":3237
- * raise RuntimeError((<char *>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":3239
- * 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_ERR(0, 3239, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3240
- * 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":3239
- * 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":3241
- * 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_ERR(0, 3241, __pyx_L1_error)
- if (__pyx_t_2) {
- goto __pyx_L83;
- }
-
- /* "netCDF4/_netCDF4.pyx":3244
- * 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_ERR(0, 3244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3244, __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_ERR(0, 3244, __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_ERR(0, 3244, __pyx_L1_error)
- }
- __pyx_L83:;
-
- /* "netCDF4/_netCDF4.pyx":3245
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3246
- * 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((<char *>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_ERR(0, 3246, __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_ERR(0, 3246, __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_ERR(0, 3246, __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_ERR(0, 3246, __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_ERR(0, 3246, __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":3247
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3247, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3247, __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_ERR(0, 3247, __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_ERR(0, 3247, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3245
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3192
- * # 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":3249
- * raise RuntimeError((<char *>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_ERR(0, 3249, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3250
- * 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":3251
- * 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_ERR(0, 3251, __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_ERR(0, 3251, __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_ERR(0, 3251, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3249
- * raise RuntimeError((<char *>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":3255
- * # 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":3256
- * # 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_ERR(0, 3256, __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_ERR(0, 3256, __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":3258
- * 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_ERR(0, 3258, __pyx_L1_error)
- __pyx_t_2 = ((!__pyx_t_8) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3261
- * # 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":3258
- * 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":3263
- * 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":3264
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3265
- * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL)
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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_ERR(0, 3265, __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_ERR(0, 3265, __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_ERR(0, 3265, __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_ERR(0, 3265, __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_ERR(0, 3265, __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":3266
- * if ierr != NC_NOERR:
- * if grp.data_model != 'NETCDF4': grp._enddef()
- * raise RuntimeError((<char *>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_ERR(0, 3266, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3266, __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_ERR(0, 3266, __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_ERR(0, 3266, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3264
- * 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3256
- * # 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":3271
- * # also make sure it is written in native byte order
- * # (the same as the data)
- * if self._isprimitive or self._isenum: # <<<<<<<<<<<<<<
- * fillval = numpy.array(fill_value, self.dtype)
- * if not fillval.dtype.isnative: fillval.byteswap(True)
- */
- /*else*/ {
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3271, __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_ERR(0, 3271, __pyx_L1_error)
- __pyx_t_2 = __pyx_t_8;
- __pyx_L95_bool_binop_done:;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3272
- * # (the same as the data)
- * if self._isprimitive or self._isenum:
- * fillval = numpy.array(fill_value, self.dtype) # <<<<<<<<<<<<<<
- * if not fillval.dtype.isnative: fillval.byteswap(True)
- * _set_att(self._grp, self._varid, '_FillValue',\
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3272, __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_ERR(0, 3272, __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_ERR(0, 3272, __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_ERR(0, 3272, __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":3273
- * if self._isprimitive or self._isenum:
- * fillval = numpy.array(fill_value, self.dtype)
- * if not fillval.dtype.isnative: fillval.byteswap(True) # <<<<<<<<<<<<<<
- * _set_att(self._grp, self._varid, '_FillValue',\
- * fillval, xtype=xtype)
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fillval, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isnative); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = ((!__pyx_t_2) != 0);
- if (__pyx_t_8) {
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fillval, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3274
- * fillval = numpy.array(fill_value, self.dtype)
- * if not fillval.dtype.isnative: fillval.byteswap(True)
- * _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":3275
- * if not fillval.dtype.isnative: fillval.byteswap(True)
- * _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_ERR(0, 3274, __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":3271
- * # also make sure it is written in native byte order
- * # (the same as the data)
- * if self._isprimitive or self._isenum: # <<<<<<<<<<<<<<
- * fillval = numpy.array(fill_value, self.dtype)
- * if not fillval.dtype.isnative: fillval.byteswap(True)
- */
- goto __pyx_L94;
- }
-
- /* "netCDF4/_netCDF4.pyx":3277
- * 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__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3277, __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_ERR(0, 3277, __pyx_L1_error)
- }
- __pyx_L94:;
- }
- __pyx_L88:;
-
- /* "netCDF4/_netCDF4.pyx":3255
- * # 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":3278
- * 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_8 = (__pyx_v_least_significant_digit != Py_None);
- __pyx_t_2 = (__pyx_t_8 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3279
- * 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_ERR(0, 3279, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3278
- * 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":3281
- * 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_ERR(0, 3281, __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_ERR(0, 3281, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_2) {
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3281, __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_ERR(0, 3281, __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_ERR(0, 3281, __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":3283
- * 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":3284
- * # 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_ERR(0, 3284, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3284, __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_ERR(0, 3284, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3284, __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_ERR(0, 3284, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3284, __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_ERR(0, 3284, __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":3286
- * 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_ERR(0, 3286, __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_ERR(0, 3286, __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_ERR(0, 3286, __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":3287
- * # 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_ERR(0, 3287, __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_ERR(0, 3287, __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_ERR(0, 3287, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3287, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_2) {
- __pyx_v_self->_nunlimdim = (__pyx_v_self->_nunlimdim + 1);
- }
-
- /* "netCDF4/_netCDF4.pyx":3284
- * # 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":3289
- * 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":3290
- * # set ndim attribute (number of dimensions).
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3289
- * 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_L105;
- }
- __pyx_L105:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":3291
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * self.ndim = numdims
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3292
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3292, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3292, __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_ERR(0, 3292, __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_ERR(0, 3292, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3291
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * self.ndim = numdims
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3293
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3293, __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":3294
- * raise RuntimeError((<char *>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":3297
- * # default for automatically applying scale_factor and
- * # add_offset, and converting to/from masked arrays is True.
- * self.scale = True # <<<<<<<<<<<<<<
- * self.mask = True
- * if 'least_significant_digit' in self.ncattrs():
- */
- __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":3298
- * # add_offset, and converting to/from masked arrays is True.
- * self.scale = True
- * self.mask = True # <<<<<<<<<<<<<<
- * if 'least_significant_digit' in self.ncattrs():
- * self._has_lsd = True
- */
- __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":3299
- * self.scale = True
- * self.mask = True
- * if 'least_significant_digit' in self.ncattrs(): # <<<<<<<<<<<<<<
- * self._has_lsd = True
- *
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3299, __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_ERR(0, 3299, __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_ERR(0, 3299, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_least_significant_digit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3299, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = (__pyx_t_2 != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":3300
- * self.mask = True
- * if 'least_significant_digit' in self.ncattrs():
- * self._has_lsd = True # <<<<<<<<<<<<<<
- *
- * def __array__(self):
- */
- __Pyx_INCREF(Py_True);
- __Pyx_GIVEREF(Py_True);
- __Pyx_GOTREF(__pyx_v_self->_has_lsd);
- __Pyx_DECREF(__pyx_v_self->_has_lsd);
- __pyx_v_self->_has_lsd = Py_True;
-
- /* "netCDF4/_netCDF4.pyx":3299
- * self.scale = True
- * self.mask = True
- * if 'least_significant_digit' in self.ncattrs(): # <<<<<<<<<<<<<<
- * self._has_lsd = True
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":2954
- * """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":3302
- * self._has_lsd = 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;
- __Pyx_RefNannySetupContext("__array__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3306
- * # 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)) __PYX_ERR(0, 3306, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":3302
- * self._has_lsd = 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":3308
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3309
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3309, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3310
- * 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_ERR(0, 3310, __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_ERR(0, 3310, __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_ERR(0, 3310, __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":3309
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3312
- * 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_ERR(0, 3312, __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_ERR(0, 3312, __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_ERR(0, 3312, __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_ERR(0, 3312, __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_ERR(0, 3312, __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_ERR(0, 3312, __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_ERR(0, 3312, __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":3308
- * 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":3314
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3316
- * 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_ERR(0, 3316, __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_ERR(0, 3316, __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":3317
- * 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":3316
- * 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":3318
- * 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_ERR(0, 3318, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __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":3319
- * 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_ERR(0, 3319, __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_ERR(0, 3319, __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_ERR(0, 3319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3319, __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_ERR(0, 3319, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __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_ERR(0, 3319, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __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_ERR(0, 3319, __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_ERR(0, 3319, __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_ERR(0, 3319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3319, __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_ERR(0, 3319, __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_ERR(0, 3319, __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_ERR(0, 3319, __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":3320
- * 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_ERR(0, 3320, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netCDF4/_netCDF4.pyx":3321
- * 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_ERR(0, 3321, __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_ERR(0, 3321, __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_ERR(0, 3321, __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_ERR(0, 3321, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3321, __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_ERR(0, 3321, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __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_ERR(0, 3321, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __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_ERR(0, 3321, __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":3320
- * 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_ERR(0, 3320, __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_ERR(0, 3320, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3320, __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_ERR(0, 3320, __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_ERR(0, 3320, __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_ERR(0, 3320, __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_ERR(0, 3320, __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":3322
- * 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_ERR(0, 3322, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3324
- * 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__20, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3324, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3324, __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":3323
- * 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_ERR(0, 3323, __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_ERR(0, 3323, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3322
- * 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":3325
- * 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_ERR(0, 3325, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3327
- * 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__20, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3327, __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":3326
- * ('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_ERR(0, 3326, __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_ERR(0, 3326, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3325
- * 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":3328
- * 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_ERR(0, 3328, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3330
- * 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__20, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3330, __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":3329
- * ('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_ERR(0, 3329, __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_ERR(0, 3329, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3328
- * 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":3332
- * ('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":3333
- * 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__20, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __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":3332
- * ('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_ERR(0, 3332, __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_ERR(0, 3332, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_L8:;
-
- /* "netCDF4/_netCDF4.pyx":3334
- * 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_ERR(0, 3334, __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":3335
- * (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_ERR(0, 3335, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3336
- * 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_ERR(0, 3336, __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_ERR(0, 3336, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3335
- * (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":3337
- * 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_ERR(0, 3337, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3338
- * 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_ERR(0, 3338, __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_ERR(0, 3338, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3337
- * 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":3339
- * 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_ERR(0, 3339, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3340
- * 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_ERR(0, 3340, __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_ERR(0, 3340, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3339
- * 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":3341
- * 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_ERR(0, 3341, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_unlimdims = ((PyObject*)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3342
- * 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_ERR(0, 3342, __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_ERR(0, 3342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3342, __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_ERR(0, 3342, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3342, __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_ERR(0, 3342, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3342, __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_ERR(0, 3342, __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":3343
- * 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_ERR(0, 3343, __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_ERR(0, 3343, __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_ERR(0, 3343, __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":3344
- * 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_ERR(0, 3344, __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_ERR(0, 3344, __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_ERR(0, 3344, __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_ERR(0, 3344, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3345
- * 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_ERR(0, 3345, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3344
- * 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":3342
- * 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":3346
- * 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_ERR(0, 3346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__15, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3346, __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_ERR(0, 3346, __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_ERR(0, 3346, __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_ERR(0, 3346, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3347
- * 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__20, __pyx_v_unlimdims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3347, __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_ERR(0, 3347, __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_ERR(0, 3347, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3348
- * 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_ERR(0, 3348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3348, __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_ERR(0, 3348, __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_ERR(0, 3348, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3349
- * 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":3350
- * 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((<char *>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":3349
- * 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":3351
- * with nogil:
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if self._isprimitive:
- */
- __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3352
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3352, __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_ERR(0, 3352, __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_ERR(0, 3352, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3351
- * with nogil:
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if self._isprimitive:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3353
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3353, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":3354
- * raise RuntimeError((<char *>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":3355
- * if self._isprimitive:
- * if no_fill != 1:
- * try: # <<<<<<<<<<<<<<
- * fillval = self._FillValue
- * msg = 'filling on'
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":3356
- * 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_ERR(0, 3356, __pyx_L20_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_fillval = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3357
- * 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":3355
- * 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_PyThreadState_assign
- __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":3358
- * 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 = __Pyx_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_ERR(0, 3358, __pyx_L22_except_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":3359
- * 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_ERR(0, 3359, __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_ERR(0, 3359, __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_ERR(0, 3359, __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)) __PYX_ERR(0, 3359, __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":3360
- * 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_ERR(0, 3360, __pyx_L22_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_8, 1, 0, NULL, NULL, &__pyx_slice__47, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3360, __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_ERR(0, 3360, __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_ERR(0, 3360, __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":3361
- * 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_ERR(0, 3361, __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":3360
- * 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":3363
- * 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_ERR(0, 3363, __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":3355
- * if self._isprimitive:
- * if no_fill != 1:
- * try: # <<<<<<<<<<<<<<
- * fillval = self._FillValue
- * msg = 'filling on'
- */
- __Pyx_PyThreadState_assign
- __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_PyThreadState_assign
- __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":3364
- * 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_ERR(0, 3364, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3354
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if self._isprimitive:
- * if no_fill != 1: # <<<<<<<<<<<<<<
- * try:
- * fillval = self._FillValue
- */
- goto __pyx_L19;
- }
-
- /* "netCDF4/_netCDF4.pyx":3366
- * 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_ERR(0, 3366, __pyx_L1_error)
- }
- __pyx_L19:;
-
- /* "netCDF4/_netCDF4.pyx":3353
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if self._isprimitive: # <<<<<<<<<<<<<<
- * if no_fill != 1:
- * try:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3369
- *
- *
- * 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_ERR(0, 3369, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":3314
- * 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":3371
- * 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;
- __Pyx_RefNannySetupContext("_getdims", 0);
-
- /* "netCDF4/_netCDF4.pyx":3377
- * 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":3378
- * # get number of dimensions for this variable.
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3377
- * 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":3379
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims)
- */
- __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3380
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * dimids = <int *>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_ERR(0, 3380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __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_ERR(0, 3380, __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_ERR(0, 3380, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3379
- * with nogil:
- * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3381
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dimids = <int *>malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<<
- * # get dimension ids.
- * with nogil:
- */
- __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims)));
-
- /* "netCDF4/_netCDF4.pyx":3383
- * dimids = <int *>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":3384
- * # get dimension ids.
- * with nogil:
- * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3383
- * dimids = <int *>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":3385
- * with nogil:
- * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3386
- * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3386, __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_ERR(0, 3386, __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_ERR(0, 3386, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3385
- * with nogil:
- * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # loop over dimensions, retrieve names.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3388
- * raise RuntimeError((<char *>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":3389
- * # 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":3390
- * 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":3391
- * for nn from 0 <= nn < numdims:
- * with nogil:
- * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3390
- * 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":3392
- * with nogil:
- * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3393
- * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3393, __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_ERR(0, 3393, __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_ERR(0, 3393, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3392
- * with nogil:
- * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3394
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3394, __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_ERR(0, 3394, __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_ERR(0, 3394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3394, __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_ERR(0, 3394, __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_ERR(0, 3394, __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":3395
- * raise RuntimeError((<char *>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_ERR(0, 3395, __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_ERR(0, 3395, __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":3396
- * name = namstring.decode(default_encoding,unicode_error)
- * dimensions = dimensions + (name,)
- * free(dimids) # <<<<<<<<<<<<<<
- * return dimensions
- *
- */
- free(__pyx_v_dimids);
-
- /* "netCDF4/_netCDF4.pyx":3397
- * 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":3371
- * 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":3399
- * 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;
- __Pyx_RefNannySetupContext("_getname", 0);
-
- /* "netCDF4/_netCDF4.pyx":3403
- * 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_ERR(0, 3403, __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_ERR(0, 3403, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":3404
- * 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":3405
- * _grpid = self._grp._grpid
- * with nogil:
- * ierr = nc_inq_varname(_grpid, self._varid, namstring) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_v_ierr = nc_inq_varname(__pyx_v__grpid, __pyx_v_self->_varid, __pyx_v_namstring);
- }
-
- /* "netCDF4/_netCDF4.pyx":3404
- * 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":3406
- * with nogil:
- * ierr = nc_inq_varname(_grpid, self._varid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3407
- * ierr = nc_inq_varname(_grpid, self._varid, namstring)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3407, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3407, __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_ERR(0, 3407, __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_ERR(0, 3407, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3406
- * with nogil:
- * ierr = nc_inq_varname(_grpid, self._varid, namstring)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3408
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3408, __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_ERR(0, 3408, __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_ERR(0, 3408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3408, __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_ERR(0, 3408, __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_ERR(0, 3408, __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":3399
- * 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":3412
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3413
- * """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_ERR(0, 3413, __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_ERR(0, 3413, __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_ERR(0, 3413, __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":3412
- * 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":3414
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3415
- * 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__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3415, __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_ERR(0, 3415, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3414
- * 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":3421
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3422
- * (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_ERR(0, 3422, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3423
- * 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":3422
- * (for compound, vlen or enum data types)"""
- * def __get__(self):
- * if self._iscompound: # <<<<<<<<<<<<<<
- * return self._cmptype
- * elif self._isvlen:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3424
- * 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_ERR(0, 3424, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3425
- * 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":3424
- * if self._iscompound:
- * return self._cmptype
- * elif self._isvlen: # <<<<<<<<<<<<<<
- * return self._vltype
- * elif self._isenum:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3426
- * 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_ERR(0, 3426, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3427
- * 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":3426
- * elif self._isvlen:
- * return self._vltype
- * elif self._isenum: # <<<<<<<<<<<<<<
- * return self._enumtype
- * elif self._isprimitive:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3428
- * 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_ERR(0, 3428, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3429
- * 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":3428
- * elif self._isenum:
- * return self._enumtype
- * elif self._isprimitive: # <<<<<<<<<<<<<<
- * return self.dtype
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3421
- * 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":3433
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3434
- * """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":3435
- * 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_ERR(0, 3435, __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_ERR(0, 3435, __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_ERR(0, 3435, __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_ERR(0, 3435, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3435, __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_ERR(0, 3435, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3435, __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_ERR(0, 3435, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3435, __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_ERR(0, 3435, __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":3437
- * 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_ERR(0, 3437, __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_ERR(0, 3437, __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_ERR(0, 3437, __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":3438
- * # 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_ERR(0, 3438, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3438, __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_ERR(0, 3438, __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":3435
- * 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":3439
- * 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":3433
- * 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":3440
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3441
- * 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__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3441, __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_ERR(0, 3441, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3440
- * 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":3445
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3446
- * """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_ERR(0, 3446, __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_ERR(0, 3446, __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_ERR(0, 3446, __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_ERR(0, 3446, __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_ERR(0, 3446, __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_ERR(0, 3446, __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":3445
- * 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":3450
- * 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;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3451
- * """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_ERR(0, 3451, __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_ERR(0, 3451, __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_ERR(0, 3451, __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":3450
- * 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":3452
- * 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;
- __Pyx_RefNannySetupContext("__set__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3453
- * return self._getdims()
- * def __set__(self,value):
- * raise AttributeError("dimensions cannot be altered") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3453, __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_ERR(0, 3453, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3452
- * 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":3456
- *
- *
- * 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":3461
- *
- * 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":3456
- *
- *
- * def group(self): # <<<<<<<<<<<<<<
- * """
- * **`group(self)`**
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":3463
- * 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;
- __Pyx_RefNannySetupContext("ncattrs", 0);
-
- /* "netCDF4/_netCDF4.pyx":3468
- *
- * 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_ERR(0, 3468, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":3463
- * 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":3470
- * 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;
- 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_ERR(0, 3470, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) __PYX_ERR(0, 3470, __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_ERR(0, 3470, __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;
- __Pyx_RefNannySetupContext("setncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":3477
- * 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_ERR(0, 3477, __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_ERR(0, 3477, __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_ERR(0, 3477, __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_ERR(0, 3477, __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_ERR(0, 3477, __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":3478
- * 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_ERR(0, 3478, __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":3479
- * 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 setncattr_string(self,name,value):
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3479, __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_ERR(0, 3479, __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_ERR(0, 3479, __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_ERR(0, 3479, __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_ERR(0, 3479, __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":3470
- * 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":3481
- * if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- *
- * def setncattr_string(self,name,value): # <<<<<<<<<<<<<<
- * """
- * **`setncattr_string(self,name,value)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_19setncattr_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_18setncattr_string[] = "\n**`setncattr_string(self,name,value)`**\n\nset a netCDF variable string attribute using name,value pair.\nUse if you need to ensure that a netCDF attribute is created with type\n`NC_STRING` if the file format is `NETCDF4`.\nUse if you need to set an attribute to an array of variable-length strings.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_19setncattr_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_v_value = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("setncattr_string (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_string", 1, 2, 2, 1); __PYX_ERR(0, 3481, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr_string") < 0)) __PYX_ERR(0, 3481, __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_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3481, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.Variable.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_18setncattr_string(((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_18setncattr_string(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
- nc_type __pyx_v_xtype;
- PyObject *__pyx_v_msg = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att __pyx_t_4;
- __Pyx_RefNannySetupContext("setncattr_string", 0);
-
- /* "netCDF4/_netCDF4.pyx":3490
- * Use if you need to set an attribute to an array of variable-length strings."""
- * cdef nc_type xtype
- * xtype=-99 # <<<<<<<<<<<<<<
- * if self._grp.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes'
- */
- __pyx_v_xtype = -99;
-
- /* "netCDF4/_netCDF4.pyx":3491
- * cdef nc_type xtype
- * xtype=-99
- * if self._grp.data_model != 'NETCDF4': # <<<<<<<<<<<<<<
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3491, __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_ERR(0, 3491, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3492
- * xtype=-99
- * if self._grp.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes' # <<<<<<<<<<<<<<
- * raise IOError(msg)
- * _set_att(self._grp, self._varid, name, value, xtype=xtype, force_ncstring=True)
- */
- __Pyx_INCREF(__pyx_kp_s_file_format_does_not_support_NC);
- __pyx_v_msg = __pyx_kp_s_file_format_does_not_support_NC;
-
- /* "netCDF4/_netCDF4.pyx":3493
- * if self._grp.data_model != 'NETCDF4':
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg) # <<<<<<<<<<<<<<
- * _set_att(self._grp, self._varid, name, value, xtype=xtype, force_ncstring=True)
- *
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3493, __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_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 3493, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3491
- * cdef nc_type xtype
- * xtype=-99
- * if self._grp.data_model != 'NETCDF4': # <<<<<<<<<<<<<<
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3494
- * msg='file format does not support NC_STRING attributes'
- * raise IOError(msg)
- * _set_att(self._grp, self._varid, name, value, xtype=xtype, force_ncstring=True) # <<<<<<<<<<<<<<
- *
- * def setncatts(self,attdict):
- */
- __pyx_t_3 = __pyx_v_self->_grp;
- __Pyx_INCREF(__pyx_t_3);
- __pyx_t_4.__pyx_n = 2;
- __pyx_t_4.xtype = __pyx_v_xtype;
- __pyx_t_4.force_ncstring = Py_True;
- __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__set_att(__pyx_t_3, __pyx_v_self->_varid, __pyx_v_name, __pyx_v_value, &__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3494, __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":3481
- * if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- *
- * def setncattr_string(self,name,value): # <<<<<<<<<<<<<<
- * """
- * **`setncattr_string(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_AddTraceback("netCDF4._netCDF4.Variable.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":3496
- * _set_att(self._grp, self._varid, name, value, xtype=xtype, force_ncstring=True)
- *
- * def setncatts(self,attdict): # <<<<<<<<<<<<<<
- * """
- * **`setncatts(self,attdict)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_21setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_20setncatts[] = "\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_21setncatts(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_20setncatts(((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_20setncatts(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 *);
- __Pyx_RefNannySetupContext("setncatts", 0);
-
- /* "netCDF4/_netCDF4.pyx":3504
- * 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_ERR(0, 3504, __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_ERR(0, 3504, __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_ERR(0, 3504, __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_ERR(0, 3504, __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_ERR(0, 3504, __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":3505
- * 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_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3505, __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_ERR(0, 3505, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3505, __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_ERR(0, 3505, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __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_ERR(0, 3505, __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":3506
- * 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_ERR(0, 3506, __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":3505
- * 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":3507
- * 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_ERR(0, 3507, __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_ERR(0, 3507, __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_ERR(0, 3507, __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_ERR(0, 3507, __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_ERR(0, 3507, __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":3496
- * _set_att(self._grp, self._varid, name, value, xtype=xtype, force_ncstring=True)
- *
- * 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":3509
- * 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_23getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_22getncattr[] = "\n**`getncattr(self,name)`**\n\nretrieve 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_23getncattr(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_22getncattr(((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_22getncattr(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;
- __Pyx_RefNannySetupContext("getncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":3516
- * 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_ERR(0, 3516, __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":3509
- * 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":3518
- * 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_25delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_24delncattr[] = "\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_25delncattr(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_24delncattr(((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_24delncattr(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;
- __Pyx_RefNannySetupContext("delncattr", 0);
-
- /* "netCDF4/_netCDF4.pyx":3526
- * 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_ERR(0, 3526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3527
- * 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_ERR(0, 3527, __pyx_L1_error)
- __pyx_v_attname = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":3528
- * 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_ERR(0, 3528, __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_ERR(0, 3528, __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_ERR(0, 3528, __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_ERR(0, 3528, __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_ERR(0, 3528, __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":3529
- * 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":3530
- * 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((<char *>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_ERR(0, 3530, __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_ERR(0, 3530, __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_ERR(0, 3530, __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_ERR(0, 3530, __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_ERR(0, 3530, __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":3531
- * ierr = nc_del_att(self._grpid, self._varid, attname)
- * if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3532
- * if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3532, __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_ERR(0, 3532, __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_ERR(0, 3532, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3531
- * ierr = nc_del_att(self._grpid, self._varid, attname)
- * if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3518
- * 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":3534
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- * def filters(self): # <<<<<<<<<<<<<<
- * """
- * **`filters(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_27filters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_26filters[] = "\n**`filters(self)`**\n\nreturn dictionary containing HDF5 filter parameters.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_27filters(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_26filters(((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_26filters(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;
- __Pyx_RefNannySetupContext("filters", 0);
-
- /* "netCDF4/_netCDF4.pyx":3540
- * 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_ERR(0, 3540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zlib, Py_False) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shuffle, Py_False) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_complevel, __pyx_int_0) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fletcher32, Py_False) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
- __pyx_v_filtdict = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3541
- * 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_ERR(0, 3541, __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_ERR(0, 3541, __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_ERR(0, 3541, __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":3542
- * 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":3543
- * 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((<char *>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":3542
- * 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":3544
- * with nogil:
- * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * with nogil:
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3545
- * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3545, __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_ERR(0, 3545, __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_ERR(0, 3545, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3544
- * with nogil:
- * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * with nogil:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3546
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3547
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * with nogil:
- * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3546
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3548
- * with nogil:
- * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ideflate:
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3549
- * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3549, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3549, __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_ERR(0, 3549, __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_ERR(0, 3549, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3548
- * with nogil:
- * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ideflate:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3550
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3551
- * raise RuntimeError((<char *>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_ERR(0, 3551, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3552
- * 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_ERR(0, 3552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyDict_SetItem(__pyx_v_filtdict, __pyx_n_s_complevel, __pyx_t_1) < 0)) __PYX_ERR(0, 3552, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3550
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if ideflate: # <<<<<<<<<<<<<<
- * filtdict['zlib']=True
- * filtdict['complevel']=ideflate_level
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3553
- * 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":3554
- * 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_ERR(0, 3554, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3553
- * filtdict['zlib']=True
- * filtdict['complevel']=ideflate_level
- * if ishuffle: # <<<<<<<<<<<<<<
- * filtdict['shuffle']=True
- * if ifletcher32:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3555
- * 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":3556
- * 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_ERR(0, 3556, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3555
- * if ishuffle:
- * filtdict['shuffle']=True
- * if ifletcher32: # <<<<<<<<<<<<<<
- * filtdict['fletcher32']=True
- * return filtdict
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3557
- * 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":3534
- * raise RuntimeError((<char *>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":3559
- * return filtdict
- *
- * def endian(self): # <<<<<<<<<<<<<<
- * """
- * **`endian(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_29endian(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_28endian[] = "\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_29endian(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_28endian(((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_28endian(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;
- __Pyx_RefNannySetupContext("endian", 0);
-
- /* "netCDF4/_netCDF4.pyx":3565
- * 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_ERR(0, 3565, __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_ERR(0, 3565, __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_ERR(0, 3565, __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":3566
- * 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":3565
- * 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":3567
- * 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":3568
- * return 'native'
- * with nogil:
- * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3567
- * 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":3569
- * with nogil:
- * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3570
- * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3570, __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_ERR(0, 3570, __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_ERR(0, 3570, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3569
- * with nogil:
- * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if iendian == NC_ENDIAN_LITTLE:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3571
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3572
- * raise RuntimeError((<char *>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":3571
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * if iendian == NC_ENDIAN_LITTLE: # <<<<<<<<<<<<<<
- * return 'little'
- * elif iendian == NC_ENDIAN_BIG:
- */
- break;
-
- /* "netCDF4/_netCDF4.pyx":3573
- * if iendian == NC_ENDIAN_LITTLE:
- * return 'little'
- * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<<
- * return 'big'
- * else:
- */
- case NC_ENDIAN_BIG:
-
- /* "netCDF4/_netCDF4.pyx":3574
- * 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":3573
- * if iendian == NC_ENDIAN_LITTLE:
- * return 'little'
- * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<<
- * return 'big'
- * else:
- */
- break;
- default:
-
- /* "netCDF4/_netCDF4.pyx":3576
- * 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":3559
- * 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":3578
- * return 'native'
- *
- * def chunking(self): # <<<<<<<<<<<<<<
- * """
- * **`chunking(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_31chunking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_30chunking[] = "\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_31chunking(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_30chunking(((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_30chunking(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;
- __Pyx_RefNannySetupContext("chunking", 0);
-
- /* "netCDF4/_netCDF4.pyx":3588
- * 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 = <size_t *>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_ERR(0, 3588, __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_ERR(0, 3588, __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_ERR(0, 3588, __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":3589
- * cdef size_t *chunksizesp
- * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return None
- * ndims = self.ndim # <<<<<<<<<<<<<<
- * chunksizesp = <size_t *>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_ERR(0, 3589, __pyx_L1_error)
- __pyx_v_ndims = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":3590
- * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return None
- * ndims = self.ndim
- * chunksizesp = <size_t *>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":3591
- * ndims = self.ndim
- * chunksizesp = <size_t *>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":3592
- * chunksizesp = <size_t *>malloc(sizeof(size_t) * ndims)
- * with nogil:
- * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3591
- * ndims = self.ndim
- * chunksizesp = <size_t *>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":3593
- * with nogil:
- * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * chunksizes=[]
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3594
- * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3594, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3594, __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_ERR(0, 3594, __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_ERR(0, 3594, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3593
- * with nogil:
- * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * chunksizes=[]
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3595
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3595, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_chunksizes = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3596
- * raise RuntimeError((<char *>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":3597
- * 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_ERR(0, 3597, __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_ERR(0, 3597, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3598
- * for n from 0 <= n < ndims:
- * chunksizes.append(chunksizesp[n])
- * free(chunksizesp) # <<<<<<<<<<<<<<
- * if icontiguous:
- * return 'contiguous'
- */
- free(__pyx_v_chunksizesp);
-
- /* "netCDF4/_netCDF4.pyx":3599
- * 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":3600
- * 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":3599
- * chunksizes.append(chunksizesp[n])
- * free(chunksizesp)
- * if icontiguous: # <<<<<<<<<<<<<<
- * return 'contiguous'
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3602
- * 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":3578
- * 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":3604
- * return chunksizes
- *
- * def get_var_chunk_cache(self): # <<<<<<<<<<<<<<
- * """
- * **`get_var_chunk_cache(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_33get_var_chunk_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_32get_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_33get_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_32get_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_32get_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;
- __Pyx_RefNannySetupContext("get_var_chunk_cache", 0);
-
- /* "netCDF4/_netCDF4.pyx":3614
- * 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":3615
- * 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":3614
- * 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":3617
- * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep,
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3618
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3618, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3618, __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_ERR(0, 3618, __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_ERR(0, 3618, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3617
- * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep,
- * &nelemsp, &preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * size = sizep; nelems = nelemsp; preemption = preemptionp
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3619
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3619, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_preemption = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3620
- * raise RuntimeError((<char *>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_ERR(0, 3620, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3620, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3620, __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":3604
- * 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":3622
- * 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_35set_var_chunk_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_34set_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_35set_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;
- 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_ERR(0, 3622, __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_ERR(0, 3622, __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_34set_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_34set_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;
- __Pyx_RefNannySetupContext("set_var_chunk_cache", 0);
-
- /* "netCDF4/_netCDF4.pyx":3633
- * 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_ERR(0, 3633, __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_ERR(0, 3633, __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_ERR(0, 3633, __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_ERR(0, 3633, __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_ERR(0, 3633, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3633, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3633, __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_ERR(0, 3633, __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_ERR(0, 3633, __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_ERR(0, 3633, __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":3634
- * # 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":3635
- * 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_ERR(0, 3635, __pyx_L1_error)
- __pyx_v_sizep = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":3634
- * # 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":3637
- * 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_ERR(0, 3637, __pyx_L1_error)
- __pyx_v_sizep = __pyx_t_9;
- }
- __pyx_L5:;
-
- /* "netCDF4/_netCDF4.pyx":3638
- * 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":3639
- * 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_ERR(0, 3639, __pyx_L1_error)
- __pyx_v_nelemsp = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":3638
- * else:
- * sizep = size_orig
- * if nelems is not None: # <<<<<<<<<<<<<<
- * nelemsp = nelems
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "netCDF4/_netCDF4.pyx":3641
- * 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_ERR(0, 3641, __pyx_L1_error)
- __pyx_v_nelemsp = __pyx_t_9;
- }
- __pyx_L6:;
-
- /* "netCDF4/_netCDF4.pyx":3642
- * 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":3643
- * 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_ERR(0, 3643, __pyx_L1_error)
- __pyx_v_preemptionp = __pyx_t_10;
-
- /* "netCDF4/_netCDF4.pyx":3642
- * else:
- * nelemsp = nelems_orig
- * if preemption is not None: # <<<<<<<<<<<<<<
- * preemptionp = preemption
- * else:
- */
- goto __pyx_L7;
- }
-
- /* "netCDF4/_netCDF4.pyx":3645
- * 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_ERR(0, 3645, __pyx_L1_error)
- __pyx_v_preemptionp = __pyx_t_10;
- }
- __pyx_L7:;
-
- /* "netCDF4/_netCDF4.pyx":3646
- * 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":3648
- * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep,
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":3649
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3649, __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_ERR(0, 3649, __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_ERR(0, 3649, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3648
- * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep,
- * nelemsp, preemptionp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3622
- * 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":3651
- * raise RuntimeError((<char *>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_37__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_37__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_36__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_36__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;
- __Pyx_RefNannySetupContext("__delattr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3653
- * 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_ERR(0, 3653, __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_ERR(0, 3653, __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":3654
- * # 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_ERR(0, 3654, __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_ERR(0, 3654, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3654, __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_ERR(0, 3654, __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":3653
- * 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":3656
- * 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":3657
- * 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_ERR(0, 3657, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3657, __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_ERR(0, 3657, __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_ERR(0, 3657, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3656
- * 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_ERR(0, 3656, __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_ERR(0, 3656, __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_ERR(0, 3656, __pyx_L1_error)
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":3651
- * raise RuntimeError((<char *>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":3659
- * "'%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_39__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_39__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_38__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_38__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;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- __Pyx_RefNannySetupContext("__setattr__", 0);
- __Pyx_INCREF(__pyx_v_value);
-
- /* "netCDF4/_netCDF4.pyx":3662
- * # 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 and byte order as variable.
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3662, __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_ERR(0, 3662, __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":3665
- * # if setting _FillValue or missing_value, make sure value
- * # has same type and byte order 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_ERR(0, 3665, __pyx_L1_error)
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3666
- * # has same type and byte order 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_ERR(0, 3666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_msg = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3668
- * 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_ERR(0, 3668, __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_ERR(0, 3668, __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_ERR(0, 3668, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3665
- * # if setting _FillValue or missing_value, make sure value
- * # has same type and byte order as variable.
- * if name == '_FillValue': # <<<<<<<<<<<<<<
- * msg='_FillValue attribute must be set when variable is '+\
- * 'created (using fill_value keyword to createVariable)'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3675
- * # "VLEN or compound variable"
- * # raise AttributeError(msg)
- * elif name in ['valid_min','valid_max','valid_range','missing_value'] and self._isprimitive: # <<<<<<<<<<<<<<
- * # make sure these attributes written in same data type as variable.
- * # also make sure it is written in native byte order
- */
- __Pyx_INCREF(__pyx_v_name);
- __pyx_t_4 = __pyx_v_name;
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_valid_min, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3675, __pyx_L1_error)
- if (!__pyx_t_5) {
- } else {
- __pyx_t_2 = __pyx_t_5;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_valid_max, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3675, __pyx_L1_error)
- if (!__pyx_t_5) {
- } else {
- __pyx_t_2 = __pyx_t_5;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_valid_range, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3675, __pyx_L1_error)
- if (!__pyx_t_5) {
- } else {
- __pyx_t_2 = __pyx_t_5;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_missing_value, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3675, __pyx_L1_error)
- __pyx_t_2 = __pyx_t_5;
- __pyx_L7_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = (__pyx_t_2 != 0);
- if (__pyx_t_5) {
- } else {
- __pyx_t_3 = __pyx_t_5;
- goto __pyx_L5_bool_binop_done;
- }
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3675, __pyx_L1_error)
- __pyx_t_3 = __pyx_t_5;
- __pyx_L5_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3679
- * # also make sure it is written in native byte order
- * # (the same as the data)
- * value = numpy.array(value, self.dtype) # <<<<<<<<<<<<<<
- * if not value.dtype.isnative: value.byteswap(True)
- * self.setncattr(name, value)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- __pyx_t_7 = 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_7 = 1;
- }
- }
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3679, __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_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_value);
- __Pyx_INCREF(__pyx_v_self->dtype);
- __Pyx_GIVEREF(__pyx_v_self->dtype);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_self->dtype);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3680
- * # (the same as the data)
- * value = numpy.array(value, self.dtype)
- * if not value.dtype.isnative: value.byteswap(True) # <<<<<<<<<<<<<<
- * self.setncattr(name, value)
- * elif not name.endswith('__'):
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnative); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_5 = ((!__pyx_t_3) != 0);
- if (__pyx_t_5) {
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3675
- * # "VLEN or compound variable"
- * # raise AttributeError(msg)
- * elif name in ['valid_min','valid_max','valid_range','missing_value'] and self._isprimitive: # <<<<<<<<<<<<<<
- * # make sure these attributes written in same data type as variable.
- * # also make sure it is written in native byte order
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3681
- * value = numpy.array(value, self.dtype)
- * if not value.dtype.isnative: value.byteswap(True)
- * self.setncattr(name, value) # <<<<<<<<<<<<<<
- * elif not name.endswith('__'):
- * if hasattr(self,name):
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setncattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3681, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = NULL;
- __pyx_t_7 = 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_7 = 1;
- }
- }
- __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3681, __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_name);
- __Pyx_GIVEREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_name);
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_value);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3681, __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;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3662
- * # 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 and byte order as variable.
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":3682
- * if not value.dtype.isnative: value.byteswap(True)
- * 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_ERR(0, 3682, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3682, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3682, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_3 = ((!__pyx_t_5) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3683
- * 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_3 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_v_name); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3683, __pyx_L1_error)
- __pyx_t_5 = (__pyx_t_3 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":3685
- * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_name);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_6, 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_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3684
- * 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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3684, __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 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3684, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 3684, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3683
- * 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":3687
- * "'%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_ERR(0, 3687, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 3687, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3682
- * if not value.dtype.isnative: value.byteswap(True)
- * self.setncattr(name, value)
- * elif not name.endswith('__'): # <<<<<<<<<<<<<<
- * if hasattr(self,name):
- * raise AttributeError(
- */
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":3659
- * "'%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_6);
- __Pyx_XDECREF(__pyx_t_8);
- __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":3689
- * 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_41__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_41__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_40__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_40__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;
- __Pyx_RefNannySetupContext("__getattr__", 0);
- __Pyx_INCREF(__pyx_v_name);
-
- /* "netCDF4/_netCDF4.pyx":3692
- * # 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_ERR(0, 3692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3692, __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_ERR(0, 3692, __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_ERR(0, 3692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3692, __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_ERR(0, 3692, __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":3694
- * 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_ERR(0, 3694, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3695
- * # 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_ERR(0, 3695, __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_ERR(0, 3695, __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_ERR(0, 3695, __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":3696
- * 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_ERR(0, 3696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_values = ((PyObject*)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3697
- * 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_ERR(0, 3697, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3697, __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_ERR(0, 3697, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __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_ERR(0, 3697, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __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_ERR(0, 3697, __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":3698
- * 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_ERR(0, 3698, __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_ERR(0, 3698, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3697
- * 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":3699
- * 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_ERR(0, 3699, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3699, __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_ERR(0, 3699, __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_ERR(0, 3699, __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_ERR(0, 3699, __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_ERR(0, 3699, __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_ERR(0, 3699, __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":3694
- * 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":3701
- * 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_ERR(0, 3701, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":3692
- * # 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":3702
- * 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_ERR(0, 3702, __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_ERR(0, 3702, __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":3703
- * 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_ERR(0, 3703, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3703, __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":3702
- * else:
- * raise AttributeError
- * elif name in _private_atts: # <<<<<<<<<<<<<<
- * return self.__dict__[name]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3705
- * 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_ERR(0, 3705, __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_ERR(0, 3705, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3705, __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_ERR(0, 3705, __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":3689
- * 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":3707
- * return self.getncattr(name)
- *
- * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<<
- * """
- * **`renameAttribute(self, oldname, newname)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_43renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_42renameAttribute[] = "\n**`renameAttribute(self, oldname, newname)`**\n\nrename a `netCDF4.Variable` attribute named `oldname` to `newname`.";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_43renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_oldname = 0;
- PyObject *__pyx_v_newname = 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_ERR(0, 3707, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameAttribute") < 0)) __PYX_ERR(0, 3707, __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_ERR(0, 3707, __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_42renameAttribute(((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_42renameAttribute(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;
- __Pyx_RefNannySetupContext("renameAttribute", 0);
-
- /* "netCDF4/_netCDF4.pyx":3715
- * 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_ERR(0, 3715, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3716
- * 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_ERR(0, 3716, __pyx_L1_error)
- __pyx_v_oldnamec = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":3717
- * 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_ERR(0, 3717, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3718
- * 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_ERR(0, 3718, __pyx_L1_error)
- __pyx_v_newnamec = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":3719
- * bytestr = _strencode(newname)
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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":3720
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":3721
- * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec)
- * if ierr != NC_NOERR:
- * raise AttributeError((<char *>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_ERR(0, 3721, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3721, __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_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3721, __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_ERR(0, 3721, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3720
- * newnamec = bytestr
- * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3707
- * 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":3723
- * raise AttributeError((<char *>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_45__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_45__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_44__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_44__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;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "netCDF4/_netCDF4.pyx":3729
- * # 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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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_ERR(0, 3729, __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":3730
- * # 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_ERR(0, 3730, __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_ERR(0, 3730, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3730, __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_ERR(0, 3730, __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":3731
- * 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_ERR(0, 3731, __pyx_L1_error)
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3732
- * 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_ERR(0, 3732, __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_ERR(0, 3732, __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_ERR(0, 3732, __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_ERR(0, 3732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) __PYX_ERR(0, 3732, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3732, __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":3731
- * 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":3734
- * 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_ERR(0, 3734, __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_ERR(0, 3734, __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_ERR(0, 3734, __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_ERR(0, 3734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) __PYX_ERR(0, 3734, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3734, __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":3740
- * # 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_ERR(0, 3740, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3740, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_slice__55);
- __Pyx_GIVEREF(__pyx_slice__55);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_slice__55);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3740, __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":3741
- * # 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_ERR(0, 3741, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__56, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3741, __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_ERR(0, 3741, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3741, __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_ERR(0, 3741, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3741, __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_ERR(0, 3741, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3741, __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_ERR(0, 3741, __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_ERR(0, 3741, __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":3742
- * 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_ERR(0, 3742, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3742, __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_ERR(0, 3742, __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)) __PYX_ERR(0, 3742, __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_ERR(0, 3742, __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_ERR(0, 3742, __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_ERR(0, 3742, __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)) __PYX_ERR(0, 3742, __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_ERR(0, 3742, __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_ERR(0, 3742, __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":3743
- * 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_ERR(0, 3743, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3742
- * 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":3741
- * # 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":3746
- *
- * # 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_ERR(0, 3746, __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_ERR(0, 3746, __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_ERR(0, 3746, __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_ERR(0, 3746, __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_ERR(0, 3746, __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_ERR(0, 3746, __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_ERR(0, 3746, __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":3747
- * # 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_ERR(0, 3747, __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_ERR(0, 3747, __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_ERR(0, 3747, __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_ERR(0, 3747, __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_ERR(0, 3747, __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_ERR(0, 3747, __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_ERR(0, 3747, __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":3748
- * 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_ERR(0, 3748, __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_ERR(0, 3748, __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_ERR(0, 3748, __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_ERR(0, 3748, __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_ERR(0, 3748, __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_ERR(0, 3748, __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_ERR(0, 3748, __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":3749
- * 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_ERR(0, 3749, __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_ERR(0, 3749, __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_ERR(0, 3749, __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_ERR(0, 3749, __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_ERR(0, 3749, __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_ERR(0, 3749, __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_ERR(0, 3749, __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":3752
- *
- * # 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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3752, __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_ERR(0, 3752, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3752, __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_ERR(0, 3752, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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_ERR(0, 3752, __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":3753
- * # 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_ERR(0, 3753, __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_ERR(0, 3753, __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_ERR(0, 3753, __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":3754
- * 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_ERR(0, 3754, __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_ERR(0, 3754, __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_ERR(0, 3754, __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_ERR(0, 3754, __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_ERR(0, 3754, __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":3755
- * 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":3754
- * 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":3757
- * 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_ERR(0, 3757, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyObject_GetItem(__pyx_v_data, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3757, __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_ERR(0, 3757, __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":3758
- * 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_ERR(0, 3758, __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_ERR(0, 3758, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 3758, __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":3760
- * 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_ERR(0, 3760, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3758
- * 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":3762
- * 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_ERR(0, 3762, __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_ERR(0, 3762, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3762, __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_ERR(0, 3762, __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_ERR(0, 3762, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (unlikely(PyObject_SetItem(__pyx_v_data, __pyx_t_7, __pyx_t_4) < 0)) __PYX_ERR(0, 3762, __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":3752
- *
- * # 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":3765
- *
- * # 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_ERR(0, 3765, __pyx_L1_error)
- __pyx_t_14 = (__pyx_t_9 != 0);
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":3766
- * # 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_ERR(0, 3766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3766, __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":3765
- *
- * # Remove extra singleton dimensions.
- * if hasattr(data,'shape'): # <<<<<<<<<<<<<<
- * data = data[tuple(squeeze)]
- * if hasattr(data,'ndim') and self.ndim == 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3767
- * 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_ERR(0, 3767, __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_ERR(0, 3767, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3767, __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":3770
- * # 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_ERR(0, 3770, __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_ERR(0, 3770, __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_ERR(0, 3770, __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_ERR(0, 3770, __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_ERR(0, 3770, __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)) __PYX_ERR(0, 3770, __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_ERR(0, 3770, __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_ERR(0, 3770, __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_ERR(0, 3770, __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":3767
- * 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":3780
- * # 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":3781
- * # 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_ERR(0, 3781, __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_ERR(0, 3781, __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_ERR(0, 3781, __pyx_L34_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3782
- * 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_ERR(0, 3782, __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_ERR(0, 3782, __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_ERR(0, 3782, __pyx_L34_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3783
- * 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":3780
- * # 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_PyThreadState_assign
- __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":3784
- * 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_ERR(0, 3784, __pyx_L36_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netCDF4/_netCDF4.pyx":3785
- * 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":3786
- * 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_ERR(0, 3786, __pyx_L36_except_error)
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":3787
- * 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":3788
- * 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_ERR(0, 3788, __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_ERR(0, 3788, __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_ERR(0, 3788, __pyx_L36_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3788, __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_ERR(0, 3788, __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":3786
- * 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":3780
- * # 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_PyThreadState_assign
- __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_PyThreadState_assign
- __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":3789
- * 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_ERR(0, 3789, __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_ERR(0, 3789, __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_ERR(0, 3789, __pyx_L1_error)
- __pyx_t_14 = __pyx_t_11;
- __pyx_L48_bool_binop_done:;
- if (__pyx_t_14) {
-
- /* "netCDF4/_netCDF4.pyx":3790
- * 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_ERR(0, 3790, __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_ERR(0, 3790, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3790, __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_ERR(0, 3790, __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":3789
- * 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":3791
- * 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_ERR(0, 3791, __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_ERR(0, 3791, __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":3793
- * 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_ERR(0, 3793, __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_ERR(0, 3793, __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":3794
- * # 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_ERR(0, 3794, __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_ERR(0, 3794, __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_ERR(0, 3794, __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_ERR(0, 3794, __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_ERR(0, 3794, __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_ERR(0, 3794, __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":3793
- * 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":3795
- * 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_ERR(0, 3795, __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_ERR(0, 3795, __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_ERR(0, 3795, __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_ERR(0, 3795, __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":3793
- * 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":3797
- * 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_ERR(0, 3797, __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_ERR(0, 3797, __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_ERR(0, 3797, __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_ERR(0, 3797, __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":3798
- * # 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_ERR(0, 3798, __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_ERR(0, 3798, __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":3797
- * 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":3800
- * 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_ERR(0, 3800, __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_ERR(0, 3800, __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_ERR(0, 3800, __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_ERR(0, 3800, __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":3801
- * # 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_ERR(0, 3801, __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_ERR(0, 3801, __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":3800
- * 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":3791
- * 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":3802
- * 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":3723
- * raise AttributeError((<char *>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":3804
- * 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_47_toma(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_47_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_46_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_46_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_mvalmask = NULL;
- PyObject *__pyx_v_validmin = NULL;
- PyObject *__pyx_v_validmax = NULL;
- int __pyx_v_byte_type;
- PyObject *__pyx_v_fval = NULL;
- PyObject *__pyx_v_m = NULL;
- PyObject *__pyx_v_mvalisnan = NULL;
- PyObject *__pyx_v_fvalisnan = NULL;
- PyObject *__pyx_v_mask = 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;
- int __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- PyObject *__pyx_t_12 = NULL;
- PyObject *__pyx_t_13 = NULL;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_t_15;
- char *__pyx_t_16;
- __Pyx_RefNannySetupContext("_toma", 0);
- __Pyx_INCREF(__pyx_v_data);
-
- /* "netCDF4/_netCDF4.pyx":3808
- * # 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_ERR(0, 3808, __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_ERR(0, 3808, __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_ERR(0, 3808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3808, __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_ERR(0, 3808, __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_ERR(0, 3808, __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_ERR(0, 3808, __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":3809
- * # 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":3810
- * totalmask = numpy.zeros(data.shape, numpy.bool)
- * fill_value = None
- * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<<
- * mval = numpy.array(self.missing_value, self.dtype)
- * # create mask from missing values.
- */
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 3810, __pyx_L1_error)
- __pyx_t_9 = (__pyx_t_8 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3811
- * fill_value = None
- * if hasattr(self, 'missing_value'):
- * mval = numpy.array(self.missing_value, self.dtype) # <<<<<<<<<<<<<<
- * # create mask from missing values.
- * mvalmask = numpy.zeros(data.shape, numpy.bool)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3811, __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_ERR(0, 3811, __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_ERR(0, 3811, __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_ERR(0, 3811, __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_ERR(0, 3811, __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":3813
- * mval = numpy.array(self.missing_value, self.dtype)
- * # create mask from missing values.
- * mvalmask = numpy.zeros(data.shape, numpy.bool) # <<<<<<<<<<<<<<
- * # set mask=True for data outside valid_min,valid_max.
- * # (issue #576)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __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_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3813, __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_7);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5);
- __pyx_t_7 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3813, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_mvalmask = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3816
- * # set mask=True for data outside valid_min,valid_max.
- * # (issue #576)
- * validmin = None; validmax = None # <<<<<<<<<<<<<<
- * # if valid_range exists use that, otherwise
- * # look for valid_min, valid_max. No special
- */
- __Pyx_INCREF(Py_None);
- __pyx_v_validmin = Py_None;
- __Pyx_INCREF(Py_None);
- __pyx_v_validmax = Py_None;
-
- /* "netCDF4/_netCDF4.pyx":3821
- * # treatment of byte data as described at
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- * if hasattr(self, 'valid_range') and len(self.valid_range) == 2: # <<<<<<<<<<<<<<
- * validmin = numpy.array(self.valid_range[0], self.dtype)
- * validmax = numpy.array(self.valid_range[1], self.dtype)
- */
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_range); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 3821, __pyx_L1_error)
- __pyx_t_10 = (__pyx_t_8 != 0);
- if (__pyx_t_10) {
- } else {
- __pyx_t_9 = __pyx_t_10;
- goto __pyx_L5_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3821, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 3821, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_10 = ((__pyx_t_6 == 2) != 0);
- __pyx_t_9 = __pyx_t_10;
- __pyx_L5_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3822
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- * if hasattr(self, 'valid_range') and len(self.valid_range) == 2:
- * validmin = numpy.array(self.valid_range[0], self.dtype) # <<<<<<<<<<<<<<
- * validmax = numpy.array(self.valid_range[1], self.dtype)
- * else:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3822, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3822, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3822, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3822, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_2);
- __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_ERR(0, 3822, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
- __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_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3822, __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_SET(__pyx_v_validmin, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3823
- * if hasattr(self, 'valid_range') and len(self.valid_range) == 2:
- * validmin = numpy.array(self.valid_range[0], self.dtype)
- * validmax = numpy.array(self.valid_range[1], self.dtype) # <<<<<<<<<<<<<<
- * else:
- * if hasattr(self, 'valid_min'):
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3823, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3823, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3823, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3823, __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_7))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_4);
- __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_ERR(0, 3823, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_t_5);
- __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_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3823, __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_DECREF_SET(__pyx_v_validmax, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3821
- * # treatment of byte data as described at
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- * if hasattr(self, 'valid_range') and len(self.valid_range) == 2: # <<<<<<<<<<<<<<
- * validmin = numpy.array(self.valid_range[0], self.dtype)
- * validmax = numpy.array(self.valid_range[1], self.dtype)
- */
- goto __pyx_L4;
- }
-
- /* "netCDF4/_netCDF4.pyx":3825
- * validmax = numpy.array(self.valid_range[1], self.dtype)
- * else:
- * if hasattr(self, 'valid_min'): # <<<<<<<<<<<<<<
- * validmin = numpy.array(self.valid_min, self.dtype)
- * if hasattr(self, 'valid_max'):
- */
- /*else*/ {
- __pyx_t_9 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_min); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3825, __pyx_L1_error)
- __pyx_t_10 = (__pyx_t_9 != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3826
- * else:
- * if hasattr(self, 'valid_min'):
- * validmin = numpy.array(self.valid_min, self.dtype) # <<<<<<<<<<<<<<
- * if hasattr(self, 'valid_max'):
- * validmax = numpy.array(self.valid_max, self.dtype)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- 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);
- __pyx_t_6 = 1;
- }
- }
- __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (__pyx_t_5) {
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_7);
- __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_7 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_validmin, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3825
- * validmax = numpy.array(self.valid_range[1], self.dtype)
- * else:
- * if hasattr(self, 'valid_min'): # <<<<<<<<<<<<<<
- * validmin = numpy.array(self.valid_min, self.dtype)
- * if hasattr(self, 'valid_max'):
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3827
- * if hasattr(self, 'valid_min'):
- * validmin = numpy.array(self.valid_min, self.dtype)
- * if hasattr(self, 'valid_max'): # <<<<<<<<<<<<<<
- * validmax = numpy.array(self.valid_max, self.dtype)
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- */
- __pyx_t_10 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_max); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 3827, __pyx_L1_error)
- __pyx_t_9 = (__pyx_t_10 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3828
- * validmin = numpy.array(self.valid_min, self.dtype)
- * if hasattr(self, 'valid_max'):
- * validmax = numpy.array(self.valid_max, self.dtype) # <<<<<<<<<<<<<<
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- * # "If the data type is byte and _FillValue
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = NULL;
- __pyx_t_6 = 0;
- 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);
- __pyx_t_6 = 1;
- }
- }
- __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_7) {
- __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+__pyx_t_6, __pyx_t_2);
- __Pyx_INCREF(__pyx_v_self->dtype);
- __Pyx_GIVEREF(__pyx_v_self->dtype);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_self->dtype);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3828, __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_validmax, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3827
- * if hasattr(self, 'valid_min'):
- * validmin = numpy.array(self.valid_min, self.dtype)
- * if hasattr(self, 'valid_max'): # <<<<<<<<<<<<<<
- * validmax = numpy.array(self.valid_max, self.dtype)
- * # http://www.unidata.ucar.edu/software/netcdf/docs/attribute_conventions.html).
- */
- }
- }
- __pyx_L4:;
-
- /* "netCDF4/_netCDF4.pyx":3837
- * # If the _FillValue is positive then it defines a valid maximum,
- * # otherwise it defines a valid minimum."
- * byte_type = self.dtype.str[1:] in ['u1','i1'] # <<<<<<<<<<<<<<
- * if hasattr(self, '_FillValue'):
- * fval = numpy.array(self._FillValue, self.dtype)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3837, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__57, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3837, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_u1, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3837, __pyx_L1_error)
- if (!__pyx_t_10) {
- } else {
- __pyx_t_9 = __pyx_t_10;
- goto __pyx_L9_bool_binop_done;
- }
- __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_i1, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3837, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_10;
- __pyx_L9_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_byte_type = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":3838
- * # otherwise it defines a valid minimum."
- * byte_type = self.dtype.str[1:] in ['u1','i1']
- * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fval = numpy.array(self._FillValue, self.dtype)
- * else:
- */
- __pyx_t_9 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3838, __pyx_L1_error)
- __pyx_t_10 = (__pyx_t_9 != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3839
- * byte_type = self.dtype.str[1:] in ['u1','i1']
- * if hasattr(self, '_FillValue'):
- * fval = numpy.array(self._FillValue, self.dtype) # <<<<<<<<<<<<<<
- * else:
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3839, __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_ERR(0, 3839, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __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_ERR(0, 3839, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
- __pyx_t_6 = 1;
- }
- }
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3839, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_1);
- __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_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3839, __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_v_fval = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3838
- * # otherwise it defines a valid minimum."
- * byte_type = self.dtype.str[1:] in ['u1','i1']
- * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fval = numpy.array(self._FillValue, self.dtype)
- * else:
- */
- goto __pyx_L11;
- }
-
- /* "netCDF4/_netCDF4.pyx":3841
- * fval = numpy.array(self._FillValue, self.dtype)
- * else:
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype) # <<<<<<<<<<<<<<
- * if byte_type: fval = None
- * if validmin is None and (fval is not None and fval <= 0):
- */
- /*else*/ {
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3841, __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_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__58, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3841, __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_t_2 = NULL;
- __pyx_t_6 = 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_6 = 1;
- }
- }
- __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3841, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_self->dtype);
- __Pyx_GIVEREF(__pyx_v_self->dtype);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_self->dtype);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_fval = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3842
- * else:
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
- * if byte_type: fval = None # <<<<<<<<<<<<<<
- * if validmin is None and (fval is not None and fval <= 0):
- * validmin = fval
- */
- __pyx_t_10 = (__pyx_v_byte_type != 0);
- if (__pyx_t_10) {
- __Pyx_INCREF(Py_None);
- __Pyx_DECREF_SET(__pyx_v_fval, Py_None);
- }
- }
- __pyx_L11:;
-
- /* "netCDF4/_netCDF4.pyx":3843
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
- * if byte_type: fval = None
- * if validmin is None and (fval is not None and fval <= 0): # <<<<<<<<<<<<<<
- * validmin = fval
- * elif validmax is None and (fval is not None and fval > 0):
- */
- __pyx_t_9 = (__pyx_v_validmin == Py_None);
- __pyx_t_8 = (__pyx_t_9 != 0);
- if (__pyx_t_8) {
- } else {
- __pyx_t_10 = __pyx_t_8;
- goto __pyx_L14_bool_binop_done;
- }
- __pyx_t_8 = (__pyx_v_fval != Py_None);
- __pyx_t_9 = (__pyx_t_8 != 0);
- if (__pyx_t_9) {
- } else {
- __pyx_t_10 = __pyx_t_9;
- goto __pyx_L14_bool_binop_done;
- }
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_fval, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3843, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 3843, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_10 = __pyx_t_9;
- __pyx_L14_bool_binop_done:;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3844
- * if byte_type: fval = None
- * if validmin is None and (fval is not None and fval <= 0):
- * validmin = fval # <<<<<<<<<<<<<<
- * elif validmax is None and (fval is not None and fval > 0):
- * validmax = fval
- */
- __Pyx_INCREF(__pyx_v_fval);
- __Pyx_DECREF_SET(__pyx_v_validmin, __pyx_v_fval);
-
- /* "netCDF4/_netCDF4.pyx":3843
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
- * if byte_type: fval = None
- * if validmin is None and (fval is not None and fval <= 0): # <<<<<<<<<<<<<<
- * validmin = fval
- * elif validmax is None and (fval is not None and fval > 0):
- */
- goto __pyx_L13;
- }
-
- /* "netCDF4/_netCDF4.pyx":3845
- * if validmin is None and (fval is not None and fval <= 0):
- * validmin = fval
- * elif validmax is None and (fval is not None and fval > 0): # <<<<<<<<<<<<<<
- * validmax = fval
- * if validmin is not None:
- */
- __pyx_t_9 = (__pyx_v_validmax == Py_None);
- __pyx_t_8 = (__pyx_t_9 != 0);
- if (__pyx_t_8) {
- } else {
- __pyx_t_10 = __pyx_t_8;
- goto __pyx_L17_bool_binop_done;
- }
- __pyx_t_8 = (__pyx_v_fval != Py_None);
- __pyx_t_9 = (__pyx_t_8 != 0);
- if (__pyx_t_9) {
- } else {
- __pyx_t_10 = __pyx_t_9;
- goto __pyx_L17_bool_binop_done;
- }
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_fval, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3845, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 3845, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_10 = __pyx_t_9;
- __pyx_L17_bool_binop_done:;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3846
- * validmin = fval
- * elif validmax is None and (fval is not None and fval > 0):
- * validmax = fval # <<<<<<<<<<<<<<
- * if validmin is not None:
- * mvalmask += data < validmin
- */
- __Pyx_INCREF(__pyx_v_fval);
- __Pyx_DECREF_SET(__pyx_v_validmax, __pyx_v_fval);
-
- /* "netCDF4/_netCDF4.pyx":3845
- * if validmin is None and (fval is not None and fval <= 0):
- * validmin = fval
- * elif validmax is None and (fval is not None and fval > 0): # <<<<<<<<<<<<<<
- * validmax = fval
- * if validmin is not None:
- */
- }
- __pyx_L13:;
-
- /* "netCDF4/_netCDF4.pyx":3847
- * elif validmax is None and (fval is not None and fval > 0):
- * validmax = fval
- * if validmin is not None: # <<<<<<<<<<<<<<
- * mvalmask += data < validmin
- * if validmax is not None:
- */
- __pyx_t_10 = (__pyx_v_validmin != Py_None);
- __pyx_t_9 = (__pyx_t_10 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3848
- * validmax = fval
- * if validmin is not None:
- * mvalmask += data < validmin # <<<<<<<<<<<<<<
- * if validmax is not None:
- * mvalmask += data > validmax
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_data, __pyx_v_validmin, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3848, __pyx_L1_error)
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_mvalmask, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3848, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_mvalmask, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3847
- * elif validmax is None and (fval is not None and fval > 0):
- * validmax = fval
- * if validmin is not None: # <<<<<<<<<<<<<<
- * mvalmask += data < validmin
- * if validmax is not None:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3849
- * if validmin is not None:
- * mvalmask += data < validmin
- * if validmax is not None: # <<<<<<<<<<<<<<
- * mvalmask += data > validmax
- * if mval.shape == (): # mval a scalar.
- */
- __pyx_t_9 = (__pyx_v_validmax != Py_None);
- __pyx_t_10 = (__pyx_t_9 != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3850
- * mvalmask += data < validmin
- * if validmax is not None:
- * mvalmask += data > validmax # <<<<<<<<<<<<<<
- * if mval.shape == (): # mval a scalar.
- * mval = [mval] # make into iterable.
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_data, __pyx_v_validmax, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3850, __pyx_L1_error)
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_mvalmask, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3850, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_mvalmask, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3849
- * if validmin is not None:
- * mvalmask += data < validmin
- * if validmax is not None: # <<<<<<<<<<<<<<
- * mvalmask += data > validmax
- * if mval.shape == (): # mval a scalar.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3851
- * if validmax is not None:
- * mvalmask += data > validmax
- * if mval.shape == (): # mval a scalar. # <<<<<<<<<<<<<<
- * mval = [mval] # make into iterable.
- * for m in mval:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mval, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3851, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3851, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3851, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3852
- * mvalmask += data > validmax
- * if mval.shape == (): # mval a scalar.
- * mval = [mval] # make into iterable. # <<<<<<<<<<<<<<
- * for m in mval:
- * # is scalar missing value a NaN?
- */
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_mval);
- __Pyx_GIVEREF(__pyx_v_mval);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_mval);
- __Pyx_DECREF_SET(__pyx_v_mval, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3851
- * if validmax is not None:
- * mvalmask += data > validmax
- * if mval.shape == (): # mval a scalar. # <<<<<<<<<<<<<<
- * mval = [mval] # make into iterable.
- * for m in mval:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3853
- * if mval.shape == (): # mval a scalar.
- * mval = [mval] # make into iterable.
- * for m in mval: # <<<<<<<<<<<<<<
- * # is scalar missing value a NaN?
- * try:
- */
- if (likely(PyList_CheckExact(__pyx_v_mval)) || PyTuple_CheckExact(__pyx_v_mval)) {
- __pyx_t_7 = __pyx_v_mval; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_mval); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3853, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3853, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3853, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_11(__pyx_t_7);
- 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_ERR(0, 3853, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3855
- * for m in mval:
- * # is scalar missing value a NaN?
- * try: # <<<<<<<<<<<<<<
- * mvalisnan = numpy.isnan(m)
- * except TypeError: # isnan fails on some dtypes (issue 206)
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":3856
- * # is scalar missing value a NaN?
- * try:
- * mvalisnan = numpy.isnan(m) # <<<<<<<<<<<<<<
- * except TypeError: # isnan fails on some dtypes (issue 206)
- * mvalisnan = False
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3856, __pyx_L25_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3856, __pyx_L25_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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3856, __pyx_L25_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3856, __pyx_L25_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_m);
- __Pyx_GIVEREF(__pyx_v_m);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_m);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3856, __pyx_L25_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_XDECREF_SET(__pyx_v_mvalisnan, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3855
- * for m in mval:
- * # is scalar missing value a NaN?
- * try: # <<<<<<<<<<<<<<
- * mvalisnan = numpy.isnan(m)
- * except TypeError: # isnan fails on some dtypes (issue 206)
- */
- }
- __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_L32_try_end;
- __pyx_L25_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3857
- * try:
- * mvalisnan = numpy.isnan(m)
- * except TypeError: # isnan fails on some dtypes (issue 206) # <<<<<<<<<<<<<<
- * mvalisnan = False
- * if mvalisnan:
- */
- __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_15) {
- __Pyx_AddTraceback("netCDF4._netCDF4.Variable._toma", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 3857, __pyx_L27_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netCDF4/_netCDF4.pyx":3858
- * mvalisnan = numpy.isnan(m)
- * except TypeError: # isnan fails on some dtypes (issue 206)
- * mvalisnan = False # <<<<<<<<<<<<<<
- * if mvalisnan:
- * mvalmask += numpy.isnan(data)
- */
- __Pyx_INCREF(Py_False);
- __Pyx_XDECREF_SET(__pyx_v_mvalisnan, Py_False);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L26_exception_handled;
- }
- goto __pyx_L27_except_error;
- __pyx_L27_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":3855
- * for m in mval:
- * # is scalar missing value a NaN?
- * try: # <<<<<<<<<<<<<<
- * mvalisnan = numpy.isnan(m)
- * except TypeError: # isnan fails on some dtypes (issue 206)
- */
- __Pyx_PyThreadState_assign
- __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_L26_exception_handled:;
- __Pyx_PyThreadState_assign
- __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_L32_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":3859
- * except TypeError: # isnan fails on some dtypes (issue 206)
- * mvalisnan = False
- * if mvalisnan: # <<<<<<<<<<<<<<
- * mvalmask += numpy.isnan(data)
- * else:
- */
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_mvalisnan); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3859, __pyx_L1_error)
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3860
- * mvalisnan = False
- * if mvalisnan:
- * mvalmask += numpy.isnan(data) # <<<<<<<<<<<<<<
- * else:
- * mvalmask += data==m
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_mvalmask, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_mvalmask, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3859
- * except TypeError: # isnan fails on some dtypes (issue 206)
- * mvalisnan = False
- * if mvalisnan: # <<<<<<<<<<<<<<
- * mvalmask += numpy.isnan(data)
- * else:
- */
- goto __pyx_L35;
- }
-
- /* "netCDF4/_netCDF4.pyx":3862
- * mvalmask += numpy.isnan(data)
- * else:
- * mvalmask += data==m # <<<<<<<<<<<<<<
- * if mvalmask.any():
- * # set fill_value for masked array
- */
- /*else*/ {
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_data, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3862, __pyx_L1_error)
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_mvalmask, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_mvalmask, __pyx_t_2);
- __pyx_t_2 = 0;
- }
- __pyx_L35:;
-
- /* "netCDF4/_netCDF4.pyx":3853
- * if mval.shape == (): # mval a scalar.
- * mval = [mval] # make into iterable.
- * for m in mval: # <<<<<<<<<<<<<<
- * # is scalar missing value a NaN?
- * try:
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3863
- * else:
- * mvalmask += data==m
- * if mvalmask.any(): # <<<<<<<<<<<<<<
- * # set fill_value for masked array
- * # to missing_value (or 1st element
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvalmask, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3863, __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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3863, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3863, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3863, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3867
- * # to missing_value (or 1st element
- * # if missing_value is a vector).
- * fill_value = mval[0] # <<<<<<<<<<<<<<
- * totalmask += mvalmask
- * # set mask=True for missing data
- */
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mval, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3867, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_fill_value, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3868
- * # if missing_value is a vector).
- * fill_value = mval[0]
- * totalmask += mvalmask # <<<<<<<<<<<<<<
- * # set mask=True for missing data
- * if hasattr(self, '_FillValue'):
- */
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mvalmask); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3868, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3863
- * else:
- * mvalmask += data==m
- * if mvalmask.any(): # <<<<<<<<<<<<<<
- * # set fill_value for masked array
- * # to missing_value (or 1st element
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3810
- * totalmask = numpy.zeros(data.shape, numpy.bool)
- * fill_value = None
- * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<<
- * mval = numpy.array(self.missing_value, self.dtype)
- * # create mask from missing values.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3870
- * totalmask += mvalmask
- * # set mask=True for missing data
- * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fval = numpy.array(self._FillValue, self.dtype)
- * # is _FillValue a NaN?
- */
- __pyx_t_10 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 3870, __pyx_L1_error)
- __pyx_t_9 = (__pyx_t_10 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3871
- * # set mask=True for missing data
- * if hasattr(self, '_FillValue'):
- * fval = numpy.array(self._FillValue, self.dtype) # <<<<<<<<<<<<<<
- * # is _FillValue a NaN?
- * try:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3871, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3871, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3871, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- 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);
- __pyx_t_6 = 1;
- }
- }
- __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3871, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (__pyx_t_5) {
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_t_2);
- __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_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3871, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_fval, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3873
- * fval = numpy.array(self._FillValue, self.dtype)
- * # is _FillValue a NaN?
- * try: # <<<<<<<<<<<<<<
- * fvalisnan = numpy.isnan(fval)
- * except: # isnan fails on some dtypes (issue 202)
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
- __Pyx_XGOTREF(__pyx_t_14);
- __Pyx_XGOTREF(__pyx_t_13);
- __Pyx_XGOTREF(__pyx_t_12);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":3874
- * # is _FillValue a NaN?
- * try:
- * fvalisnan = numpy.isnan(fval) # <<<<<<<<<<<<<<
- * except: # isnan fails on some dtypes (issue 202)
- * fvalisnan = False
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3874, __pyx_L38_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3874, __pyx_L38_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- 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);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_fval); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3874, __pyx_L38_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3874, __pyx_L38_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_fval);
- __Pyx_GIVEREF(__pyx_v_fval);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_fval);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3874, __pyx_L38_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_fvalisnan = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3873
- * fval = numpy.array(self._FillValue, self.dtype)
- * # is _FillValue a NaN?
- * try: # <<<<<<<<<<<<<<
- * fvalisnan = numpy.isnan(fval)
- * except: # isnan fails on some dtypes (issue 202)
- */
- }
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- goto __pyx_L45_try_end;
- __pyx_L38_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3875
- * 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_7, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 3875, __pyx_L40_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netCDF4/_netCDF4.pyx":3876
- * 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_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L39_exception_handled;
- }
- __pyx_L40_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":3873
- * fval = numpy.array(self._FillValue, self.dtype)
- * # is _FillValue a NaN?
- * try: # <<<<<<<<<<<<<<
- * fvalisnan = numpy.isnan(fval)
- * except: # isnan fails on some dtypes (issue 202)
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_14);
- __Pyx_XGIVEREF(__pyx_t_13);
- __Pyx_XGIVEREF(__pyx_t_12);
- __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
- goto __pyx_L1_error;
- __pyx_L39_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_14);
- __Pyx_XGIVEREF(__pyx_t_13);
- __Pyx_XGIVEREF(__pyx_t_12);
- __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
- __pyx_L45_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":3877
- * 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_ERR(0, 3877, __pyx_L1_error)
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3878
- * fvalisnan = False
- * if fvalisnan:
- * mask = numpy.isnan(data) # <<<<<<<<<<<<<<
- * elif (data == fval).any():
- * mask = data==fval
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3878, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isnan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3878, __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_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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3878, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3878, __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_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3878, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_mask = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3877
- * except: # isnan fails on some dtypes (issue 202)
- * fvalisnan = False
- * if fvalisnan: # <<<<<<<<<<<<<<
- * mask = numpy.isnan(data)
- * elif (data == fval).any():
- */
- goto __pyx_L48;
- }
-
- /* "netCDF4/_netCDF4.pyx":3879
- * if fvalisnan:
- * mask = numpy.isnan(data)
- * elif (data == fval).any(): # <<<<<<<<<<<<<<
- * mask = data==fval
- * else:
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3879, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3879, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3879, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3879, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 3879, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3880
- * mask = numpy.isnan(data)
- * elif (data == fval).any():
- * mask = data==fval # <<<<<<<<<<<<<<
- * else:
- * mask = None
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3880, __pyx_L1_error)
- __pyx_v_mask = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3879
- * if fvalisnan:
- * mask = numpy.isnan(data)
- * elif (data == fval).any(): # <<<<<<<<<<<<<<
- * mask = data==fval
- * else:
- */
- goto __pyx_L48;
- }
-
- /* "netCDF4/_netCDF4.pyx":3882
- * mask = data==fval
- * else:
- * mask = None # <<<<<<<<<<<<<<
- * if mask is not None:
- * if fill_value is None:
- */
- /*else*/ {
- __Pyx_INCREF(Py_None);
- __pyx_v_mask = Py_None;
- }
- __pyx_L48:;
-
- /* "netCDF4/_netCDF4.pyx":3883
- * 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_10 = (__pyx_t_9 != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":3884
- * mask = None
- * if mask is not None:
- * if fill_value is None: # <<<<<<<<<<<<<<
- * fill_value = fval
- * totalmask += mask
- */
- __pyx_t_10 = (__pyx_v_fill_value == Py_None);
- __pyx_t_9 = (__pyx_t_10 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3885
- * 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":3884
- * mask = None
- * if mask is not None:
- * if fill_value is None: # <<<<<<<<<<<<<<
- * fill_value = fval
- * totalmask += mask
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3886
- * if fill_value is None:
- * fill_value = fval
- * totalmask += mask # <<<<<<<<<<<<<<
- * # issue 209: don't return masked array if variable filling
- * # is disabled.
- */
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3886, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3883
- * else:
- * mask = None
- * if mask is not None: # <<<<<<<<<<<<<<
- * if fill_value is None:
- * fill_value = fval
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3870
- * totalmask += mvalmask
- * # set mask=True for missing data
- * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fval = numpy.array(self._FillValue, self.dtype)
- * # is _FillValue a NaN?
- */
- goto __pyx_L37;
- }
-
- /* "netCDF4/_netCDF4.pyx":3890
- * # 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":3891
- * else:
- * with nogil:
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":3890
- * # 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_L53;
- }
- __pyx_L53:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":3892
- * with nogil:
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":3893
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_16 = ((char *)nc_strerror(__pyx_v_ierr));
- __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_16, 0, strlen(__pyx_t_16), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3893, __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_ERR(0, 3893, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3892
- * with nogil:
- * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # if no_fill is not 1, and not a byte variable, then use default fill value.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3906
- * # 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)
- * has_fillval = data == fillval
- */
- __pyx_t_10 = ((__pyx_v_no_fill != 1) != 0);
- if (__pyx_t_10) {
- } else {
- __pyx_t_9 = __pyx_t_10;
- goto __pyx_L56_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3906, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__59, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3906, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_u1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3906, __pyx_L1_error)
- if (__pyx_t_8) {
- } else {
- __pyx_t_10 = __pyx_t_8;
- goto __pyx_L58_bool_binop_done;
- }
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_i1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3906, __pyx_L1_error)
- __pyx_t_10 = __pyx_t_8;
- __pyx_L58_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = (__pyx_t_10 != 0);
- __pyx_t_9 = __pyx_t_8;
- __pyx_L56_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3907
- * # 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) # <<<<<<<<<<<<<<
- * has_fillval = data == fillval
- * # if data is an array scalar, has_fillval will be a boolean.
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__60, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3907, __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_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_ERR(0, 3907, __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_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_t_1);
- __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_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3907, __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_v_fillval = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3908
- * if no_fill != 1 and self.dtype.str[1:] not in ['u1','i1']:
- * fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
- * 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_4 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fillval, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3908, __pyx_L1_error)
- __pyx_v_has_fillval = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3911
- * # 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_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_has_fillval)), ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3911, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 3911, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3911, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3911, __pyx_L1_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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_has_fillval); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3911, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __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_has_fillval);
- __Pyx_GIVEREF(__pyx_v_has_fillval);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_has_fillval);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3911, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_has_fillval, __pyx_t_4);
- __pyx_t_4 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3912
- * # 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_has_fillval, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3912, __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3912, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3912, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 3912, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3913
- * 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_4 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fillval, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3913, __pyx_L1_error)
- __pyx_v_mask = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3914
- * 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_8 = (__pyx_t_9 != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":3915
- * 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":3914
- * if has_fillval.any():
- * mask=data==fillval
- * if fill_value is None: # <<<<<<<<<<<<<<
- * fill_value = fillval
- * totalmask += mask
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3916
- * 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_4 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3916, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3912
- * # 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":3906
- * # 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)
- * has_fillval = data == fillval
- */
- }
- }
- __pyx_L37:;
-
- /* "netCDF4/_netCDF4.pyx":3920
- * # 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)
- * # issue 515 scalar array with mask=True should be converted
- */
- __pyx_t_8 = (__pyx_v_fill_value != Py_None);
- __pyx_t_9 = (__pyx_t_8 != 0);
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3921
- * # otherwise _FillValue.
- * if fill_value is not None:
- * data = ma.masked_array(data,mask=totalmask,fill_value=fill_value) # <<<<<<<<<<<<<<
- * # issue 515 scalar array with mask=True should be converted
- * # to numpy.ma.MaskedConstant to be consistent with slicing
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3921, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_masked_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3921, __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_ERR(0, 3921, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3921, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mask, __pyx_v_totalmask) < 0) __PYX_ERR(0, 3921, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) __PYX_ERR(0, 3921, __pyx_L1_error)
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3921, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __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;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3925
- * # to numpy.ma.MaskedConstant to be consistent with slicing
- * # behavior of masked arrays.
- * if data.shape == () and data.mask.all(): # <<<<<<<<<<<<<<
- * data = data[...]
- * return data
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3925, __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_ERR(0, 3925, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3925, __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_L65_bool_binop_done;
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_mask); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3925, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_all); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3925, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3925, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3925, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3925, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_9 = __pyx_t_8;
- __pyx_L65_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":3926
- * # behavior of masked arrays.
- * if data.shape == () and data.mask.all():
- * data = data[...] # <<<<<<<<<<<<<<
- * return data
- *
- */
- __pyx_t_1 = PyObject_GetItem(__pyx_v_data, Py_Ellipsis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3926, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3925
- * # to numpy.ma.MaskedConstant to be consistent with slicing
- * # behavior of masked arrays.
- * if data.shape == () and data.mask.all(): # <<<<<<<<<<<<<<
- * data = data[...]
- * return data
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3920
- * # 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)
- * # issue 515 scalar array with mask=True should be converted
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3927
- * if data.shape == () and data.mask.all():
- * data = data[...]
- * 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":3804
- * 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_mvalmask);
- __Pyx_XDECREF(__pyx_v_validmin);
- __Pyx_XDECREF(__pyx_v_validmax);
- __Pyx_XDECREF(__pyx_v_fval);
- __Pyx_XDECREF(__pyx_v_m);
- __Pyx_XDECREF(__pyx_v_mvalisnan);
- __Pyx_XDECREF(__pyx_v_fvalisnan);
- __Pyx_XDECREF(__pyx_v_mask);
- __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":3929
- * 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_49_assign_vlen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_48_assign_vlen[] = "private method to assign data to a single item in a VLEN variable";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_49_assign_vlen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_elem = 0;
- PyObject *__pyx_v_data = 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_ERR(0, 3929, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_assign_vlen") < 0)) __PYX_ERR(0, 3929, __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_ERR(0, 3929, __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_48_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_48_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;
- __Pyx_RefNannySetupContext("_assign_vlen", 0);
- __Pyx_INCREF(__pyx_v_elem);
-
- /* "netCDF4/_netCDF4.pyx":3937
- * 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_ERR(0, 3937, __pyx_L1_error)
- __pyx_t_2 = ((!__pyx_t_1) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3938
- * cdef ndarray data2
- * if not self._isvlen:
- * raise TypeError('_assign_vlen method only for use with VLEN variables') # <<<<<<<<<<<<<<
- * ndims = self.ndim
- * msg="data can only be assigned to VLEN variables using integer indices"
- */
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3938, __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_ERR(0, 3938, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3937
- * 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":3939
- * if not self._isvlen:
- * raise TypeError('_assign_vlen method only for use with VLEN variables')
- * ndims = self.ndim # <<<<<<<<<<<<<<
- * msg="data can only be assigned to VLEN variables using integer indices"
- * # 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_ERR(0, 3939, __pyx_L1_error)
- __pyx_v_ndims = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":3940
- * raise TypeError('_assign_vlen method only for use with VLEN variables')
- * ndims = self.ndim
- * msg="data can only be assigned to VLEN variables using integer indices" # <<<<<<<<<<<<<<
- * # check to see that elem is a tuple of integers.
- * # handle negative integers.
- */
- __Pyx_INCREF(__pyx_kp_s_data_can_only_be_assigned_to_VLE);
- __pyx_v_msg = __pyx_kp_s_data_can_only_be_assigned_to_VLE;
-
- /* "netCDF4/_netCDF4.pyx":3943
- * # 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":3944
- * # 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":3945
- * 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_ERR(0, 3945, __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_ERR(0, 3945, __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_ERR(0, 3945, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3944
- * # handle negative integers.
- * if isinstance(elem, int):
- * if ndims > 1: # <<<<<<<<<<<<<<
- * raise IndexError(msg)
- * if elem < 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3946
- * 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_ERR(0, 3946, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3946, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3947
- * 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_ERR(0, 3947, __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)) __PYX_ERR(0, 3947, __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_ERR(0, 3947, __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_ERR(0, 3947, __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_ERR(0, 3947, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3948
- * 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_ERR(0, 3948, __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)) __PYX_ERR(0, 3948, __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_ERR(0, 3948, __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":3947
- * raise IndexError(msg)
- * if elem < 0:
- * if self.shape[0]+elem >= 0: # <<<<<<<<<<<<<<
- * elem = self.shape[0]+elem
- * else:
- */
- goto __pyx_L7;
- }
-
- /* "netCDF4/_netCDF4.pyx":3950
- * 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__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3950, __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_ERR(0, 3950, __pyx_L1_error)
- }
- __pyx_L7:;
-
- /* "netCDF4/_netCDF4.pyx":3946
- * if ndims > 1:
- * raise IndexError(msg)
- * if elem < 0: # <<<<<<<<<<<<<<
- * if self.shape[0]+elem >= 0:
- * elem = self.shape[0]+elem
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3943
- * # 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":3951
- * 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":3952
- * 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_ERR(0, 3952, __pyx_L1_error)
- __pyx_t_2 = ((__pyx_t_6 != __pyx_v_ndims) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3953
- * 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__63, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3953, __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_ERR(0, 3953, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3952
- * raise IndexError("Illegal index")
- * elif isinstance(elem, tuple):
- * if len(elem) != ndims: # <<<<<<<<<<<<<<
- * raise IndexError("Illegal index")
- * elemnew = []
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3954
- * 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_ERR(0, 3954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_elemnew = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3955
- * 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_ERR(0, 3955, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3955, __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_ERR(0, 3955, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3955, __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_ERR(0, 3955, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3955, __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_ERR(0, 3955, __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":3956
- * 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":3957
- * 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_ERR(0, 3957, __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_ERR(0, 3957, __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_ERR(0, 3957, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3956
- * elemnew = []
- * for n,e in enumerate(elem):
- * if not isinstance(e, int): # <<<<<<<<<<<<<<
- * raise IndexError(msg)
- * elif e < 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3958
- * 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_ERR(0, 3958, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3958, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3959
- * 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_ERR(0, 3959, __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)) __PYX_ERR(0, 3959, __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_ERR(0, 3959, __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":3960
- * 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_ERR(0, 3960, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3960, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":3961
- * 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__64, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3961, __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_ERR(0, 3961, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3960
- * elif e < 0:
- * enew = self.shape[n]+e
- * if enew < 0: # <<<<<<<<<<<<<<
- * raise IndexError("Illegal index")
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3963
- * 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_ERR(0, 3963, __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)) __PYX_ERR(0, 3963, __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_ERR(0, 3963, __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_ERR(0, 3963, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":3958
- * 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":3965
- * 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_ERR(0, 3965, __pyx_L1_error)
- }
- __pyx_L11:;
-
- /* "netCDF4/_netCDF4.pyx":3955
- * 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":3966
- * 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_ERR(0, 3966, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF_SET(__pyx_v_elem, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3951
- * else:
- * raise IndexError("Illegal index")
- * elif isinstance(elem, tuple): # <<<<<<<<<<<<<<
- * if len(elem) != ndims:
- * raise IndexError("Illegal index")
- */
- goto __pyx_L4;
- }
-
- /* "netCDF4/_netCDF4.pyx":3968
- * 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_ERR(0, 3968, __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_ERR(0, 3968, __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_ERR(0, 3968, __pyx_L1_error)
- }
- __pyx_L4:;
-
- /* "netCDF4/_netCDF4.pyx":3970
- * 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":3971
- * # 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_ERR(0, 3971, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_v_start = ((PyObject*)__pyx_t_8);
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3970
- * raise IndexError(msg)
- * # set start, count
- * if isinstance(elem, tuple): # <<<<<<<<<<<<<<
- * start = list(elem)
- * else:
- */
- goto __pyx_L13;
- }
-
- /* "netCDF4/_netCDF4.pyx":3973
- * start = list(elem)
- * else:
- * start = [elem] # <<<<<<<<<<<<<<
- * count = [1]*ndims
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- */
- /*else*/ {
- __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3973, __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":3974
- * else:
- * start = [elem]
- * count = [1]*ndims # <<<<<<<<<<<<<<
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>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_ERR(0, 3974, __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":3975
- * start = [elem]
- * count = [1]*ndims
- * startp = <size_t *>malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<<
- * countp = <size_t *>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":3976
- * count = [1]*ndims
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>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":3977
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>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":3978
- * countp = <size_t *>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)) __PYX_ERR(0, 3978, __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_ERR(0, 3978, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- (__pyx_v_startp[__pyx_v_n]) = __pyx_t_10;
-
- /* "netCDF4/_netCDF4.pyx":3979
- * for n from 0 <= n < ndims:
- * startp[n] = start[n]
- * countp[n] = count[n] # <<<<<<<<<<<<<<
- * if self.dtype == str: # VLEN string
- * strdata = <char **>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)) __PYX_ERR(0, 3979, __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_ERR(0, 3979, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- (__pyx_v_countp[__pyx_v_n]) = __pyx_t_10;
- }
-
- /* "netCDF4/_netCDF4.pyx":3980
- * startp[n] = start[n]
- * countp[n] = count[n]
- * if self.dtype == str: # VLEN string # <<<<<<<<<<<<<<
- * strdata = <char **>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_ERR(0, 3980, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3980, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3981
- * countp[n] = count[n]
- * if self.dtype == str: # VLEN string
- * strdata = <char **>malloc(sizeof(char *)) # <<<<<<<<<<<<<<
- * bytestr = _strencode(data)
- * strdata[0] = bytestr
- */
- __pyx_v_strdata = ((char **)malloc((sizeof(char *))));
-
- /* "netCDF4/_netCDF4.pyx":3982
- * if self.dtype == str: # VLEN string
- * strdata = <char **>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_ERR(0, 3982, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_v_bytestr = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":3983
- * strdata = <char **>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_ERR(0, 3983, __pyx_L1_error)
- (__pyx_v_strdata[0]) = __pyx_t_11;
-
- /* "netCDF4/_netCDF4.pyx":3984
- * 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":3986
- * ierr = nc_put_vara(self._grpid, self._varid,
- * startp, countp, strdata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata)
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3987
- * startp, countp, strdata)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3987, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3987, __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_ERR(0, 3987, __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_ERR(0, 3987, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3986
- * ierr = nc_put_vara(self._grpid, self._varid,
- * startp, countp, strdata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":3988
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata) # <<<<<<<<<<<<<<
- * else: # regular VLEN
- * if data.dtype != self.dtype:
- */
- free(__pyx_v_strdata);
-
- /* "netCDF4/_netCDF4.pyx":3980
- * startp[n] = start[n]
- * countp[n] = count[n]
- * if self.dtype == str: # VLEN string # <<<<<<<<<<<<<<
- * strdata = <char **>malloc(sizeof(char *))
- * bytestr = _strencode(data)
- */
- goto __pyx_L16;
- }
-
- /* "netCDF4/_netCDF4.pyx":3990
- * 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_ERR(0, 3990, __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_ERR(0, 3990, __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_ERR(0, 3990, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3991
- * 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 = <nc_vlen_t *>malloc(sizeof(nc_vlen_t))
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3991, __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_ERR(0, 3991, __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_ERR(0, 3991, __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_ERR(0, 3991, __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_ERR(0, 3991, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3990
- * 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":3992
- * if data.dtype != self.dtype:
- * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype))
- * data2 = data # <<<<<<<<<<<<<<
- * vldata = <nc_vlen_t *>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_ERR(0, 3992, __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":3993
- * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype))
- * data2 = data
- * vldata = <nc_vlen_t *>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":3994
- * data2 = data
- * vldata = <nc_vlen_t *>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":3995
- * vldata = <nc_vlen_t *>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":3996
- * 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":3998
- * ierr = nc_put_vara(self._grpid, self._varid,
- * startp, countp, vldata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(vldata)
- */
- __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":3999
- * startp, countp, vldata)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 3999, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3999, __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_ERR(0, 3999, __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_ERR(0, 3999, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":3998
- * ierr = nc_put_vara(self._grpid, self._varid,
- * startp, countp, vldata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(vldata)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4000
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(vldata) # <<<<<<<<<<<<<<
- * free(startp)
- * free(countp)
- */
- free(__pyx_v_vldata);
- }
- __pyx_L16:;
-
- /* "netCDF4/_netCDF4.pyx":4001
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(vldata)
- * free(startp) # <<<<<<<<<<<<<<
- * free(countp)
- *
- */
- free(__pyx_v_startp);
-
- /* "netCDF4/_netCDF4.pyx":4002
- * free(vldata)
- * free(startp)
- * free(countp) # <<<<<<<<<<<<<<
- *
- * def __setitem__(self, elem, data):
- */
- free(__pyx_v_countp);
-
- /* "netCDF4/_netCDF4.pyx":3929
- * 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":4004
- * 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_51__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_51__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_50__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_50__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;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- 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)(PyObject *);
- PyObject *(*__pyx_t_13)(PyObject *);
- Py_ssize_t __pyx_t_14;
- PyObject *__pyx_t_15 = NULL;
- PyObject *__pyx_t_16 = NULL;
- __Pyx_RefNannySetupContext("__setitem__", 0);
- __Pyx_INCREF(__pyx_v_elem);
- __Pyx_INCREF(__pyx_v_data);
-
- /* "netCDF4/_netCDF4.pyx":4011
- * # 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_ERR(0, 4011, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4012
- *
- * 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_ERR(0, 4012, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4012, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4016
- * # assume it is a python string and raise an error
- * # if it is an array, but not an object array.
- * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
- * # issue 458, allow Ellipsis to be used for scalar var
- * if type(elem) == type(Ellipsis) and not\
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4016, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4016, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 4016, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4018
- * if not isinstance(data, numpy.ndarray):
- * # 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_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_elem)), ((PyObject *)Py_TYPE(__pyx_builtin_Ellipsis)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4018, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4018, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
- } else {
- __pyx_t_4 = __pyx_t_1;
- goto __pyx_L7_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":4019
- * # 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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4019, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 4019, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4018
- * if not isinstance(data, numpy.ndarray):
- * # 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_5 != 0)) != 0);
- __pyx_t_4 = __pyx_t_1;
- __pyx_L7_bool_binop_done:;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4019
- * # 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":4018
- * if not isinstance(data, numpy.ndarray):
- * # 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":4020
- * 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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assign_vlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_5 = 1;
- }
- }
- __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4020, __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_5, __pyx_v_elem);
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_v_data);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4021
- * 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":4016
- * # assume it is a python string and raise an error
- * # if it is an array, but not an object array.
- * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
- * # issue 458, allow Ellipsis to be used for scalar var
- * if type(elem) == type(Ellipsis) and not\
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4022
- * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4022, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4022, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4022, __pyx_L1_error)
- if (!__pyx_t_1) {
- } else {
- __pyx_t_4 = __pyx_t_1;
- goto __pyx_L9_bool_binop_done;
- }
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4022, __pyx_L1_error)
- __pyx_t_4 = __pyx_t_1;
- __pyx_L9_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_1 = (__pyx_t_4 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4023
- * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isMA); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4023, __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_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __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_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4023, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4024
- * 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":4025
- * 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4025, __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_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4025, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 4025, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4023
- * 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":4026
- * 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_builtin_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_builtin_object);
- __Pyx_GIVEREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_builtin_object);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4022
- * 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":4027
- * 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_ERR(0, 4027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4027, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4027, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4028
- * 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":4030
- * 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4030, __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_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4030, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 4030, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4027
- * 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":4012
- *
- * 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":4035
- * # not an object array, assume it represents a single element
- * # of the vlen var.
- * if not isinstance(data, numpy.ndarray) 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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_4 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = ((!(__pyx_t_4 != 0)) != 0);
- if (!__pyx_t_8) {
- } else {
- __pyx_t_1 = __pyx_t_8;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_kind); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4035, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = __pyx_t_8;
- __pyx_L13_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4037
- * if not isinstance(data, numpy.ndarray) 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_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_elem)), ((PyObject *)Py_TYPE(__pyx_builtin_Ellipsis)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4037, __pyx_L1_error)
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4037, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_8) {
- } else {
- __pyx_t_1 = __pyx_t_8;
- goto __pyx_L16_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":4038
- * # 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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4038, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 4038, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4037
- * if not isinstance(data, numpy.ndarray) 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_5 != 0)) != 0);
- __pyx_t_1 = __pyx_t_8;
- __pyx_L16_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4038
- * # 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":4037
- * if not isinstance(data, numpy.ndarray) 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":4039
- * 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_assign_vlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4039, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- __pyx_t_5 = 0;
- 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);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4039, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 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_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_data);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4039, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4040
- * len(self.dimensions): elem = 0
- * self._assign_vlen(elem, data)
- * return # <<<<<<<<<<<<<<
- *
- * # A numpy or masked array (or an object supporting the buffer interface) is needed.
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":4035
- * # not an object array, assume it represents a single element
- * # of the vlen var.
- * if not isinstance(data, numpy.ndarray) 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":4011
- * # 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":4044
- * # A numpy or masked array (or an object supporting the buffer interface) is needed.
- * # Convert if necessary.
- * if not ma.isMA(data) and not (hasattr(data,'data') and isinstance(data.data,buffer)): # <<<<<<<<<<<<<<
- * # 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isMA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4044, __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 && 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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4044, __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_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_data);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_4 = ((!__pyx_t_8) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_1 = __pyx_t_4;
- goto __pyx_L19_bool_binop_done;
- }
- __pyx_t_8 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_data); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __pyx_t_9 = (__pyx_t_8 != 0);
- if (__pyx_t_9) {
- } else {
- __pyx_t_4 = __pyx_t_9;
- goto __pyx_L21_bool_binop_done;
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = PyObject_IsInstance(__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 4044, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = (__pyx_t_9 != 0);
- __pyx_t_4 = __pyx_t_8;
- __pyx_L21_bool_binop_done:;
- __pyx_t_8 = ((!__pyx_t_4) != 0);
- __pyx_t_1 = __pyx_t_8;
- __pyx_L19_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4046
- * if not ma.isMA(data) and not (hasattr(data,'data') and isinstance(data.data,buffer)):
- * # 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_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4046, __pyx_L1_error)
- if (!__pyx_t_8) {
- goto __pyx_L25_next_or;
- } else {
- }
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4046, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4046, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = (__pyx_t_8 != 0);
- if (!__pyx_t_4) {
- goto __pyx_L25_next_or;
- } else {
- }
-
- /* "netCDF4/_netCDF4.pyx":4047
- * # 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_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4047, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_4 != 0);
- if (!__pyx_t_8) {
- } else {
- __pyx_t_1 = __pyx_t_8;
- goto __pyx_L24_bool_binop_done;
- }
- __pyx_L25_next_or:;
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4047, __pyx_L1_error)
- __pyx_t_4 = (__pyx_t_8 != 0);
- __pyx_t_1 = __pyx_t_4;
- __pyx_L24_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":4046
- * if not ma.isMA(data) and not (hasattr(data,'data') and isinstance(data.data,buffer)):
- * # 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_1) {
-
- /* "netCDF4/_netCDF4.pyx":4048
- * 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_ERR(0, 4048, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4048, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4048, __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_ERR(0, 4048, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4048, __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_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4048, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4046
- * if not ma.isMA(data) and not (hasattr(data,'data') and isinstance(data.data,buffer)):
- * # 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_L23;
- }
-
- /* "netCDF4/_netCDF4.pyx":4050
- * data = numpy.array(data,numpy.float)
- * else:
- * data = numpy.array(data,self.dtype) # <<<<<<<<<<<<<<
- *
- * # for Enum variable, make sure data is valid.
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4050, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4050, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4050, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_3) {
- __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+__pyx_t_5, __pyx_v_data);
- __Pyx_INCREF(__pyx_v_self->dtype);
- __Pyx_GIVEREF(__pyx_v_self->dtype);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_v_self->dtype);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4050, __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_data, __pyx_t_6);
- __pyx_t_6 = 0;
- }
- __pyx_L23:;
-
- /* "netCDF4/_netCDF4.pyx":4044
- * # A numpy or masked array (or an object supporting the buffer interface) is needed.
- * # Convert if necessary.
- * if not ma.isMA(data) and not (hasattr(data,'data') and isinstance(data.data,buffer)): # <<<<<<<<<<<<<<
- * # 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":4053
- *
- * # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4053, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4054
- * # 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_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4054, __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_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_5 = 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_5 = 1;
- }
- }
- __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_7);
- __pyx_t_10 = 0;
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_test = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4055
- * 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_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_enum_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4055, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
- __pyx_t_12 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4055, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (likely(!__pyx_t_12)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4055, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4055, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_12(__pyx_t_2);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 4055, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4056
- * 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_6 = PyObject_RichCompare(__pyx_v_data, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4056, __pyx_L1_error)
- __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_test, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_test, __pyx_t_11);
- __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4055
- * 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":4057
- * 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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_test); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = 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_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4057, __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":4058
- * 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":4059
- * 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_ERR(0, 4059, __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_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4059, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 4059, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4057
- * 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":4053
- *
- * # 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":4062
- *
- * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_StartCountStride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4062, __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_ERR(0, 4062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_v_elem);
- __Pyx_GIVEREF(__pyx_v_elem);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_elem);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_7);
- __Pyx_INCREF(__pyx_v_self->_grp);
- __Pyx_GIVEREF(__pyx_v_self->_grp);
- PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_v_self->_grp);
- __pyx_t_2 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4062, __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_ERR(0, 4062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_datashape, __pyx_t_2) < 0) __PYX_ERR(0, 4062, __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_ERR(0, 4062, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_ERR(0, 4061, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_10 = PyList_GET_ITEM(sequence, 3);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_10);
- #else
- {
- Py_ssize_t i;
- PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_11,&__pyx_t_6,&__pyx_t_10};
- for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 4061, __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_11,&__pyx_t_6,&__pyx_t_10};
- __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4061, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_13 = Py_TYPE(__pyx_t_3)->tp_iternext;
- for (index=0; index < 4; index++) {
- PyObject* item = __pyx_t_13(__pyx_t_3); if (unlikely(!item)) goto __pyx_L32_unpacking_failed;
- __Pyx_GOTREF(item);
- *(temps[index]) = item;
- }
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_3), 4) < 0) __PYX_ERR(0, 4061, __pyx_L1_error)
- __pyx_t_13 = NULL;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L33_unpacking_done;
- __pyx_L32_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 4061, __pyx_L1_error)
- __pyx_L33_unpacking_done:;
- }
-
- /* "netCDF4/_netCDF4.pyx":4061
- * 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_11;
- __pyx_t_11 = 0;
- __pyx_v_stride = __pyx_t_6;
- __pyx_t_6 = 0;
- __pyx_v_put_ind = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4063
- * 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_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_out_array_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4063, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4063, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4063, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_v_count);
- __Pyx_GIVEREF(__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_count);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4063, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_v_datashape = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4067
- * # 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_ERR(0, 4067, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4067, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4067, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4068
- * # 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_ERR(0, 4068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tile); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4068, __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_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_data);
- __Pyx_INCREF(__pyx_v_datashape);
- __Pyx_GIVEREF(__pyx_v_datashape);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_datashape);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4067
- * # 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":4071
- * # 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4071, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 4071, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_14 = PyObject_Length(__pyx_v_datashape); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 4071, __pyx_L1_error)
- __pyx_t_4 = ((__pyx_t_5 != __pyx_t_14) != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4073
- * 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4073, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (__pyx_t_6) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4073, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else {
- __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4073, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4074
- * # 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_10 = PySequence_Tuple(__pyx_v_datashape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4074, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_data, __pyx_n_s_shape, __pyx_t_10) < 0) __PYX_ERR(0, 4074, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4071
- * # 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":4077
- *
- * # 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_start, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4077, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4077, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __Pyx_INCREF(__pyx_v_self->ndim);
- __pyx_t_6 = __pyx_v_self->ndim;
- goto __pyx_L36_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4077, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __pyx_t_2;
- __pyx_t_2 = 0;
- __pyx_L36_bool_binop_done:;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4077, __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_6);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4077, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4077, __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_2);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4077, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4078
- * # 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_count, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4078, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4078, __pyx_L1_error)
- if (!__pyx_t_4) {
- } 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_ERR(0, 4078, __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_ERR(0, 4078, __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_11))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4078, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4078, __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_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4078, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4079
- * 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_stride, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4079, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4079, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __Pyx_INCREF(__pyx_v_self->ndim);
- __pyx_t_6 = __pyx_v_self->ndim;
- goto __pyx_L40_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4079, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __pyx_t_2;
- __pyx_t_2 = 0;
- __pyx_L40_bool_binop_done:;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4079, __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_6);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4079, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4079, __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_2);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4079, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_stride, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4080
- * 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)) # <<<<<<<<<<<<<<
- *
- * # quantize data if least_significant_digit attribute
- */
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4080, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4080, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __Pyx_INCREF(__pyx_v_self->ndim);
- __pyx_t_7 = __pyx_v_self->ndim;
- goto __pyx_L42_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4080, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __pyx_t_2;
- __pyx_t_2 = 0;
- __pyx_L42_bool_binop_done:;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4080, __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_11))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4080, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4080, __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_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4080, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_put_ind, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4084
- * # quantize data if least_significant_digit attribute
- * # exists (improves compression).
- * if self._has_lsd: # <<<<<<<<<<<<<<
- * data = _quantize(data,self.least_significant_digit)
- * # if auto_scale mode set to True, (through
- */
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_has_lsd); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4084, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4085
- * # exists (improves compression).
- * if self._has_lsd:
- * 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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_quantize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_least_significant_digit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = NULL;
- __pyx_t_14 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_14 = 1;
- }
- }
- __pyx_t_7 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4085, __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_14, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_14, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4084
- * # quantize data if least_significant_digit attribute
- * # exists (improves compression).
- * if self._has_lsd: # <<<<<<<<<<<<<<
- * data = _quantize(data,self.least_significant_digit)
- * # if auto_scale mode set to True, (through
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4094
- * # valid_min,validmax,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_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->mask); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4094, __pyx_L1_error)
- if (__pyx_t_1) {
- } else {
- __pyx_t_4 = __pyx_t_1;
- goto __pyx_L46_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4094, __pyx_L1_error)
- if (!__pyx_t_1) {
- } else {
- __pyx_t_4 = __pyx_t_1;
- goto __pyx_L46_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4094, __pyx_L1_error)
- __pyx_t_4 = __pyx_t_1;
- __pyx_L46_bool_binop_done:;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4097
- * # 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_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 4097, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_1 != 0);
- if (!__pyx_t_8) {
- } else {
- __pyx_t_4 = __pyx_t_8;
- goto __pyx_L50_bool_binop_done;
- }
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4097, __pyx_L1_error)
- __pyx_t_1 = (__pyx_t_8 != 0);
- __pyx_t_4 = __pyx_t_1;
- __pyx_L50_bool_binop_done:;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4099
- * 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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_isMA); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = ((!__pyx_t_4) != 0);
- if (__pyx_t_1) {
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toma); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __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_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_data);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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":4097
- * # 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":4094
- * # valid_min,validmax,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":4100
- * # 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4100, __pyx_L1_error)
- if (__pyx_t_4) {
- } else {
- __pyx_t_1 = __pyx_t_4;
- goto __pyx_L54_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4100, __pyx_L1_error)
- __pyx_t_1 = __pyx_t_4;
- __pyx_L54_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4102
- * 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_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4102, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_4 != 0);
- if (__pyx_t_8) {
- } else {
- __pyx_t_1 = __pyx_t_8;
- goto __pyx_L57_bool_binop_done;
- }
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4102, __pyx_L1_error)
- __pyx_t_4 = (__pyx_t_8 != 0);
- __pyx_t_1 = __pyx_t_4;
- __pyx_L57_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4103
- * # 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_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4103, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_7 = PyNumber_Subtract(__pyx_v_data, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4103, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4103, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4103, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __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_11);
- __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4104
- * 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_4 = (__pyx_t_1 != 0);
- if (__pyx_t_4) {
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_around); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4104, __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_11 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data);
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_11);
- __pyx_t_11 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4102
- * 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_L56;
- }
-
- /* "netCDF4/_netCDF4.pyx":4105
- * 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_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4105, __pyx_L1_error)
- __pyx_t_1 = (__pyx_t_4 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4106
- * 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_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4107
- * 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_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_4 = (__pyx_t_1 != 0);
- if (__pyx_t_4) {
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_around); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_data);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
- __pyx_t_7 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4105
- * 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_L56;
- }
-
- /* "netCDF4/_netCDF4.pyx":4108
- * 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_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4108, __pyx_L1_error)
- __pyx_t_1 = (__pyx_t_4 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4109
- * 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_ERR(0, 4109, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4109, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4110
- * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = (__pyx_t_1 != 0);
- if (__pyx_t_4) {
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_around); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_data);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
- __pyx_t_6 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4108
- * 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_L56:;
-
- /* "netCDF4/_netCDF4.pyx":4111
- * 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_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4111, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_isMA); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4111, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_10) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4111, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4111, __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_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4111, __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4111, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4115
- * # 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_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 4115, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_1 != 0);
- if (__pyx_t_8) {
- } else {
- __pyx_t_4 = __pyx_t_8;
- goto __pyx_L64_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":4116
- * # 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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_in1d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4116, __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_data, __pyx_n_s_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __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_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = NULL;
- __pyx_t_14 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
- __pyx_t_14 = 1;
- }
- }
- __pyx_t_16 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_14, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_14, __pyx_t_3);
- __pyx_t_15 = 0;
- __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4116, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __pyx_t_8;
- __pyx_L64_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":4115
- * # 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_4) {
-
- /* "netCDF4/_netCDF4.pyx":4117
- * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4117, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4115
- * # 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_L63;
- }
-
- /* "netCDF4/_netCDF4.pyx":4119
- * 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_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 4119, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_4 != 0);
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":4123
- * # 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_ERR(0, 4123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __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_ERR(0, 4123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_16);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4123, __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_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_shape); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_16, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4123, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":4124
- * # 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4124, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_fillval = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4123
- * # 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_L67;
- }
-
- /* "netCDF4/_netCDF4.pyx":4126
- * 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":4127
- * 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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4127, __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_16 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4127, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_16, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __PYX_ERR(0, 4127, __pyx_L1_error)
- }
- __pyx_L67:;
-
- /* "netCDF4/_netCDF4.pyx":4128
- * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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_16 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fillval); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4128, __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_fillval);
- __Pyx_GIVEREF(__pyx_v_fillval);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_fillval);
- __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __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_16, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4128, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_8) {
-
- /* "netCDF4/_netCDF4.pyx":4129
- * raise RuntimeError(msg)
- * if numpy.array(fillval).shape != ():
- * fillval = fillval[0] # <<<<<<<<<<<<<<
- * elif hasattr(self, '_FillValue'):
- * fillval = self._FillValue
- */
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_fillval, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4129, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF_SET(__pyx_v_fillval, __pyx_t_16);
- __pyx_t_16 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4128
- * 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":4119
- * 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_L66;
- }
-
- /* "netCDF4/_netCDF4.pyx":4130
- * if numpy.array(fillval).shape != ():
- * fillval = fillval[0]
- * elif hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fillval = self._FillValue
- * else:
- */
- __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 4130, __pyx_L1_error)
- __pyx_t_4 = (__pyx_t_8 != 0);
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4131
- * fillval = fillval[0]
- * elif hasattr(self, '_FillValue'):
- * fillval = self._FillValue # <<<<<<<<<<<<<<
- * else:
- * fillval = default_fillvals[self.dtype.str[1:]]
- */
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_v_fillval = __pyx_t_16;
- __pyx_t_16 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4130
- * if numpy.array(fillval).shape != ():
- * fillval = fillval[0]
- * elif hasattr(self, '_FillValue'): # <<<<<<<<<<<<<<
- * fillval = self._FillValue
- * else:
- */
- goto __pyx_L66;
- }
-
- /* "netCDF4/_netCDF4.pyx":4133
- * fillval = self._FillValue
- * else:
- * fillval = default_fillvals[self.dtype.str[1:]] # <<<<<<<<<<<<<<
- * data = data.filled(fill_value=fillval)
- *
- */
- /*else*/ {
- __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__65, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_t_16, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_fillval = __pyx_t_2;
- __pyx_t_2 = 0;
- }
- __pyx_L66:;
-
- /* "netCDF4/_netCDF4.pyx":4134
- * 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_ERR(0, 4134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fill_value, __pyx_v_fillval) < 0) __PYX_ERR(0, 4134, __pyx_L1_error)
- __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __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_16);
- __pyx_t_16 = 0;
- }
- __pyx_L63:;
-
- /* "netCDF4/_netCDF4.pyx":4111
- * 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":4100
- * # 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":4137
- *
- * # 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_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = NULL;
- __pyx_t_14 = 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_14 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4137, __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_start);
- __Pyx_GIVEREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_14, __pyx_v_start);
- __Pyx_INCREF(__pyx_v_count);
- __Pyx_GIVEREF(__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_14, __pyx_v_count);
- __Pyx_INCREF(__pyx_v_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_14, __pyx_v_stride);
- __Pyx_INCREF(__pyx_v_put_ind);
- __Pyx_GIVEREF(__pyx_v_put_ind);
- PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_14, __pyx_v_put_ind);
- __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (likely(PyList_CheckExact(__pyx_t_16)) || PyTuple_CheckExact(__pyx_t_16)) {
- __pyx_t_7 = __pyx_t_16; __Pyx_INCREF(__pyx_t_7); __pyx_t_14 = 0;
- __pyx_t_12 = NULL;
- } else {
- __pyx_t_14 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4137, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- for (;;) {
- if (likely(!__pyx_t_12)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_16 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_14); __Pyx_INCREF(__pyx_t_16); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 4137, __pyx_L1_error)
- #else
- __pyx_t_16 = PySequence_ITEM(__pyx_t_7, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- #endif
- } else {
- if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_14); __Pyx_INCREF(__pyx_t_16); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 4137, __pyx_L1_error)
- #else
- __pyx_t_16 = PySequence_ITEM(__pyx_t_7, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- #endif
- }
- } else {
- __pyx_t_16 = __pyx_t_12(__pyx_t_7);
- if (unlikely(!__pyx_t_16)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 4137, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_16);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_16))) || (PyList_CheckExact(__pyx_t_16))) {
- PyObject* sequence = __pyx_t_16;
- #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_ERR(0, 4137, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3);
- } else {
- __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 3);
- }
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_3);
- #else
- {
- Py_ssize_t i;
- PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_2,&__pyx_t_11,&__pyx_t_3};
- for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(item);
- *(temps[i]) = item;
- }
- }
- #endif
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- } else {
- Py_ssize_t index = -1;
- PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_2,&__pyx_t_11,&__pyx_t_3};
- __pyx_t_15 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_13 = Py_TYPE(__pyx_t_15)->tp_iternext;
- for (index=0; index < 4; index++) {
- PyObject* item = __pyx_t_13(__pyx_t_15); if (unlikely(!item)) goto __pyx_L71_unpacking_failed;
- __Pyx_GOTREF(item);
- *(temps[index]) = item;
- }
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_15), 4) < 0) __PYX_ERR(0, 4137, __pyx_L1_error)
- __pyx_t_13 = NULL;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- goto __pyx_L72_unpacking_done;
- __pyx_L71_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_13 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 4137, __pyx_L1_error)
- __pyx_L72_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2);
- __pyx_t_2 = 0;
- __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_11);
- __pyx_t_11 = 0;
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4138
- * # 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_16 = PySequence_Tuple(__pyx_v_i); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_data, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dataput, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4139
- * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4139, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4139, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4139, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_4) {
- goto __pyx_L69_continue;
- }
-
- /* "netCDF4/_netCDF4.pyx":4141
- * 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_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_shape); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_16, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4141, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4141, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4142
- * # convert array scalar to regular array with one element.
- * if dataput.shape == ():
- * if self._isvlen: # <<<<<<<<<<<<<<
- * dataput=numpy.array(dataput,'O')
- * else:
- */
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 4142, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":4143
- * if dataput.shape == ():
- * if self._isvlen:
- * dataput=numpy.array(dataput,'O') # <<<<<<<<<<<<<<
- * else:
- * dataput=numpy.array(dataput,dataput.dtype)
- */
- __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_16)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_16);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_16) {
- __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16); __pyx_t_16 = NULL;
- }
- __Pyx_INCREF(__pyx_v_dataput);
- __Pyx_GIVEREF(__pyx_v_dataput);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_dataput);
- __Pyx_INCREF(__pyx_n_s_O);
- __Pyx_GIVEREF(__pyx_n_s_O);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_n_s_O);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_dataput, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4142
- * # convert array scalar to regular array with one element.
- * if dataput.shape == ():
- * if self._isvlen: # <<<<<<<<<<<<<<
- * dataput=numpy.array(dataput,'O')
- * else:
- */
- goto __pyx_L75;
- }
-
- /* "netCDF4/_netCDF4.pyx":4145
- * dataput=numpy.array(dataput,'O')
- * else:
- * dataput=numpy.array(dataput,dataput.dtype) # <<<<<<<<<<<<<<
- * self._put(dataput,a,b,c)
- *
- */
- /*else*/ {
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_16 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_16)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_16);
- __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_ERR(0, 4145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_16) {
- __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_16); __pyx_t_16 = NULL;
- }
- __Pyx_INCREF(__pyx_v_dataput);
- __Pyx_GIVEREF(__pyx_v_dataput);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_dataput);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_dataput, __pyx_t_3);
- __pyx_t_3 = 0;
- }
- __pyx_L75:;
-
- /* "netCDF4/_netCDF4.pyx":4141
- * 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":4146
- * 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_ERR(0, 4146, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_5 = 1;
- }
- }
- __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4146, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
- }
- __Pyx_INCREF(__pyx_v_dataput);
- __Pyx_GIVEREF(__pyx_v_dataput);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_v_dataput);
- __Pyx_INCREF(__pyx_v_a);
- __Pyx_GIVEREF(__pyx_v_a);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_v_a);
- __Pyx_INCREF(__pyx_v_b);
- __Pyx_GIVEREF(__pyx_v_b);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_v_b);
- __Pyx_INCREF(__pyx_v_c);
- __Pyx_GIVEREF(__pyx_v_c);
- PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_v_c);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4146, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4137
- *
- * # 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_L69_continue:;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4004
- * 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_3);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_XDECREF(__pyx_t_16);
- __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":4149
- *
- *
- * 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_53__len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_pw_7netCDF4_8_netCDF4_8Variable_53__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_52__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_52__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;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4150
- *
- * 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_ERR(0, 4150, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4150, __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":4151
- * 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__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4151, __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_ERR(0, 4151, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4150
- *
- * def __len__(self):
- * if not self.shape: # <<<<<<<<<<<<<<
- * raise TypeError('len() of unsized object')
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4153
- * 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_ERR(0, 4153, __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)) __PYX_ERR(0, 4153, __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_ERR(0, 4153, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_5;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4149
- *
- *
- * 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":4156
- *
- *
- * def assignValue(self,val): # <<<<<<<<<<<<<<
- * """
- * **`assignValue(self, val)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_55assignValue(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_54assignValue[] = "\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_55assignValue(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_54assignValue(((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_54assignValue(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;
- __Pyx_RefNannySetupContext("assignValue", 0);
-
- /* "netCDF4/_netCDF4.pyx":4162
- * 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_ERR(0, 4162, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 4162, __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":4163
- * 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__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __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_ERR(0, 4163, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4162
- * 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":4164
- * 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__68, 0, 0, 1) < 0) __PYX_ERR(0, 4164, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4156
- *
- *
- * 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":4166
- * self[:]=val
- *
- * def getValue(self): # <<<<<<<<<<<<<<
- * """
- * **`getValue(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_57getValue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_56getValue[] = "\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_57getValue(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_56getValue(((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_56getValue(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;
- __Pyx_RefNannySetupContext("getValue", 0);
-
- /* "netCDF4/_netCDF4.pyx":4172
- * 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_ERR(0, 4172, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 4172, __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":4173
- * 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__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4173, __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_ERR(0, 4173, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4172
- * 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":4174
- * 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__70); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":4166
- * 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":4176
- * 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_59set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_maskandscale); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_58set_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 _FillVa [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_59set_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_58set_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_58set_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;
- __Pyx_RefNannySetupContext("set_auto_maskandscale", 0);
-
- /* "netCDF4/_netCDF4.pyx":4218
- * (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_ERR(0, 4218, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4219
- * """
- * 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":4220
- * 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":4218
- * (automatic conversions are performed).
- * """
- * if maskandscale: # <<<<<<<<<<<<<<
- * self.scale = True
- * self.mask = True
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4222
- * 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":4223
- * 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":4176
- * 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":4225
- * self.mask = False
- *
- * def set_auto_scale(self,scale): # <<<<<<<<<<<<<<
- * """
- * **`set_auto_scale(self,scale)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_61set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_scale); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_60set_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::\ [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_61set_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_60set_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_60set_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;
- __Pyx_RefNannySetupContext("set_auto_scale", 0);
-
- /* "netCDF4/_netCDF4.pyx":4252
- * (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_ERR(0, 4252, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4253
- * """
- * 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":4252
- * (automatic conversions are performed).
- * """
- * if scale: # <<<<<<<<<<<<<<
- * self.scale = True
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4255
- * 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":4225
- * 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":4257
- * self.scale = False
- *
- * def set_auto_mask(self,mask): # <<<<<<<<<<<<<<
- * """
- * **`set_auto_mask(self,mask)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_63set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_62set_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_val [...]
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_63set_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_62set_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_62set_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;
- __Pyx_RefNannySetupContext("set_auto_mask", 0);
-
- /* "netCDF4/_netCDF4.pyx":4281
- * (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_ERR(0, 4281, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":4282
- * """
- * 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":4281
- * (automatic conversions are performed).
- * """
- * if mask: # <<<<<<<<<<<<<<
- * self.mask = True
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4284
- * 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":4257
- * 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":4287
- *
- *
- * 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_65_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_64_put[] = "Private method to put data into a netCDF variable";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_65_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;
- 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_ERR(0, 4287, __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_ERR(0, 4287, __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_ERR(0, 4287, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_put") < 0)) __PYX_ERR(0, 4287, __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_ERR(0, 4287, __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_ERR(0, 4287, __pyx_L1_error)
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_64_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_64_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;
- char *__pyx_t_13;
- PyObject *(*__pyx_t_14)(PyObject *);
- npy_intp __pyx_t_15;
- __Pyx_RefNannySetupContext("_put", 0);
- __Pyx_INCREF((PyObject *)__pyx_v_data);
-
- /* "netCDF4/_netCDF4.pyx":4300
- * 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_ERR(0, 4300, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 4300, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_ndims = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4303
- * # 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":4304
- * # 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_ERR(0, 4304, __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_ERR(0, 4304, __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_ERR(0, 4304, __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_ERR(0, 4304, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4303
- * # 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":4306
- * data = data.copy()
- * # fill up startp,countp,stridep.
- * totelem = 1 # <<<<<<<<<<<<<<
- * negstride = 0
- * sl = []
- */
- __pyx_v_totelem = 1;
-
- /* "netCDF4/_netCDF4.pyx":4307
- * # fill up startp,countp,stridep.
- * totelem = 1
- * negstride = 0 # <<<<<<<<<<<<<<
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- */
- __pyx_v_negstride = 0;
-
- /* "netCDF4/_netCDF4.pyx":4308
- * totelem = 1
- * negstride = 0
- * sl = [] # <<<<<<<<<<<<<<
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_sl = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4309
- * negstride = 0
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<<
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>malloc(sizeof(ptrdiff_t) * ndims)
- */
- __pyx_v_startp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims)));
-
- /* "netCDF4/_netCDF4.pyx":4310
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<<
- * stridep = <ptrdiff_t *>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":4311
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>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":4312
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>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_ERR(0, 4312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4313
- * stridep = <ptrdiff_t *>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)) __PYX_ERR(0, 4313, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4313, __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_ERR(0, 4313, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4314
- * 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)) __PYX_ERR(0, 4314, __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_ERR(0, 4314, __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_ERR(0, 4314, __pyx_L1_error)
- (__pyx_v_countp[__pyx_t_2]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4316
- * 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)) __PYX_ERR(0, 4316, __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_ERR(0, 4316, __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_ERR(0, 4316, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":4317
- * # 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":4318
- * 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)) __PYX_ERR(0, 4318, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4318, __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_ERR(0, 4318, __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_ERR(0, 4318, __pyx_L1_error)
- (__pyx_v_stridep[__pyx_t_2]) = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":4319
- * 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)) __PYX_ERR(0, 4319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v_count, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4319, __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_ERR(0, 4319, __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_ERR(0, 4319, __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_ERR(0, 4319, __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_ERR(0, 4319, __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_ERR(0, 4319, __pyx_L1_error)
- (__pyx_v_startp[__pyx_t_2]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4320
- * 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)) __PYX_ERR(0, 4320, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4320, __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_ERR(0, 4320, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4321
- * 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__71); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4321, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4316
- * 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":4323
- * 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)) __PYX_ERR(0, 4323, __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_ERR(0, 4323, __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_ERR(0, 4323, __pyx_L1_error)
- (__pyx_v_startp[__pyx_t_2]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4324
- * 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)) __PYX_ERR(0, 4324, __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_ERR(0, 4324, __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_ERR(0, 4324, __pyx_L1_error)
- (__pyx_v_stridep[__pyx_t_2]) = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":4325
- * 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__72); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4325, __pyx_L1_error)
- }
- __pyx_L6:;
-
- /* "netCDF4/_netCDF4.pyx":4326
- * 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_ERR(0, 4326, __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_ERR(0, 4312, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":4312
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>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_ERR(0, 4312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4329
- * # 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":4330
- * # 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":4331
- * 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__73, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4331, __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_ERR(0, 4331, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4330
- * # 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":4332
- * 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":4334
- * 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)) __PYX_ERR(0, 4334, __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_ERR(0, 4334, __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_ERR(0, 4334, __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_ERR(0, 4334, __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_ERR(0, 4334, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_5));
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4332
- * 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":4335
- * # 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_ERR(0, 4335, __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_ERR(0, 4335, __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_ERR(0, 4335, __pyx_L1_error)
- __pyx_t_3 = __pyx_t_12;
- __pyx_L10_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":4339
- * # 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.
- * # byte-swap data in numpy array so that is has native
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4339, __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_ERR(0, 4339, __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_ERR(0, 4339, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":4340
- * # try to cast the data.
- * if self.dtype != data.dtype:
- * data = data.astype(self.dtype) # cast data, if necessary. # <<<<<<<<<<<<<<
- * # byte-swap data in numpy array so that is has native
- * # endian byte order (this is what netcdf-c expects -
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4340, __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_ERR(0, 4340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4340, __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_ERR(0, 4340, __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_ERR(0, 4340, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_4));
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4339
- * # 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.
- * # byte-swap data in numpy array so that is has native
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4344
- * # endian byte order (this is what netcdf-c expects -
- * # issue #554, pull request #555)
- * if not data.dtype.isnative: # <<<<<<<<<<<<<<
- * data = data.byteswap()
- * # strides all 1 or scalar variable, use put_vara (faster)
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnative); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4344, __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_ERR(0, 4344, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_12 = ((!__pyx_t_3) != 0);
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4345
- * # issue #554, pull request #555)
- * if not data.dtype.isnative:
- * data = data.byteswap() # <<<<<<<<<<<<<<
- * # strides all 1 or scalar variable, use put_vara (faster)
- * if sum(stride) == ndims or ndims == 0:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4345, __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_ERR(0, 4345, __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_ERR(0, 4345, __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_ERR(0, 4345, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_5));
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4344
- * # endian byte order (this is what netcdf-c expects -
- * # issue #554, pull request #555)
- * if not data.dtype.isnative: # <<<<<<<<<<<<<<
- * data = data.byteswap()
- * # strides all 1 or scalar variable, use put_vara (faster)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4347
- * data = data.byteswap()
- * # 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4347, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_stride);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4347, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4347, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4347, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4347, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (!__pyx_t_3) {
- } else {
- __pyx_t_12 = __pyx_t_3;
- goto __pyx_L16_bool_binop_done;
- }
- __pyx_t_3 = ((__pyx_v_ndims == 0) != 0);
- __pyx_t_12 = __pyx_t_3;
- __pyx_L16_bool_binop_done:;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4348
- * # 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":4347
- * data = data.byteswap()
- * # 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_L15;
- }
-
- /* "netCDF4/_netCDF4.pyx":4351
- * 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":4352
- * else:
- * ierr = nc_put_vars(self._grpid, self._varid,
- * startp, countp, stridep, data.data) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_L15:;
-
- /* "netCDF4/_netCDF4.pyx":4353
- * ierr = nc_put_vars(self._grpid, self._varid,
- * startp, countp, stridep, data.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * elif self._isvlen:
- */
- __pyx_t_12 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4354
- * startp, countp, stridep, data.data)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * elif self._isvlen:
- * if data.dtype.char !='O':
- */
- __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_ERR(0, 4354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4354, __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_ERR(0, 4354, __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_ERR(0, 4354, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4353
- * ierr = nc_put_vars(self._grpid, self._varid,
- * startp, countp, stridep, data.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * elif self._isvlen:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4335
- * # 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":4355
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4355, __pyx_L1_error)
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4356
- * raise RuntimeError((<char *>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_ERR(0, 4356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4356, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4357
- * 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_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4357, __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_ERR(0, 4357, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4356
- * raise RuntimeError((<char *>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":4359
- * 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_ERR(0, 4359, __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_ERR(0, 4359, __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_ERR(0, 4359, __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_ERR(0, 4359, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_5));
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4360
- * # 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_5 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4360, __pyx_L1_error)
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4360, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4362
- * 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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4362, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4362, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4362, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_14(__pyx_t_5);
- 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_ERR(0, 4362, __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":4363
- * # 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)) __PYX_ERR(0, 4363, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4363, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_v_n, __pyx_t_4) < 0)) __PYX_ERR(0, 4363, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4362
- * 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_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4368
- * # each element in struct.
- * # allocate struct array to hold vlen data.
- * strdata = <char **>malloc(sizeof(char *)*totelem) # <<<<<<<<<<<<<<
- * for i from 0<=i<totelem:
- * strdata[i] = data[i]
- */
- __pyx_v_strdata = ((char **)malloc(((sizeof(char *)) * __pyx_v_totelem)));
-
- /* "netCDF4/_netCDF4.pyx":4369
- * # allocate struct array to hold vlen data.
- * strdata = <char **>malloc(sizeof(char *)*totelem)
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * strdata[i] = data[i]
- * # strides all 1 or scalar variable, use put_vara (faster)
- */
- __pyx_t_15 = __pyx_v_totelem;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_15; __pyx_v_i++) {
-
- /* "netCDF4/_netCDF4.pyx":4370
- * strdata = <char **>malloc(sizeof(char *)*totelem)
- * for i from 0<=i<totelem:
- * strdata[i] = data[i] # <<<<<<<<<<<<<<
- * # strides all 1 or scalar variable, use put_vara (faster)
- * if sum(stride) == ndims or ndims == 0:
- */
- __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 4370, __pyx_L1_error)
- (__pyx_v_strdata[__pyx_v_i]) = __pyx_t_13;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4372
- * 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)
- */
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4372, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_stride);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4372, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4372, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4372, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4372, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (!__pyx_t_3) {
- } else {
- __pyx_t_12 = __pyx_t_3;
- goto __pyx_L26_bool_binop_done;
- }
- __pyx_t_3 = ((__pyx_v_ndims == 0) != 0);
- __pyx_t_12 = __pyx_t_3;
- __pyx_L26_bool_binop_done:;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4373
- * # 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)
- * else:
- */
- __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":4372
- * 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_L25;
- }
-
- /* "netCDF4/_netCDF4.pyx":4376
- * 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__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4376, __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_ERR(0, 4376, __pyx_L1_error)
- }
- __pyx_L25:;
-
- /* "netCDF4/_netCDF4.pyx":4379
- * #ierr = nc_put_vars(self._grpid, self._varid,
- * # startp, countp, stridep, strdata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata)
- */
- __pyx_t_12 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4380
- * # startp, countp, stridep, strdata)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * free(strdata)
- * else:
- */
- __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_ERR(0, 4380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4380, __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_ERR(0, 4380, __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_ERR(0, 4380, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4379
- * #ierr = nc_put_vars(self._grpid, self._varid,
- * # startp, countp, stridep, strdata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4381
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(strdata) # <<<<<<<<<<<<<<
- * else:
- * # regular vlen.
- */
- free(__pyx_v_strdata);
-
- /* "netCDF4/_netCDF4.pyx":4360
- * # 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_L20;
- }
-
- /* "netCDF4/_netCDF4.pyx":4386
- * # 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 = <nc_vlen_t *>malloc(<size_t>totelem*sizeof(nc_vlen_t))
- */
- /*else*/ {
- __pyx_t_13 = __pyx_v_data->data;
- __pyx_v_databuff = __pyx_t_13;
-
- /* "netCDF4/_netCDF4.pyx":4388
- * databuff = data.data
- * # allocate struct array to hold vlen data.
- * vldata = <nc_vlen_t *>malloc(<size_t>totelem*sizeof(nc_vlen_t)) # <<<<<<<<<<<<<<
- * for i from 0<=i<totelem:
- * elptr = (<void**>databuff)[0]
- */
- __pyx_v_vldata = ((nc_vlen_t *)malloc((((size_t)__pyx_v_totelem) * (sizeof(nc_vlen_t)))));
-
- /* "netCDF4/_netCDF4.pyx":4389
- * # allocate struct array to hold vlen data.
- * vldata = <nc_vlen_t *>malloc(<size_t>totelem*sizeof(nc_vlen_t))
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * elptr = (<void**>databuff)[0]
- * dataarr = <ndarray>elptr
- */
- __pyx_t_15 = __pyx_v_totelem;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_15; __pyx_v_i++) {
-
- /* "netCDF4/_netCDF4.pyx":4390
- * vldata = <nc_vlen_t *>malloc(<size_t>totelem*sizeof(nc_vlen_t))
- * for i from 0<=i<totelem:
- * elptr = (<void**>databuff)[0] # <<<<<<<<<<<<<<
- * dataarr = <ndarray>elptr
- * if self.dtype != dataarr.dtype.str[1:]:
- */
- __pyx_v_elptr = (((void **)__pyx_v_databuff)[0]);
-
- /* "netCDF4/_netCDF4.pyx":4391
- * for i from 0<=i<totelem:
- * elptr = (<void**>databuff)[0]
- * dataarr = <ndarray>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":4392
- * elptr = (<void**>databuff)[0]
- * dataarr = <ndarray>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_ERR(0, 4392, __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_ERR(0, 4392, __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__76, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4392, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->dtype, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4392, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4392, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4395
- * #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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dataarr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4395, __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_5);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_wrong_data_type_in_object_array, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __PYX_ERR(0, 4395, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4392
- * elptr = (<void**>databuff)[0]
- * dataarr = <ndarray>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":4396
- * # 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":4397
- * 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_13 = __pyx_v_dataarr->data;
- (__pyx_v_vldata[__pyx_v_i]).p = __pyx_t_13;
-
- /* "netCDF4/_netCDF4.pyx":4398
- * 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":4400
- * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_stride);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4400, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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_ERR(0, 4400, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!__pyx_t_3) {
- } else {
- __pyx_t_12 = __pyx_t_3;
- goto __pyx_L33_bool_binop_done;
- }
- __pyx_t_3 = ((__pyx_v_ndims == 0) != 0);
- __pyx_t_12 = __pyx_t_3;
- __pyx_L33_bool_binop_done:;
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4401
- * # 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":4400
- * 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_L32;
- }
-
- /* "netCDF4/_netCDF4.pyx":4404
- * 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_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4404, __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_ERR(0, 4404, __pyx_L1_error)
- }
- __pyx_L32:;
-
- /* "netCDF4/_netCDF4.pyx":4407
- * #ierr = nc_put_vars(self._grpid, self._varid,
- * # startp, countp, stridep, vldata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # free the pointer array.
- */
- __pyx_t_12 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4408
- * # startp, countp, stridep, vldata)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * # free the pointer array.
- * free(vldata)
- */
- __pyx_t_13 = ((char *)nc_strerror(__pyx_v_ierr));
- __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4408, __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_ERR(0, 4408, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4407
- * #ierr = nc_put_vars(self._grpid, self._varid,
- * # startp, countp, stridep, vldata)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # free the pointer array.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4410
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # free the pointer array.
- * free(vldata) # <<<<<<<<<<<<<<
- * free(startp)
- * free(countp)
- */
- free(__pyx_v_vldata);
- }
- __pyx_L20:;
-
- /* "netCDF4/_netCDF4.pyx":4355
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4411
- * # free the pointer array.
- * free(vldata)
- * free(startp) # <<<<<<<<<<<<<<
- * free(countp)
- * free(stridep)
- */
- free(__pyx_v_startp);
-
- /* "netCDF4/_netCDF4.pyx":4412
- * free(vldata)
- * free(startp)
- * free(countp) # <<<<<<<<<<<<<<
- * free(stridep)
- *
- */
- free(__pyx_v_countp);
-
- /* "netCDF4/_netCDF4.pyx":4413
- * free(startp)
- * free(countp)
- * free(stridep) # <<<<<<<<<<<<<<
- *
- * def _get(self,start,count,stride):
- */
- free(__pyx_v_stridep);
-
- /* "netCDF4/_netCDF4.pyx":4287
- *
- *
- * 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":4415
- * 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_67_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_66_get[] = "Private method to retrieve data from a netCDF variable";
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_67_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;
- 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_ERR(0, 4415, __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_ERR(0, 4415, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get") < 0)) __PYX_ERR(0, 4415, __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_ERR(0, 4415, __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_66_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_66_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;
- PyObject *__pyx_v_i = NULL;
- 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;
- long __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- Py_ssize_t __pyx_t_17;
- __Pyx_RefNannySetupContext("_get", 0);
-
- /* "netCDF4/_netCDF4.pyx":4428
- * # 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":4429
- * # 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":4430
- * 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_ERR(0, 4430, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4430, __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_ERR(0, 4430, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4430, __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_ERR(0, 4430, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4430, __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_ERR(0, 4430, __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":4431
- * 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_ERR(0, 4431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4431, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4432
- * for lendim in count:
- * if lendim == -1:
- * shapeout = shapeout + (1,) # <<<<<<<<<<<<<<
- * squeeze_out = True
- * else:
- */
- __pyx_t_4 = PyNumber_Add(__pyx_v_shapeout, __pyx_tuple__78); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4432, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_shapeout, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4433
- * if lendim == -1:
- * shapeout = shapeout + (1,)
- * squeeze_out = True # <<<<<<<<<<<<<<
- * else:
- * shapeout = shapeout + (lendim,)
- */
- __pyx_v_squeeze_out = 1;
-
- /* "netCDF4/_netCDF4.pyx":4431
- * squeeze_out = False
- * for lendim in count:
- * if lendim == -1: # <<<<<<<<<<<<<<
- * shapeout = shapeout + (1,)
- * squeeze_out = True
- */
- goto __pyx_L5;
- }
-
- /* "netCDF4/_netCDF4.pyx":4435
- * 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_ERR(0, 4435, __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_ERR(0, 4435, __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":4430
- * 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":4437
- * 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_ERR(0, 4437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 4437, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_ndims = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4439
- * ndims = len(self.dimensions)
- * # fill up startp,countp,stridep.
- * negstride = 0 # <<<<<<<<<<<<<<
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- */
- __pyx_v_negstride = 0;
-
- /* "netCDF4/_netCDF4.pyx":4440
- * # fill up startp,countp,stridep.
- * negstride = 0
- * sl = [] # <<<<<<<<<<<<<<
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4440, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_sl = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4441
- * negstride = 0
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<<
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>malloc(sizeof(ptrdiff_t) * ndims)
- */
- __pyx_v_startp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims)));
-
- /* "netCDF4/_netCDF4.pyx":4442
- * sl = []
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<<
- * stridep = <ptrdiff_t *>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":4443
- * startp = <size_t *>malloc(sizeof(size_t) * ndims)
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>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":4444
- * countp = <size_t *>malloc(sizeof(size_t) * ndims)
- * stridep = <ptrdiff_t *>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":4445
- * stridep = <ptrdiff_t *>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)) __PYX_ERR(0, 4445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4445, __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_ERR(0, 4445, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4446
- * 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)) __PYX_ERR(0, 4446, __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_ERR(0, 4446, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- (__pyx_v_countp[__pyx_v_n]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4448
- * 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)) __PYX_ERR(0, 4448, __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_ERR(0, 4448, __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_ERR(0, 4448, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4449
- * # 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":4450
- * 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)) __PYX_ERR(0, 4450, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4450, __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_ERR(0, 4450, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- (__pyx_v_stridep[__pyx_v_n]) = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":4451
- * 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)) __PYX_ERR(0, 4451, __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)) __PYX_ERR(0, 4451, __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)) __PYX_ERR(0, 4451, __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_ERR(0, 4451, __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_ERR(0, 4451, __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_ERR(0, 4451, __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_ERR(0, 4451, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- (__pyx_v_startp[__pyx_v_n]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4452
- * 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)) __PYX_ERR(0, 4452, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __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_ERR(0, 4452, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4453
- * 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__79); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4453, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4448
- * 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":4455
- * 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)) __PYX_ERR(0, 4455, __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_ERR(0, 4455, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- (__pyx_v_startp[__pyx_v_n]) = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4456
- * 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)) __PYX_ERR(0, 4456, __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_ERR(0, 4456, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- (__pyx_v_stridep[__pyx_v_n]) = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":4457
- * 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__80); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4457, __pyx_L1_error)
- }
- __pyx_L8:;
- }
-
- /* "netCDF4/_netCDF4.pyx":4458
- * 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_ERR(0, 4458, __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_ERR(0, 4458, __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_ERR(0, 4458, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_12;
- __pyx_L10_bool_binop_done:;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4459
- * 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_ERR(0, 4459, __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_ERR(0, 4459, __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_ERR(0, 4459, __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_ERR(0, 4459, __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_ERR(0, 4459, __pyx_L1_error)
- __pyx_v_data = ((PyArrayObject *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4461
- * 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_ERR(0, 4461, __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_ERR(0, 4461, __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_ERR(0, 4461, __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_ERR(0, 4461, __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_ERR(0, 4461, __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":4462
- * # 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":4463
- * 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":4462
- * # 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":4461
- * 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":4466
- * 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":4467
- * 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":4466
- * 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":4469
- * 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":4470
- * startp, countp, stridep, data.data)
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError # <<<<<<<<<<<<<<
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
- __PYX_ERR(0, 4470, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4469
- * 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":4471
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * elif self._isvlen:
- */
- __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4472
- * raise IndexError
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4472, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4472, __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_ERR(0, 4472, __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_ERR(0, 4472, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4471
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * elif self._isvlen:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4458
- * 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":4473
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4473, __pyx_L1_error)
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4475
- * 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_ERR(0, 4475, __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_ERR(0, 4475, __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_ERR(0, 4475, __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_ERR(0, 4475, __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_ERR(0, 4475, __pyx_L1_error)
- __pyx_v_data = ((PyArrayObject *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4477
- * 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_ERR(0, 4477, __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_ERR(0, 4477, __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_ERR(0, 4477, __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_ERR(0, 4477, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4478
- * # 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_ERR(0, 4478, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_totelem = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4479
- * 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_ERR(0, 4479, __pyx_L1_error)
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4479, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4482
- * # vlen string (NC_STRING)
- * # allocate pointer array to hold string data.
- * strdata = <char **>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_ERR(0, 4482, __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_ERR(0, 4482, __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_ERR(0, 4482, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_strdata = ((char **)malloc(__pyx_t_8));
-
- /* "netCDF4/_netCDF4.pyx":4484
- * strdata = <char **>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_ERR(0, 4484, __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_ERR(0, 4484, __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_ERR(0, 4484, __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_ERR(0, 4484, __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_ERR(0, 4484, __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":4485
- * # 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":4486
- * 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":4485
- * # 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":4484
- * strdata = <char **>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":4490
- * 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__81, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4490, __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_ERR(0, 4490, __pyx_L1_error)
- }
- __pyx_L24:;
-
- /* "netCDF4/_netCDF4.pyx":4493
- * #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":4494
- * # startp, countp, stridep, strdata)
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError # <<<<<<<<<<<<<<
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
- __PYX_ERR(0, 4494, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4493
- * #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":4495
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4496
- * raise IndexError
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4496, __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_ERR(0, 4496, __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_ERR(0, 4496, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4495
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # loop over elements of object array, fill array with
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4499
- * # loop over elements of object array, fill array with
- * # contents of strdata.
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * data[i] = strdata[i].decode(default_encoding)
- * # reshape the output array
- */
- __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_totelem); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 4499, __pyx_L1_error)
- for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15++) {
- __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4500
- * # contents of strdata.
- * for i from 0<=i<totelem:
- * data[i] = strdata[i].decode(default_encoding) # <<<<<<<<<<<<<<
- * # reshape the output array
- * data = numpy.reshape(data, shapeout)
- */
- __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4500, __pyx_L1_error)
- __pyx_t_6 = __Pyx_PyBytes_FromString((__pyx_v_strdata[__pyx_t_2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4500, __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_ERR(0, 4500, __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_ERR(0, 4500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __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_10 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4500, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_v_i, __pyx_t_10) < 0)) __PYX_ERR(0, 4500, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_15 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 4499, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":4499
- * # loop over elements of object array, fill array with
- * # contents of strdata.
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * data[i] = strdata[i].decode(default_encoding)
- * # reshape the output array
- */
- __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4499, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4502
- * data[i] = strdata[i].decode(default_encoding)
- * # reshape the output array
- * data = numpy.reshape(data, shapeout) # <<<<<<<<<<<<<<
- * # free string data internally allocated in netcdf C lib
- * ierr = nc_free_string(totelem, strdata)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- __pyx_t_2 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
- __pyx_t_2 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(((PyObject *)__pyx_v_data));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, ((PyObject *)__pyx_v_data));
- __Pyx_INCREF(__pyx_v_shapeout);
- __Pyx_GIVEREF(__pyx_v_shapeout);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_v_shapeout);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) __PYX_ERR(0, 4502, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_10));
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4504
- * data = numpy.reshape(data, shapeout)
- * # free string data internally allocated in netcdf C lib
- * ierr = nc_free_string(totelem, strdata) # <<<<<<<<<<<<<<
- * # free the pointer array
- * free(strdata)
- */
- __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_v_totelem); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4504, __pyx_L1_error)
- __pyx_v_ierr = nc_free_string(__pyx_t_8, __pyx_v_strdata);
-
- /* "netCDF4/_netCDF4.pyx":4506
- * ierr = nc_free_string(totelem, strdata)
- * # free the pointer array
- * free(strdata) # <<<<<<<<<<<<<<
- * else:
- * # regular vlen
- */
- free(__pyx_v_strdata);
-
- /* "netCDF4/_netCDF4.pyx":4479
- * data = data.flatten()
- * totelem = PyArray_SIZE(data)
- * if self.dtype == str: # <<<<<<<<<<<<<<
- * # vlen string (NC_STRING)
- * # allocate pointer array to hold string data.
- */
- goto __pyx_L23;
- }
-
- /* "netCDF4/_netCDF4.pyx":4510
- * # regular vlen
- * # allocate struct array to hold vlen data.
- * vldata = <nc_vlen_t *>malloc(totelem*sizeof(nc_vlen_t)) # <<<<<<<<<<<<<<
- * for i in range(totelem):
- * vldata[i].len = 0
- */
- /*else*/ {
- __pyx_t_10 = __Pyx_PyInt_FromSize_t((sizeof(nc_vlen_t))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4510, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_16 = PyNumber_Multiply(__pyx_v_totelem, __pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4510, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_16); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4510, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_v_vldata = ((nc_vlen_t *)malloc(__pyx_t_8));
-
- /* "netCDF4/_netCDF4.pyx":4511
- * # allocate struct array to hold vlen data.
- * vldata = <nc_vlen_t *>malloc(totelem*sizeof(nc_vlen_t))
- * for i in range(totelem): # <<<<<<<<<<<<<<
- * vldata[i].len = 0
- * vldata[i].p = <void*>0
- */
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_INCREF(__pyx_v_totelem);
- __Pyx_GIVEREF(__pyx_v_totelem);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_totelem);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
- __pyx_t_16 = __pyx_t_10; __Pyx_INCREF(__pyx_t_16); __pyx_t_2 = 0;
- __pyx_t_3 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4511, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- for (;;) {
- if (likely(!__pyx_t_3)) {
- if (likely(PyList_CheckExact(__pyx_t_16))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_16)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_10 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4511, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_16)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4511, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- #endif
- }
- } else {
- __pyx_t_10 = __pyx_t_3(__pyx_t_16);
- 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_ERR(0, 4511, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_10);
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4512
- * vldata = <nc_vlen_t *>malloc(totelem*sizeof(nc_vlen_t))
- * for i in range(totelem):
- * vldata[i].len = 0 # <<<<<<<<<<<<<<
- * vldata[i].p = <void*>0
- * # strides all 1 or scalar variable, use get_vara (faster)
- */
- __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4512, __pyx_L1_error)
- (__pyx_v_vldata[__pyx_t_17]).len = 0;
-
- /* "netCDF4/_netCDF4.pyx":4513
- * for i in range(totelem):
- * vldata[i].len = 0
- * vldata[i].p = <void*>0 # <<<<<<<<<<<<<<
- * # strides all 1 or scalar variable, use get_vara (faster)
- * if sum(stride) == ndims or ndims == 0:
- */
- __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4513, __pyx_L1_error)
- (__pyx_v_vldata[__pyx_t_17]).p = ((void *)0);
-
- /* "netCDF4/_netCDF4.pyx":4511
- * # allocate struct array to hold vlen data.
- * vldata = <nc_vlen_t *>malloc(totelem*sizeof(nc_vlen_t))
- * for i in range(totelem): # <<<<<<<<<<<<<<
- * vldata[i].len = 0
- * vldata[i].p = <void*>0
- */
- }
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4515
- * vldata[i].p = <void*>0
- * # 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_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4515, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_INCREF(__pyx_v_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_stride);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4515, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4515, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_10, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4515, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4515, __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_L36_bool_binop_done;
- }
- __pyx_t_12 = ((__pyx_v_ndims == 0) != 0);
- __pyx_t_5 = __pyx_t_12;
- __pyx_L36_bool_binop_done:;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4516
- * # 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":4517
- * 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":4516
- * # 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_L40;
- }
- __pyx_L40:;
- }
- }
-
- /* "netCDF4/_netCDF4.pyx":4515
- * vldata[i].p = <void*>0
- * # 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_L35;
- }
-
- /* "netCDF4/_netCDF4.pyx":4520
- * 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__82, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4520, __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_ERR(0, 4520, __pyx_L1_error)
- }
- __pyx_L35:;
-
- /* "netCDF4/_netCDF4.pyx":4523
- * #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":4524
- * # startp, countp, stridep, vldata)
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError # <<<<<<<<<<<<<<
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
- __PYX_ERR(0, 4524, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4523
- * #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":4525
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4526
- * raise IndexError
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 4526, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4525
- * if ierr == NC_EINVALCOORDS:
- * raise IndexError
- * elif ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * # loop over elements of object array, fill array with
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4529
- * # loop over elements of object array, fill array with
- * # contents of vlarray struct, put array in object array.
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * arrlen = vldata[i].len
- * dataarr = numpy.empty(arrlen, self.dtype)
- */
- __pyx_t_15 = __Pyx_PyInt_As_long(__pyx_v_totelem); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L1_error)
- for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14++) {
- __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4529, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4530
- * # contents of vlarray struct, put array in object array.
- * for i from 0<=i<totelem:
- * arrlen = vldata[i].len # <<<<<<<<<<<<<<
- * dataarr = numpy.empty(arrlen, self.dtype)
- * #dataarr.data = <char *>vldata[i].p
- */
- __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4530, __pyx_L1_error)
- __pyx_t_8 = (__pyx_v_vldata[__pyx_t_2]).len;
- __pyx_v_arrlen = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4531
- * for i from 0<=i<totelem:
- * arrlen = vldata[i].len
- * dataarr = numpy.empty(arrlen, self.dtype) # <<<<<<<<<<<<<<
- * #dataarr.data = <char *>vldata[i].p
- * memcpy(<void*>dataarr.data, vldata[i].p, dataarr.nbytes)
- */
- __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_arrlen); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __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_ERR(0, 4531, __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_16);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_16);
- __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_16 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4531, __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_ERR(0, 4531, __pyx_L1_error)
- __Pyx_XDECREF_SET(__pyx_v_dataarr, ((PyArrayObject *)__pyx_t_6));
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4533
- * dataarr = numpy.empty(arrlen, self.dtype)
- * #dataarr.data = <char *>vldata[i].p
- * memcpy(<void*>dataarr.data, vldata[i].p, dataarr.nbytes) # <<<<<<<<<<<<<<
- * data[i] = dataarr
- * # reshape the output array
- */
- __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4533, __pyx_L1_error)
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dataarr), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4533, __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_ERR(0, 4533, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- memcpy(((void *)__pyx_v_dataarr->data), (__pyx_v_vldata[__pyx_t_2]).p, __pyx_t_8);
-
- /* "netCDF4/_netCDF4.pyx":4534
- * #dataarr.data = <char *>vldata[i].p
- * memcpy(<void*>dataarr.data, vldata[i].p, dataarr.nbytes)
- * data[i] = dataarr # <<<<<<<<<<<<<<
- * # reshape the output array
- * data = numpy.reshape(data, shapeout)
- */
- if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_v_i, ((PyObject *)__pyx_v_dataarr)) < 0)) __PYX_ERR(0, 4534, __pyx_L1_error)
- __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 4529, __pyx_L1_error)
- }
-
- /* "netCDF4/_netCDF4.pyx":4529
- * # loop over elements of object array, fill array with
- * # contents of vlarray struct, put array in object array.
- * for i from 0<=i<totelem: # <<<<<<<<<<<<<<
- * arrlen = vldata[i].len
- * dataarr = numpy.empty(arrlen, self.dtype)
- */
- __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4529, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4536
- * 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_ERR(0, 4536, __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_ERR(0, 4536, __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_16 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4536, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 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_16, 0+__pyx_t_2, ((PyObject *)__pyx_v_data));
- __Pyx_INCREF(__pyx_v_shapeout);
- __Pyx_GIVEREF(__pyx_v_shapeout);
- PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_2, __pyx_v_shapeout);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4536, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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_ERR(0, 4536, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_6));
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4538
- * 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_ERR(0, 4538, __pyx_L1_error)
- __pyx_v_ierr = nc_free_vlens(__pyx_t_8, __pyx_v_vldata);
-
- /* "netCDF4/_netCDF4.pyx":4540
- * 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":4473
- * elif ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * elif self._isvlen: # <<<<<<<<<<<<<<
- * # allocate array of correct primitive type.
- * data = numpy.empty(shapeout, 'O')
- */
- }
- __pyx_L9:;
-
- /* "netCDF4/_netCDF4.pyx":4541
- * # free the pointer array
- * free(vldata)
- * free(startp) # <<<<<<<<<<<<<<
- * free(countp)
- * free(stridep)
- */
- free(__pyx_v_startp);
-
- /* "netCDF4/_netCDF4.pyx":4542
- * free(vldata)
- * free(startp)
- * free(countp) # <<<<<<<<<<<<<<
- * free(stridep)
- * if negstride:
- */
- free(__pyx_v_countp);
-
- /* "netCDF4/_netCDF4.pyx":4543
- * free(startp)
- * free(countp)
- * free(stridep) # <<<<<<<<<<<<<<
- * if negstride:
- * # reverse data along axes with negative strides.
- */
- free(__pyx_v_stridep);
-
- /* "netCDF4/_netCDF4.pyx":4544
- * 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":4546
- * if negstride:
- * # reverse data along axes with negative strides.
- * data = data[sl].copy() # make a copy so data is contiguous. # <<<<<<<<<<<<<<
- * # netcdf-c always returns data in native byte order,
- * # regardless of variable endian-ness. Here we swap the
- */
- if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 4546, __pyx_L1_error) }
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_v_sl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
- }
- }
- if (__pyx_t_4) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4546, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4546, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) __PYX_ERR(0, 4546, __pyx_L1_error)
- __Pyx_XDECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_6));
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4544
- * 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":4552
- * # dtype of the returned numpy array matches the variable dtype.
- * # (pull request #555, issue #554).
- * if not data.dtype.isnative: # <<<<<<<<<<<<<<
- * data.byteswap(True) # in-place byteswap
- * if not self.dimensions:
- */
- if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 4552, __pyx_L1_error) }
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isnative); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4552, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_12 = ((!__pyx_t_5) != 0);
- if (__pyx_t_12) {
-
- /* "netCDF4/_netCDF4.pyx":4553
- * # (pull request #555, issue #554).
- * if not data.dtype.isnative:
- * data.byteswap(True) # in-place byteswap # <<<<<<<<<<<<<<
- * if not self.dimensions:
- * return data[0] # a scalar
- */
- if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 4553, __pyx_L1_error) }
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4552
- * # dtype of the returned numpy array matches the variable dtype.
- * # (pull request #555, issue #554).
- * if not data.dtype.isnative: # <<<<<<<<<<<<<<
- * data.byteswap(True) # in-place byteswap
- * if not self.dimensions:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4554
- * if not data.dtype.isnative:
- * data.byteswap(True) # in-place byteswap
- * 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_ERR(0, 4554, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4554, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_5 = ((!__pyx_t_12) != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4555
- * data.byteswap(True) # in-place byteswap
- * 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_ERR(0, 4555, __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)) __PYX_ERR(0, 4555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":4554
- * if not data.dtype.isnative:
- * data.byteswap(True) # in-place byteswap
- * if not self.dimensions: # <<<<<<<<<<<<<<
- * return data[0] # a scalar
- * elif squeeze_out:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4556
- * if not self.dimensions:
- * return data[0] # a scalar
- * elif squeeze_out: # <<<<<<<<<<<<<<
- * return numpy.squeeze(data)
- * else:
- */
- __pyx_t_5 = (__pyx_v_squeeze_out != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4557
- * return data[0] # a scalar
- * elif squeeze_out:
- * return numpy.squeeze(data) # <<<<<<<<<<<<<<
- * else:
- * return data
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4557, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4557, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 4557, __pyx_L1_error) }
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_16)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_16);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_data)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4557, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4557, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_16); __pyx_t_16 = 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_ERR(0, 4557, __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":4556
- * if not self.dimensions:
- * return data[0] # a scalar
- * elif squeeze_out: # <<<<<<<<<<<<<<
- * return numpy.squeeze(data)
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4559
- * return numpy.squeeze(data)
- * else:
- * return data # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 4559, __pyx_L1_error) }
- __Pyx_INCREF(((PyObject *)__pyx_v_data));
- __pyx_r = ((PyObject *)__pyx_v_data);
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4415
- * 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_16);
- __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_XDECREF(__pyx_v_i);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":4561
- * return data
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a Variable object.
- * raise NotImplementedError('Variable is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_69__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_69__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_68__reduce__(((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_68__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4563
- * def __reduce__(self):
- * # raise error is user tries to pickle a Variable object.
- * raise NotImplementedError('Variable is not picklable') # <<<<<<<<<<<<<<
- *
- * # Compound datatype support.
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4563, __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_ERR(0, 4563, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4561
- * return data
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a Variable object.
- * raise NotImplementedError('Variable is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":2911
- * **`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,\
- */
-
-/* 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;
- __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_ERR(0, 2911, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2911, __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;
- __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_ERR(0, 2911, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2911, __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;
- __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_ERR(0, 2911, __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;
- __Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2911, __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":2912
- * """
- * cdef public int _varid, _grpid, _nunlimdim
- * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\ # <<<<<<<<<<<<<<
- * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype,\
- * __orthogonal_indexing__, _has_lsd
- */
-
-/* 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":2913
- * cdef public int _varid, _grpid, _nunlimdim
- * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\
- * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype,\ # <<<<<<<<<<<<<<
- * __orthogonal_indexing__, _has_lsd
- * # Docstrings for class variables (used by pdoc).
- */
-
-/* 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;
-}
-
-/* "netCDF4/_netCDF4.pyx":2914
- * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\
- * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype,\
- * __orthogonal_indexing__, _has_lsd # <<<<<<<<<<<<<<
- * # Docstrings for class variables (used by pdoc).
- * __pdoc__['Variable.dimensions'] = \
- */
-
-/* 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;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_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_has_lsd___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_has_lsd___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->_has_lsd);
- __pyx_r = __pyx_v_self->_has_lsd;
- 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_has_lsd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_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_has_lsd_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_has_lsd_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->_has_lsd);
- __Pyx_DECREF(__pyx_v_self->_has_lsd);
- __pyx_v_self->_has_lsd = __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_has_lsd_5__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_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_has_lsd_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_has_lsd_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->_has_lsd);
- __Pyx_DECREF(__pyx_v_self->_has_lsd);
- __pyx_v_self->_has_lsd = Py_None;
-
- /* function exit code */
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":4584
- * __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 **`datatyp [...]
-#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_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_ERR(0, 4584, __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_ERR(0, 4584, __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_ERR(0, 4584, __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_ERR(0, 4584, __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;
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_dt);
-
- /* "netCDF4/_netCDF4.pyx":4609
- * """
- * 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_ERR(0, 4609, __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_ERR(0, 4609, __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_ERR(0, 4609, __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_ERR(0, 4609, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_align, Py_True) < 0) __PYX_ERR(0, 4609, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4609, __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":4610
- * 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_ERR(0, 4610, __pyx_L1_error)
- __pyx_t_6 = (__pyx_t_5 != 0);
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":4611
- * 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)) __PYX_ERR(0, 4611, __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_ERR(0, 4611, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_xtype = __pyx_t_7;
-
- /* "netCDF4/_netCDF4.pyx":4610
- * cdef nc_type xtype
- * dt = numpy.dtype(dt,align=True)
- * if 'typeid' in kwargs: # <<<<<<<<<<<<<<
- * xtype = kwargs['typeid']
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4613
- * 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_ERR(0, 4613, __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_ERR(0, 4613, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_xtype = __pyx_t_7;
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":4614
- * 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":4615
- * 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":4616
- * 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":4584
- * __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":4618
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4619
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4619, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4619, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4620
- * 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_ERR(0, 4620, __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_ERR(0, 4620, __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_ERR(0, 4620, __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":4619
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4622
- * 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_ERR(0, 4622, __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_ERR(0, 4622, __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_ERR(0, 4622, __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_ERR(0, 4622, __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_ERR(0, 4622, __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_ERR(0, 4622, __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_ERR(0, 4622, __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":4618
- * 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":4624
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4625
- *
- * 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_ERR(0, 4625, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":4626
- * def __unicode__(self):
- * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\
- * (self.name,self.dtype) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4626, __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":4625
- *
- * 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_ERR(0, 4625, __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_ERR(0, 4625, __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":4624
- * 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":4628
- * (self.name,self.dtype)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a CompoundType object.
- * raise NotImplementedError('CompoundType is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_6__reduce__(((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_6__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4630
- * def __reduce__(self):
- * # raise error is user tries to pickle a CompoundType object.
- * raise NotImplementedError('CompoundType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_compound(grp, object dt, object dtype_name):
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4630, __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_ERR(0, 4630, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4628
- * (self.name,self.dtype)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a CompoundType object.
- * raise NotImplementedError('CompoundType is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":4578
- * 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;
- __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_ERR(0, 4578, __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;
- __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_ERR(0, 4578, __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":4579
- * """
- * 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":4632
- * raise NotImplementedError('CompoundType is not picklable')
- *
- * 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;
- __Pyx_RefNannySetupContext("_def_compound", 0);
-
- /* "netCDF4/_netCDF4.pyx":4641
- * 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_ERR(0, 4641, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4642
- * 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_ERR(0, 4642, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4643
- * 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_ERR(0, 4643, __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_ERR(0, 4643, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_size = __pyx_t_3;
-
- /* "netCDF4/_netCDF4.pyx":4644
- * namstring = bytestr
- * size = dt.itemsize
- * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4644, __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_ERR(0, 4644, __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":4645
- * size = dt.itemsize
- * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4646
- * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4646, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4646, __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_ERR(0, 4646, __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_ERR(0, 4646, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4645
- * size = dt.itemsize
- * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * names = list(dt.fields.keys())
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4647
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4647, __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_ERR(0, 4647, __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_ERR(0, 4647, __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_ERR(0, 4647, __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_ERR(0, 4647, __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":4648
- * raise RuntimeError((<char *>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_ERR(0, 4648, __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_ERR(0, 4648, __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_ERR(0, 4648, __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_ERR(0, 4648, __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_ERR(0, 4648, __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_ERR(0, 4648, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4648, __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_ERR(0, 4648, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4648, __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_ERR(0, 4648, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4648, __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_ERR(0, 4648, __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)) __PYX_ERR(0, 4648, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 4648, __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":4649
- * 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_ERR(0, 4649, __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_ERR(0, 4649, __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_ERR(0, 4649, __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_ERR(0, 4649, __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_ERR(0, 4649, __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_ERR(0, 4649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4649, __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_ERR(0, 4649, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4649, __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_ERR(0, 4649, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4649, __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_ERR(0, 4649, __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)) __PYX_ERR(0, 4649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 4649, __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":4652
- * # 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_ERR(0, 4652, __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_ERR(0, 4652, __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_ERR(0, 4652, __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":4653
- * # (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_ERR(0, 4653, __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_ERR(0, 4653, __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_ERR(0, 4653, __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":4654
- * 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_ERR(0, 4654, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4655
- * 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_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4655, __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_ERR(0, 4655, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4655, __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_ERR(0, 4655, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4655, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __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_ERR(0, 4655, __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":4656
- * 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_ERR(0, 4656, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4657
- * 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_ERR(0, 4657, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4658
- * 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_ERR(0, 4658, __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_ERR(0, 4658, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4659
- * namstring = bytestr
- * if format.kind != 'V': # scalar primitive type
- * try: # <<<<<<<<<<<<<<
- * xtype_tmp = _nptonctype[format.str[1:]]
- * except KeyError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":4660
- * 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_ERR(0, 4660, __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_ERR(0, 4660, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_12, 1, 0, NULL, NULL, &__pyx_slice__86, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4660, __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)) __PYX_ERR(0, 4660, __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_ERR(0, 4660, __pyx_L13_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_xtype_tmp = __pyx_t_18;
-
- /* "netCDF4/_netCDF4.pyx":4659
- * 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_PyThreadState_assign
- __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":4661
- * 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 = __Pyx_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_ERR(0, 4661, __pyx_L15_except_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":4662
- * 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__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4662, __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_ERR(0, 4662, __pyx_L15_except_error)
- }
- goto __pyx_L15_except_error;
- __pyx_L15_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":4659
- * namstring = bytestr
- * if format.kind != 'V': # scalar primitive type
- * try: # <<<<<<<<<<<<<<
- * xtype_tmp = _nptonctype[format.str[1:]]
- * except KeyError:
- */
- __Pyx_PyThreadState_assign
- __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":4663
- * 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_ERR(0, 4663, __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_ERR(0, 4663, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4664
- * raise ValueError('Unsupported compound type element')
- * ierr = nc_insert_compound(grp._grpid, xtype, namstring,
- * offset, xtype_tmp) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4665
- * ierr = nc_insert_compound(grp._grpid, xtype, namstring,
- * offset, xtype_tmp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4666
- * offset, xtype_tmp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4666, __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_ERR(0, 4666, __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_ERR(0, 4666, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4665
- * ierr = nc_insert_compound(grp._grpid, xtype, namstring,
- * offset, xtype_tmp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4658
- * 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":4668
- * raise RuntimeError((<char *>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_ERR(0, 4668, __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_ERR(0, 4668, __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_ERR(0, 4668, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4670
- * 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_ERR(0, 4670, __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_ERR(0, 4670, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_xtype_tmp = __pyx_t_18;
-
- /* "netCDF4/_netCDF4.pyx":4671
- * # 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_ERR(0, 4671, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_8);
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4672
- * 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_ERR(0, 4672, __pyx_L1_error)
- __pyx_v_nested_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4673
- * 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_ERR(0, 4673, __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_ERR(0, 4673, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4675
- * ierr = nc_insert_compound(grp._grpid, xtype,\
- * nested_namstring,\
- * offset, xtype_tmp) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4676
- * nested_namstring,\
- * offset, xtype_tmp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4677
- * offset, xtype_tmp)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4677, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4677, __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_ERR(0, 4677, __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_ERR(0, 4677, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4676
- * nested_namstring,\
- * offset, xtype_tmp)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else: # array compound element
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4668
- * raise RuntimeError((<char *>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":4679
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else: # array compound element
- * ndims = len(format.shape) # <<<<<<<<<<<<<<
- * dim_sizes = <int *>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_ERR(0, 4679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_19 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 4679, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_ndims = __pyx_t_19;
-
- /* "netCDF4/_netCDF4.pyx":4680
- * else: # array compound element
- * ndims = len(format.shape)
- * dim_sizes = <int *>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":4681
- * ndims = len(format.shape)
- * dim_sizes = <int *>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":4682
- * dim_sizes = <int *>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_ERR(0, 4682, __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)) __PYX_ERR(0, 4682, __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_ERR(0, 4682, __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":4683
- * 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_ERR(0, 4683, __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)) __PYX_ERR(0, 4683, __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_ERR(0, 4683, __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)) __PYX_ERR(0, 4683, __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_ERR(0, 4683, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4684
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":4685
- * 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_ERR(0, 4685, __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_ERR(0, 4685, __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)) __PYX_ERR(0, 4685, __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_ERR(0, 4685, __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__88, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4685, __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)) __PYX_ERR(0, 4685, __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_ERR(0, 4685, __pyx_L29_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_xtype_tmp = __pyx_t_18;
-
- /* "netCDF4/_netCDF4.pyx":4684
- * 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_PyThreadState_assign
- __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":4686
- * 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 = __Pyx_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_ERR(0, 4686, __pyx_L31_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netCDF4/_netCDF4.pyx":4687
- * 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__89, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4687, __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_ERR(0, 4687, __pyx_L31_except_error)
- }
- goto __pyx_L31_except_error;
- __pyx_L31_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":4684
- * 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_PyThreadState_assign
- __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":4688
- * 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_ERR(0, 4688, __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_ERR(0, 4688, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4689
- * 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((<char *>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":4690
- * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring,
- * offset,xtype_tmp,ndims,dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4691
- * offset,xtype_tmp,ndims,dim_sizes)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4691, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4691, __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_ERR(0, 4691, __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_ERR(0, 4691, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4690
- * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring,
- * offset,xtype_tmp,ndims,dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else: # nested array compound type.
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4683
- * 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":4694
- * 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_ERR(0, 4694, __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)) __PYX_ERR(0, 4694, __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_ERR(0, 4694, __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_ERR(0, 4694, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_xtype_tmp = __pyx_t_18;
-
- /* "netCDF4/_netCDF4.pyx":4695
- * # 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_ERR(0, 4695, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_8);
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4696
- * 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_ERR(0, 4696, __pyx_L1_error)
- __pyx_v_nested_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4697
- * 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_ERR(0, 4697, __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_ERR(0, 4697, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4700
- * nested_namstring,\
- * offset,xtype_tmp,\
- * ndims,dim_sizes) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4701
- * offset,xtype_tmp,\
- * ndims,dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(dim_sizes)
- */
- __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":4702
- * ndims,dim_sizes)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4702, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4702, __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_ERR(0, 4702, __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_ERR(0, 4702, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4701
- * offset,xtype_tmp,\
- * ndims,dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(dim_sizes)
- */
- }
- }
- __pyx_L28:;
-
- /* "netCDF4/_netCDF4.pyx":4703
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * free(dim_sizes) # <<<<<<<<<<<<<<
- * return xtype
- *
- */
- free(__pyx_v_dim_sizes);
- }
- __pyx_L24:;
- }
- __pyx_L12:;
-
- /* "netCDF4/_netCDF4.pyx":4655
- * 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":4704
- * raise RuntimeError((<char *>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_ERR(0, 4704, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":4632
- * raise NotImplementedError('CompoundType is not picklable')
- *
- * 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":4706
- * 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;
- __Pyx_RefNannySetupContext("_find_cmptype", 0);
-
- /* "netCDF4/_netCDF4.pyx":4710
- * # 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":4711
- * 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_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4711, __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_ERR(0, 4711, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4711, __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_ERR(0, 4711, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __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_ERR(0, 4711, __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":4712
- * 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_ERR(0, 4712, __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_ERR(0, 4712, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_xtype = __pyx_t_9;
-
- /* "netCDF4/_netCDF4.pyx":4713
- * 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_ERR(0, 4713, __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_ERR(0, 4713, __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_ERR(0, 4713, __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":4714
- * 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_ERR(0, 4714, __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_ERR(0, 4714, __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_ERR(0, 4714, __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_ERR(0, 4714, __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_ERR(0, 4714, __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_ERR(0, 4714, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4714, __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_ERR(0, 4714, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4714, __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_ERR(0, 4714, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4714, __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_ERR(0, 4714, __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)) __PYX_ERR(0, 4714, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 4714, __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":4715
- * 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_ERR(0, 4715, __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_ERR(0, 4715, __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_ERR(0, 4715, __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_ERR(0, 4715, __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_ERR(0, 4715, __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_ERR(0, 4715, __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_ERR(0, 4715, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4715, __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_ERR(0, 4715, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4715, __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_ERR(0, 4715, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4715, __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_ERR(0, 4715, __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)) __PYX_ERR(0, 4715, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 4715, __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":4718
- * # 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_ERR(0, 4718, __pyx_L1_error)
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 4718, __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_ERR(0, 4718, __pyx_L1_error)
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 4718, __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":4719
- * # by netcdf lib).
- * if names1==names2 and formats1==formats2:
- * match = True # <<<<<<<<<<<<<<
- * break
- * if not match:
- */
- __pyx_v_match = 1;
-
- /* "netCDF4/_netCDF4.pyx":4720
- * if names1==names2 and formats1==formats2:
- * match = True
- * break # <<<<<<<<<<<<<<
- * if not match:
- * try:
- */
- goto __pyx_L4_break;
-
- /* "netCDF4/_netCDF4.pyx":4718
- * # 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":4711
- * 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":4721
- * 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":4722
- * break
- * if not match:
- * try: # <<<<<<<<<<<<<<
- * parent_grp = grp.parent
- * except AttributeError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":4723
- * 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_ERR(0, 4723, __pyx_L15_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_parent_grp = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4722
- * 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_PyThreadState_assign
- __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":4724
- * 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 = __Pyx_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_ERR(0, 4724, __pyx_L17_except_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":4725
- * 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__90, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4725, __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_ERR(0, 4725, __pyx_L17_except_error)
- }
- goto __pyx_L17_except_error;
- __pyx_L17_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":4722
- * break
- * if not match:
- * try: # <<<<<<<<<<<<<<
- * parent_grp = grp.parent
- * except AttributeError:
- */
- __Pyx_PyThreadState_assign
- __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":4726
- * 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":4727
- * 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__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4727, __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_ERR(0, 4727, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4726
- * 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":4729
- * 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_ERR(0, 4729, __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_ERR(0, 4729, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_xtype = __pyx_t_9;
- }
-
- /* "netCDF4/_netCDF4.pyx":4721
- * match = True
- * break
- * if not match: # <<<<<<<<<<<<<<
- * try:
- * parent_grp = grp.parent
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4730
- * 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_ERR(0, 4730, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":4706
- * 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":4732
- * 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;
- __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":4745
- * 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_ERR(0, 4745, __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_ERR(0, 4745, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4746
- * # 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":4747
- * _grpid = group._grpid
- * with nogil:
- * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4746
- * # 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":4748
- * with nogil:
- * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4749
- * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4749, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4749, __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_ERR(0, 4749, __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_ERR(0, 4749, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4748
- * with nogil:
- * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = cmp_namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4750
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4750, __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_ERR(0, 4750, __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_ERR(0, 4750, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4750, __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_ERR(0, 4750, __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_ERR(0, 4750, __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":4752
- * 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_ERR(0, 4752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_names = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4753
- * # loop over fields.
- * names = []
- * formats = [] # <<<<<<<<<<<<<<
- * offsets = []
- * for nf from 0 <= nf < nfields:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4753, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_formats = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4754
- * names = []
- * formats = []
- * offsets = [] # <<<<<<<<<<<<<<
- * for nf from 0 <= nf < nfields:
- * with nogil:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4754, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_offsets = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4755
- * 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":4756
- * 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":4757
- * 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":4756
- * 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":4765
- * &numdims,
- * NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dim_sizes = <int *>malloc(sizeof(int) * numdims)
- */
- __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_3) {
-
- /* "netCDF4/_netCDF4.pyx":4766
- * NULL)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<<
- * dim_sizes = <int *>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_ERR(0, 4766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4766, __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_ERR(0, 4766, __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_ERR(0, 4766, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4765
- * &numdims,
- * NULL)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dim_sizes = <int *>malloc(sizeof(int) * numdims)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4767
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dim_sizes = <int *>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":4768
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dim_sizes = <int *>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":4769
- * dim_sizes = <int *>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":4768
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * dim_sizes = <int *>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":4777
- * &numdims,
- * dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4778
- * dim_sizes)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4778, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4778, __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_ERR(0, 4778, __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_ERR(0, 4778, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4777
- * &numdims,
- * dim_sizes)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * field_name = field_namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4779
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4779, __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_ERR(0, 4779, __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_ERR(0, 4779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4779, __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_ERR(0, 4779, __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_ERR(0, 4779, __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":4780
- * raise RuntimeError((<char *>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_ERR(0, 4780, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4781
- * 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_ERR(0, 4781, __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_ERR(0, 4781, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4783
- * 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":4784
- * # 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":4785
- * 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":4786
- * 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_ERR(0, 4786, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4786, __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_ERR(0, 4786, __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":4784
- * # 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":4787
- * 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":4789
- * 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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":4790
- * # 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_ERR(0, 4790, __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)) __PYX_ERR(0, 4790, __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":4791
- * 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":4792
- * 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_ERR(0, 4792, __pyx_L24_error) }
- __pyx_t_10 = PyNumber_Add(__pyx_v_endian, __pyx_v_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4792, __pyx_L24_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_XDECREF_SET(__pyx_v_format, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4791
- * try:
- * field_type = _nctonptype[field_typeid]
- * if endian is not None: # <<<<<<<<<<<<<<
- * format = endian + format
- * except KeyError:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4789
- * 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_PyThreadState_assign
- __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":4793
- * if endian is not None:
- * format = endian + format
- * except KeyError: # <<<<<<<<<<<<<<
- * with nogil:
- * ierr = nc_inq_user_type(_grpid,
- */
- __pyx_t_2 = __Pyx_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_ERR(0, 4793, __pyx_L26_except_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netCDF4/_netCDF4.pyx":4794
- * 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":4795
- * 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":4794
- * 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":4797
- * 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":4799
- * 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_ERR(0, 4799, __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":4797
- * 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":4801
- * 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__92, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4801, __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_ERR(0, 4801, __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":4789
- * 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_PyThreadState_assign
- __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_PyThreadState_assign
- __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":4802
- * 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_ERR(0, 4802, __pyx_L1_error)
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 4802, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_16) {
-
- /* "netCDF4/_netCDF4.pyx":4803
- * 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_ERR(0, 4803, __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_ERR(0, 4803, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4802
- * 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":4805
- * 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_ERR(0, 4805, __pyx_L1_error)
- }
- __pyx_L41:;
- }
-
- /* "netCDF4/_netCDF4.pyx":4807
- * 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_ERR(0, 4807, __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_ERR(0, 4807, __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_ERR(0, 4807, __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":4808
- * # 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_ERR(0, 4808, __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_ERR(0, 4808, __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_ERR(0, 4808, __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":4809
- * 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_ERR(0, 4809, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4811
- * 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_ERR(0, 4811, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(0, 4811, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_formats, __pyx_v_formats) < 0) __PYX_ERR(0, 4811, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_offsets, __pyx_v_offsets) < 0) __PYX_ERR(0, 4811, __pyx_L1_error)
- __pyx_v_dtype_dict = ((PyObject*)__pyx_t_8);
- __pyx_t_8 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4812
- * # 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_ERR(0, 4812, __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_ERR(0, 4812, __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_ERR(0, 4812, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_typeid, __pyx_t_10) < 0) __PYX_ERR(0, 4812, __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_ERR(0, 4812, __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":4732
- * 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":4832
- * __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`***: `netCD [...]
-#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_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_ERR(0, 4832, __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_ERR(0, 4832, __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_ERR(0, 4832, __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_ERR(0, 4832, __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 *);
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_dt);
-
- /* "netCDF4/_netCDF4.pyx":4851
- * """
- * 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_ERR(0, 4851, __pyx_L1_error)
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4852
- * 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)) __PYX_ERR(0, 4852, __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_ERR(0, 4852, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_xtype = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":4851
- * """
- * cdef nc_type xtype
- * if 'typeid' in kwargs: # <<<<<<<<<<<<<<
- * xtype = kwargs['typeid']
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4854
- * 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_ERR(0, 4854, __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_ERR(0, 4854, __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_ERR(0, 4854, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4854, __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_ERR(0, 4854, __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_ERR(0, 4854, __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_ERR(0, 4854, __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_ERR(0, 4854, __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":4855
- * 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":4856
- * 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":4857
- * 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_ERR(0, 4857, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4857, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4858
- * 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":4857
- * self._nc_type = xtype
- * self.dtype = dt
- * if dt == str: # <<<<<<<<<<<<<<
- * self.name = None
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "netCDF4/_netCDF4.pyx":4860
- * 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":4832
- * __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":4862
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4863
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4863, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4863, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4864
- * 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_ERR(0, 4864, __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_ERR(0, 4864, __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_ERR(0, 4864, __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":4863
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4866
- * 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_ERR(0, 4866, __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_ERR(0, 4866, __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_ERR(0, 4866, __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_ERR(0, 4866, __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_ERR(0, 4866, __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_ERR(0, 4866, __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_ERR(0, 4866, __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":4862
- * 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":4868
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4869
- *
- * 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_ERR(0, 4869, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4869, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4870
- * 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_ERR(0, 4870, __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_ERR(0, 4870, __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":4869
- *
- * def __unicode__(self):
- * if self.dtype == str: # <<<<<<<<<<<<<<
- * return repr(type(self))+': string type'
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4872
- * 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_ERR(0, 4872, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netCDF4/_netCDF4.pyx":4873
- * else:
- * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\
- * (self.name, self.dtype) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4873, __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":4872
- * 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_ERR(0, 4872, __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_ERR(0, 4872, __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":4868
- * 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":4875
- * (self.name, self.dtype)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a VLType object.
- * raise NotImplementedError('VLType is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_6__reduce__(((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_6__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4877
- * def __reduce__(self):
- * # raise error is user tries to pickle a VLType object.
- * raise NotImplementedError('VLType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_vlen(grp, object dt, object dtype_name):
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4877, __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_ERR(0, 4877, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4875
- * (self.name, self.dtype)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a VLType object.
- * raise NotImplementedError('VLType is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.VLType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":4826
- * 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;
- __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_ERR(0, 4826, __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;
- __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_ERR(0, 4826, __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":4827
- * """
- * 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":4879
- * raise NotImplementedError('VLType is not picklable')
- *
- * 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;
- __Pyx_RefNannySetupContext("_def_vlen", 0);
- __Pyx_INCREF(__pyx_v_dt);
-
- /* "netCDF4/_netCDF4.pyx":4887
- * 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_ERR(0, 4887, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4887, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4888
- * 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":4887
- * 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":4891
- * # 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_ERR(0, 4891, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4892
- * 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_ERR(0, 4892, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_3;
-
- /* "netCDF4/_netCDF4.pyx":4893
- * 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_ERR(0, 4893, __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_ERR(0, 4893, __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_ERR(0, 4893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4893, __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_ERR(0, 4893, __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":4894
- * 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_ERR(0, 4894, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__94, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4894, __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_ERR(0, 4894, __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_ERR(0, 4894, __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":4897
- * # 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_ERR(0, 4897, __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_ERR(0, 4897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__95, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4897, __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)) __PYX_ERR(0, 4897, __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_ERR(0, 4897, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_xtype_tmp = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":4898
- * # 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4898, __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_ERR(0, 4898, __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":4899
- * xtype_tmp = _nptonctype[dt.str[1:]]
- * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype);
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":4900
- * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype);
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4900, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4900, __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_ERR(0, 4900, __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_ERR(0, 4900, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4899
- * xtype_tmp = _nptonctype[dt.str[1:]]
- * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype);
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4894
- * 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":4902
- * raise RuntimeError((<char *>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__96, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4902, __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_ERR(0, 4902, __pyx_L1_error)
- }
- __pyx_L4:;
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":4903
- * 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_ERR(0, 4903, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4903, __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":4879
- * raise NotImplementedError('VLType is not picklable')
- *
- * 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":4905
- * 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;
- __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":4914
- * 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_ERR(0, 4914, __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_ERR(0, 4914, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":4915
- * 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":4916
- * _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":4917
- * if xtype == NC_STRING:
- * dt = str
- * name = None # <<<<<<<<<<<<<<
- * else:
- * with nogil:
- */
- __Pyx_INCREF(Py_None);
- __pyx_v_name = Py_None;
-
- /* "netCDF4/_netCDF4.pyx":4915
- * 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":4919
- * 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":4920
- * else:
- * with nogil:
- * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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":4919
- * 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":4921
- * with nogil:
- * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":4922
- * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4922, __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_ERR(0, 4922, __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_ERR(0, 4922, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4921
- * with nogil:
- * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = vl_namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4923
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 4923, __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_ERR(0, 4923, __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_ERR(0, 4923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4923, __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_ERR(0, 4923, __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_ERR(0, 4923, __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":4924
- * raise RuntimeError((<char *>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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":4925
- * 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_ERR(0, 4925, __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)) __PYX_ERR(0, 4925, __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":4926
- * 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_ERR(0, 4926, __pyx_L8_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6);
- __pyx_t_6 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":4927
- * 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_ERR(0, 4927, __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_ERR(0, 4927, __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_ERR(0, 4927, __pyx_L8_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4927, __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_ERR(0, 4927, __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":4924
- * raise RuntimeError((<char *>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_PyThreadState_assign
- __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":4928
- * 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 = __Pyx_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_ERR(0, 4928, __pyx_L10_except_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":4929
- * 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__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4929, __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_ERR(0, 4929, __pyx_L10_except_error)
- }
- goto __pyx_L10_except_error;
- __pyx_L10_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":4924
- * raise RuntimeError((<char *>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_PyThreadState_assign
- __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":4930
- * 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_ERR(0, 4930, __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_ERR(0, 4930, __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_ERR(0, 4930, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_typeid, __pyx_t_6) < 0) __PYX_ERR(0, 4930, __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_ERR(0, 4930, __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":4905
- * 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":4952
- * __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 [...]
-#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_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_ERR(0, 4952, __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_ERR(0, 4952, __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_ERR(0, 4952, __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_ERR(0, 4952, __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_ERR(0, 4952, __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 *);
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_dt);
-
- /* "netCDF4/_netCDF4.pyx":4974
- * """
- * 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_ERR(0, 4974, __pyx_L1_error)
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4975
- * 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)) __PYX_ERR(0, 4975, __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_ERR(0, 4975, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_xtype = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":4974
- * """
- * cdef nc_type xtype
- * if 'typeid' in kwargs: # <<<<<<<<<<<<<<
- * xtype = kwargs['typeid']
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":4977
- * 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_ERR(0, 4977, __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_ERR(0, 4977, __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_ERR(0, 4977, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4977, __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_ERR(0, 4977, __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_ERR(0, 4977, __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_ERR(0, 4977, __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_ERR(0, 4977, __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":4978
- * 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":4979
- * 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":4980
- * 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":4981
- * 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":4952
- * __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":4983
- * 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;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4984
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4984, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":4985
- * 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_ERR(0, 4985, __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_ERR(0, 4985, __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_ERR(0, 4985, __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":4984
- *
- * def __repr__(self):
- * if python3: # <<<<<<<<<<<<<<
- * return self.__unicode__()
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":4987
- * 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_ERR(0, 4987, __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_ERR(0, 4987, __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_ERR(0, 4987, __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_ERR(0, 4987, __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_ERR(0, 4987, __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_ERR(0, 4987, __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_ERR(0, 4987, __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":4983
- * 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":4989
- * 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;
- __Pyx_RefNannySetupContext("__unicode__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4990
- *
- * 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_ERR(0, 4990, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":4992
- * return repr(type(self))+\
- * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\
- * (self.name, self.dtype, self.enum_dict) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4992, __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":4991
- * 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_ERR(0, 4991, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4990
- *
- * 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_ERR(0, 4990, __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":4989
- * 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":4994
- * (self.name, self.dtype, self.enum_dict)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a EnumType object.
- * raise NotImplementedError('EnumType is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_6__reduce__(((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_6__reduce__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":4996
- * def __reduce__(self):
- * # raise error is user tries to pickle a EnumType object.
- * raise NotImplementedError('EnumType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_enum(grp, object dt, object dtype_name, object enum_dict):
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4996, __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_ERR(0, 4996, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":4994
- * (self.name, self.dtype, self.enum_dict)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a EnumType object.
- * raise NotImplementedError('EnumType is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.EnumType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":4944
- * 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;
- __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_ERR(0, 4944, __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;
- __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_ERR(0, 4944, __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":4945
- * """
- * 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":4998
- * raise NotImplementedError('EnumType is not picklable')
- *
- * 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;
- char *__pyx_v_namstring;
- PyArrayObject *__pyx_v_value_arr = 0;
- PyObject *__pyx_v_bytestr = NULL;
- PyObject *__pyx_v_msg = NULL;
- PyObject *__pyx_v_field = 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 *);
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- __Pyx_RefNannySetupContext("_def_enum", 0);
- __Pyx_INCREF(__pyx_v_dt);
-
- /* "netCDF4/_netCDF4.pyx":5005
- * cdef char *namstring
- * cdef ndarray value_arr
- * 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_ERR(0, 5005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5006
- * cdef ndarray value_arr
- * 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_ERR(0, 5006, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":5007
- * 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_ERR(0, 5007, __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_ERR(0, 5007, __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_ERR(0, 5007, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5007, __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_ERR(0, 5007, __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":5008
- * 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_ERR(0, 5008, __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_ERR(0, 5008, __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_ERR(0, 5008, __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_ERR(0, 5008, __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_ERR(0, 5008, __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_ERR(0, 5008, __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_ERR(0, 5008, __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":5011
- * # 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_ERR(0, 5011, __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_ERR(0, 5011, __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_ERR(0, 5011, __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)) __PYX_ERR(0, 5011, __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_ERR(0, 5011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_xtype_tmp = __pyx_t_8;
-
- /* "netCDF4/_netCDF4.pyx":5012
- * # 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((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5012, __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_ERR(0, 5012, __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":5013
- * xtype_tmp = _intnptonctype[dt.str[1:]]
- * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype);
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5014
- * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype);
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5014, __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_ERR(0, 5014, __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_ERR(0, 5014, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5013
- * xtype_tmp = _intnptonctype[dt.str[1:]]
- * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype);
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5008
- * 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":5016
- * raise RuntimeError((<char *>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":5017
- * 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_ERR(0, 5017, __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_ERR(0, 5017, __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_ERR(0, 5017, __pyx_L1_error)
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":5019
- * raise KeyError(msg)
- * # insert named members into enum type.
- * for field in enum_dict: # <<<<<<<<<<<<<<
- * value_arr = numpy.array(enum_dict[field],dt)
- * 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_ERR(0, 5019, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5019, __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_ERR(0, 5019, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5019, __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_ERR(0, 5019, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5019, __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_ERR(0, 5019, __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":5020
- * # insert named members into enum type.
- * for field in enum_dict:
- * value_arr = numpy.array(enum_dict[field],dt) # <<<<<<<<<<<<<<
- * bytestr = _strencode(field)
- * namstring = bytestr
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5020, __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_ERR(0, 5020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_enum_dict, __pyx_v_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_13 = 1;
- }
- }
- __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- if (__pyx_t_12) {
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_dt);
- __Pyx_GIVEREF(__pyx_v_dt);
- PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_v_dt);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5020, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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_ERR(0, 5020, __pyx_L1_error)
- __Pyx_XDECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_4));
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5021
- * for field in enum_dict:
- * value_arr = numpy.array(enum_dict[field],dt)
- * bytestr = _strencode(field) # <<<<<<<<<<<<<<
- * namstring = bytestr
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data)
- */
- __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_field, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5022
- * value_arr = numpy.array(enum_dict[field],dt)
- * bytestr = _strencode(field)
- * namstring = bytestr # <<<<<<<<<<<<<<
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data)
- * if ierr != NC_NOERR:
- */
- __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 5022, __pyx_L1_error)
- __pyx_v_namstring = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":5023
- * bytestr = _strencode(field)
- * namstring = bytestr
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data) # <<<<<<<<<<<<<<
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5023, __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_ERR(0, 5023, __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_value_arr->data);
-
- /* "netCDF4/_netCDF4.pyx":5024
- * namstring = bytestr
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return xtype, dt
- */
- __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5025
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5025, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5025, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5025, __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_ERR(0, 5025, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5024
- * namstring = bytestr
- * ierr = nc_insert_enum(grp._grpid, xtype, namstring, value_arr.data)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * return xtype, dt
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5019
- * raise KeyError(msg)
- * # insert named members into enum type.
- * for field in enum_dict: # <<<<<<<<<<<<<<
- * value_arr = numpy.array(enum_dict[field],dt)
- * bytestr = _strencode(field)
- */
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5026
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5026, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5026, __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":4998
- * raise NotImplementedError('EnumType is not picklable')
- *
- * 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_XDECREF(__pyx_t_12);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_AddTraceback("netCDF4._netCDF4._def_enum", __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_msg);
- __Pyx_XDECREF(__pyx_v_field);
- __Pyx_XDECREF(__pyx_v_dt);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5028
- * 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;
- __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":5038
- * 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_ERR(0, 5038, __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_ERR(0, 5038, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v__grpid = __pyx_t_2;
-
- /* "netCDF4/_netCDF4.pyx":5040
- * _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":5041
- * # 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":5040
- * _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":5043
- * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\
- * &nmembers)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":5044
- * &nmembers)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5044, __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_ERR(0, 5044, __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_ERR(0, 5044, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5043
- * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\
- * &nmembers)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = enum_namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5045
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5045, __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_ERR(0, 5045, __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_ERR(0, 5045, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5045, __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_ERR(0, 5045, __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_ERR(0, 5045, __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":5046
- * raise RuntimeError((<char *>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_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":5047
- * 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_ERR(0, 5047, __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)) __PYX_ERR(0, 5047, __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":5048
- * 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_ERR(0, 5048, __pyx_L7_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6);
- __pyx_t_6 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5049
- * 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_ERR(0, 5049, __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_ERR(0, 5049, __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_ERR(0, 5049, __pyx_L7_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5049, __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_ERR(0, 5049, __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":5046
- * raise RuntimeError((<char *>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_PyThreadState_assign
- __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":5050
- * 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 = __Pyx_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_ERR(0, 5050, __pyx_L9_except_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":5051
- * 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_ERR(0, 5051, __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_ERR(0, 5051, __pyx_L9_except_error)
- }
- goto __pyx_L9_except_error;
- __pyx_L9_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5046
- * raise RuntimeError((<char *>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_PyThreadState_assign
- __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":5053
- * 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_ERR(0, 5053, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_enum_dict = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5054
- * # 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":5055
- * 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":5056
- * 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":5055
- * 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":5058
- * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \
- * enum_namstring, &enum_val)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>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":5059
- * enum_namstring, &enum_val)
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5059, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5059, __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_ERR(0, 5059, __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_ERR(0, 5059, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5058
- * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \
- * enum_namstring, &enum_val)
- * if ierr != NC_NOERR: # <<<<<<<<<<<<<<
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * name = enum_namstring.decode(default_encoding,unicode_error)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5060
- * if ierr != NC_NOERR:
- * raise RuntimeError((<char *>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_ERR(0, 5060, __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_ERR(0, 5060, __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_ERR(0, 5060, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5060, __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_ERR(0, 5060, __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_ERR(0, 5060, __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":5061
- * raise RuntimeError((<char *>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_ERR(0, 5061, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5061, __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_ERR(0, 5061, __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_ERR(0, 5061, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5062
- * 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_ERR(0, 5062, __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_ERR(0, 5062, __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_ERR(0, 5062, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_typeid, __pyx_t_8) < 0) __PYX_ERR(0, 5062, __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_ERR(0, 5062, __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":5028
- * 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":5064
- * 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;
- __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":5067
- * # 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":5068
- * # 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_ERR(0, 5068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5067
- * # 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":5069
- * if encoding is None:
- * encoding = default_encoding
- * try: # <<<<<<<<<<<<<<
- * return pystr.encode(encoding)
- * except (AttributeError, UnicodeDecodeError):
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":5070
- * 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_ERR(0, 5070, __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_ERR(0, 5070, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5070, __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_ERR(0, 5070, __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":5069
- * if encoding is None:
- * encoding = default_encoding
- * try: # <<<<<<<<<<<<<<
- * return pystr.encode(encoding)
- * except (AttributeError, UnicodeDecodeError):
- */
- }
- __pyx_L4_error:;
- __Pyx_PyThreadState_assign
- __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":5071
- * try:
- * return pystr.encode(encoding)
- * except (AttributeError, UnicodeDecodeError): # <<<<<<<<<<<<<<
- * return pystr # already bytes or unicode?
- *
- */
- __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_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_ERR(0, 5071, __pyx_L6_except_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_9);
-
- /* "netCDF4/_netCDF4.pyx":5072
- * return pystr.encode(encoding)
- * except (AttributeError, UnicodeDecodeError):
- * return pystr # already bytes or unicode? # <<<<<<<<<<<<<<
- *
- * def _to_ascii(bytestr):
- */
- __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":5069
- * if encoding is None:
- * encoding = default_encoding
- * try: # <<<<<<<<<<<<<<
- * return pystr.encode(encoding)
- * except (AttributeError, UnicodeDecodeError):
- */
- __Pyx_PyThreadState_assign
- __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_PyThreadState_assign
- __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_PyThreadState_assign
- __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":5064
- * 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":5074
- * return pystr # already bytes or unicode?
- *
- * def _to_ascii(bytestr): # <<<<<<<<<<<<<<
- * # encode a byte string to an ascii encoded string.
- * if python3:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7_to_ascii(PyObject *__pyx_self, PyObject *__pyx_v_bytestr); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_7_to_ascii = {"_to_ascii", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7_to_ascii, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7_to_ascii(PyObject *__pyx_self, PyObject *__pyx_v_bytestr) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_to_ascii (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6_to_ascii(__pyx_self, ((PyObject *)__pyx_v_bytestr));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytestr) {
- 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;
- __Pyx_RefNannySetupContext("_to_ascii", 0);
-
- /* "netCDF4/_netCDF4.pyx":5076
- * def _to_ascii(bytestr):
- * # encode a byte string to an ascii encoded string.
- * if python3: # <<<<<<<<<<<<<<
- * return str(bytestr,encoding='ascii')
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5076, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5076, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5077
- * # encode a byte string to an ascii encoded string.
- * if python3:
- * return str(bytestr,encoding='ascii') # <<<<<<<<<<<<<<
- * else:
- * return bytestr.encode('ascii')
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5077, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_bytestr);
- __Pyx_GIVEREF(__pyx_v_bytestr);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bytestr);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5077, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_ascii) < 0) __PYX_ERR(0, 5077, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5077, __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_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5076
- * def _to_ascii(bytestr):
- * # encode a byte string to an ascii encoded string.
- * if python3: # <<<<<<<<<<<<<<
- * return str(bytestr,encoding='ascii')
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5079
- * return str(bytestr,encoding='ascii')
- * else:
- * return bytestr.encode('ascii') # <<<<<<<<<<<<<<
- *
- * #----------------------------------------
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bytestr, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5079, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5079, __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":5074
- * return pystr # already bytes or unicode?
- *
- * def _to_ascii(bytestr): # <<<<<<<<<<<<<<
- * # encode a byte string to an ascii encoded string.
- * if python3:
- */
-
- /* 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._to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5091
- * 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_9_dateparse(PyObject *__pyx_self, PyObject *__pyx_v_timestr); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_8_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_9_dateparse = {"_dateparse", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_dateparse, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8_dateparse};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_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_8_dateparse(__pyx_self, ((PyObject *)__pyx_v_timestr));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8_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;
- __Pyx_RefNannySetupContext("_dateparse", 0);
-
- /* "netCDF4/_netCDF4.pyx":5096
- * # 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_ERR(0, 5096, __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_ERR(0, 5096, __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_ERR(0, 5096, __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":5097
- * # 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)) __PYX_ERR(0, 5097, __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_ERR(0, 5097, __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_ERR(0, 5097, __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_ERR(0, 5097, __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":5098
- * 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)) __PYX_ERR(0, 5098, __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_ERR(0, 5098, __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_ERR(0, 5098, __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_ERR(0, 5098, __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_ERR(0, 5098, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":5099
- * 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__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5099, __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_ERR(0, 5099, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5098
- * 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":5101
- * 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_ERR(0, 5101, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5101, __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_ERR(0, 5101, __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":5102
- * # 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_ERR(0, 5102, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_isostring = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5104
- * 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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5104, __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_ERR(0, 5103, __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_ERR(0, 5103, __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_ERR(0, 5103, __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_ERR(0, 5103, __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_ERR(0, 5103, __pyx_L1_error)
- __pyx_L5_unpacking_done:;
- }
-
- /* "netCDF4/_netCDF4.pyx":5103
- * 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":5105
- * 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_ERR(0, 5105, __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_ERR(0, 5105, __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_ERR(0, 5105, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":5106
- * _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_ERR(0, 5106, __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_ERR(0, 5106, __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_ERR(0, 5106, __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":5108
- * 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_ERR(0, 5108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5108, __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_ERR(0, 5108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_days, __pyx_t_7) < 0) __PYX_ERR(0, 5108, __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_ERR(0, 5108, __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_ERR(0, 5108, __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":5105
- * 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":5110
- * 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_ERR(0, 5110, __pyx_L1_error)
- __pyx_t_13 = ((!__pyx_t_4) != 0);
- if (__pyx_t_13) {
-
- /* "netCDF4/_netCDF4.pyx":5111
- * 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_ERR(0, 5111, __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_ERR(0, 5111, __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_ERR(0, 5111, __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_ERR(0, 5111, __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":5110
- * 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":5113
- * 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__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5113, __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_ERR(0, 5113, __pyx_L1_error)
- }
- __pyx_L7:;
- }
- __pyx_L6:;
-
- /* "netCDF4/_netCDF4.pyx":5114
- * 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":5091
- * 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":5116
- * return basedate
- *
- * def stringtoarr(string,NUMCHARS,dtype='S'): # <<<<<<<<<<<<<<
- * """
- * **`stringtoarr(a, NUMCHARS,dtype='S')`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_11stringtoarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_10stringtoarr[] = "\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 [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_11stringtoarr = {"stringtoarr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_11stringtoarr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_10stringtoarr};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_11stringtoarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_string = 0;
- PyObject *__pyx_v_NUMCHARS = 0;
- PyObject *__pyx_v_dtype = 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_ERR(0, 5116, __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_ERR(0, 5116, __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_ERR(0, 5116, __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_10stringtoarr(__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_10stringtoarr(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;
- __Pyx_RefNannySetupContext("stringtoarr", 0);
-
- /* "netCDF4/_netCDF4.pyx":5133
- * 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_ERR(0, 5133, __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_ERR(0, 5133, __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":5134
- * (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__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5134, __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_ERR(0, 5134, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5133
- * 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":5135
- * 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_ERR(0, 5135, __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_ERR(0, 5135, __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_ERR(0, 5135, __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_ERR(0, 5135, __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_ERR(0, 5135, __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":5136
- * 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_ERR(0, 5136, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyObject_Length(__pyx_v_string); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5136, __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_ERR(0, 5136, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5137
- * 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":5116
- * 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":5139
- * return arr
- *
- * def stringtochar(a): # <<<<<<<<<<<<<<
- * """
- * **`stringtochar(a)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_13stringtochar(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_12stringtochar[] = "\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 [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_13stringtochar = {"stringtochar", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_13stringtochar, METH_O, __pyx_doc_7netCDF4_8_netCDF4_12stringtochar};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_13stringtochar(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_12stringtochar(__pyx_self, ((PyObject *)__pyx_v_a));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12stringtochar(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;
- __Pyx_RefNannySetupContext("stringtochar", 0);
-
- /* "netCDF4/_netCDF4.pyx":5151
- * 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_ERR(0, 5151, __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_ERR(0, 5151, __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":5152
- * 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_ERR(0, 5152, __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_ERR(0, 5152, __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":5153
- * 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__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5153, __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_ERR(0, 5153, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5152
- * 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":5154
- * 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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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_ERR(0, 5154, __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":5155
- * 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_ERR(0, 5155, __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_ERR(0, 5155, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5155, __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_ERR(0, 5155, __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_ERR(0, 5155, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5156
- * 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":5139
- * 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":5158
- * return b
- *
- * def chartostring(b): # <<<<<<<<<<<<<<
- * """
- * **`chartostring(b)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_15chartostring(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_14chartostring[] = "\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_15chartostring = {"chartostring", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_15chartostring, METH_O, __pyx_doc_7netCDF4_8_netCDF4_14chartostring};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_15chartostring(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_14chartostring(__pyx_self, ((PyObject *)__pyx_v_b));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_14chartostring(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;
- __Pyx_RefNannySetupContext("chartostring", 0);
-
- /* "netCDF4/_netCDF4.pyx":5170
- * 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_ERR(0, 5170, __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_ERR(0, 5170, __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":5171
- * `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_ERR(0, 5171, __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_ERR(0, 5171, __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":5172
- * 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__108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5172, __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_ERR(0, 5172, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5171
- * `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":5173
- * 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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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_ERR(0, 5173, __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":5174
- * 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_ERR(0, 5174, __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)) __PYX_ERR(0, 5174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5174, __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":5175
- * 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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = PyObject_Length(__pyx_v_bs); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5175, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5175, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5175, __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_ERR(0, 5175, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5175, __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_ERR(0, 5175, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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_ERR(0, 5175, __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":5176
- * 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_ERR(0, 5176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, -1L, NULL, NULL, &__pyx_slice__109, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5176, __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_ERR(0, 5176, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5177
- * 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":5158
- * 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":5179
- * return a
- *
- * def date2num(dates,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`date2num(dates,units,calendar='standard')`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_17date2num(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_16date2num[] = "\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 [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_17date2num = {"date2num", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_17date2num, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_16date2num};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_17date2num(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dates = 0;
- PyObject *__pyx_v_units = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("date2num (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dates,&__pyx_n_s_units,&__pyx_n_s_calendar,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)__pyx_n_s_standard);
- 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_dates)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_units)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("date2num", 0, 2, 3, 1); __PYX_ERR(0, 5179, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date2num") < 0)) __PYX_ERR(0, 5179, __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_dates = values[0];
- __pyx_v_units = values[1];
- __pyx_v_calendar = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("date2num", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5179, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_16date2num(__pyx_self, __pyx_v_dates, __pyx_v_units, __pyx_v_calendar);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_16date2num(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dates, PyObject *__pyx_v_units, PyObject *__pyx_v_calendar) {
- PyObject *__pyx_v_basedate = NULL;
- PyObject *__pyx_v_unit = NULL;
- PyObject *__pyx_v_msg = NULL;
- int __pyx_v_isscalar;
- PyObject *__pyx_v_shape = NULL;
- int __pyx_v_ismasked;
- CYTHON_UNUSED PyObject *__pyx_v_mask = NULL;
- PyObject *__pyx_v_times = NULL;
- PyObject *__pyx_v_date = NULL;
- PyObject *__pyx_v_td = NULL;
- PyObject *__pyx_v_totaltime = NULL;
- PyObject *__pyx_v_cdftime = 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;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- Py_ssize_t __pyx_t_12;
- PyObject *(*__pyx_t_13)(PyObject *);
- int __pyx_t_14;
- PyObject *__pyx_t_15 = NULL;
- __Pyx_RefNannySetupContext("date2num", 0);
- __Pyx_INCREF(__pyx_v_dates);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netCDF4/_netCDF4.pyx":5208
- * with approximately millisecond accuracy.
- * """
- * calendar = calendar.lower() # <<<<<<<<<<<<<<
- * basedate = _dateparse(units)
- * unit = units.split()[0].lower()
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_calendar, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5208, __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_ERR(0, 5208, __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_ERR(0, 5208, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5209
- * """
- * calendar = calendar.lower()
- * basedate = _dateparse(units) # <<<<<<<<<<<<<<
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5209, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- 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);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5209, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5209, __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 = NULL;
- __Pyx_INCREF(__pyx_v_units);
- __Pyx_GIVEREF(__pyx_v_units);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_units);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5209, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_basedate = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5210
- * calendar = calendar.lower()
- * basedate = _dateparse(units)
- * unit = units.split()[0].lower() # <<<<<<<<<<<<<<
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_units, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5210, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5210, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5210, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5210, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5210, __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 && 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_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5210, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5210, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_unit = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5212
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_1 = __pyx_v_calendar;
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5212, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5212, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5212, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5212, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_6;
- __pyx_L4_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = (__pyx_t_5 != 0);
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5213
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5213, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5213, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5213, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5214
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * elif basedate.year < 0:
- */
- __Pyx_INCREF(__pyx_kp_s_zero_not_allowed_as_a_reference);
- __pyx_v_msg = __pyx_kp_s_zero_not_allowed_as_a_reference;
-
- /* "netCDF4/_netCDF4.pyx":5215
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5215, __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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5215, __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_ERR(0, 5215, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5213
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5216
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5216, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5216, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5216, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5217
- * raise ValueError(msg)
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- *
- */
- __Pyx_INCREF(__pyx_kp_s_negative_reference_year_in_time);
- __pyx_v_msg = __pyx_kp_s_negative_reference_year_in_time;
-
- /* "netCDF4/_netCDF4.pyx":5218
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5218, __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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5218, __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_ERR(0, 5218, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5216
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5212
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5220
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5220, __pyx_L1_error)
- if (!__pyx_t_5) {
- goto __pyx_L11_next_or;
- } else {
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5220, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5220, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5220, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5220, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!__pyx_t_5) {
- } else {
- __pyx_t_6 = __pyx_t_5;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_L11_next_or:;
-
- /* "netCDF4/_netCDF4.pyx":5221
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- * (calendar in ['gregorian','standard'] and basedate > gregorian): # <<<<<<<<<<<<<<
- * # use python datetime module,
- * isscalar = False
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_4 = __pyx_v_calendar;
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5221, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_5 = __pyx_t_7;
- goto __pyx_L14_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5221, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_7;
- __pyx_L14_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_6 = __pyx_t_7;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gregorian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5221, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_basedate, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5221, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5221, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __pyx_t_7;
- __pyx_L10_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":5220
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5223
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * dates[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netCDF4/_netCDF4.pyx":5224
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * dates[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
- __Pyx_XGOTREF(__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_10);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":5225
- * isscalar = False
- * try:
- * dates[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_dates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5225, __pyx_L16_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5224
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * dates[0]
- * except:
- */
- }
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L23_try_end;
- __pyx_L16_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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":5226
- * try:
- * dates[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- * if isscalar:
- */
- /*except:*/ {
- __Pyx_AddTraceback("netCDF4._netCDF4.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 5226, __pyx_L18_except_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5227
- * dates[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- * if isscalar:
- * dates = numpy.array([dates])
- */
- __pyx_v_isscalar = 1;
- __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_L17_exception_handled;
- }
- __pyx_L18_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5224
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * dates[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
- goto __pyx_L1_error;
- __pyx_L17_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
- __pyx_L23_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":5228
- * except:
- * isscalar = True
- * if isscalar: # <<<<<<<<<<<<<<
- * dates = numpy.array([dates])
- * else:
- */
- __pyx_t_6 = (__pyx_v_isscalar != 0);
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5229
- * isscalar = True
- * if isscalar:
- * dates = numpy.array([dates]) # <<<<<<<<<<<<<<
- * else:
- * dates = numpy.array(dates)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_dates);
- __pyx_t_3 = NULL;
- 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);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_dates, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5228
- * except:
- * isscalar = True
- * if isscalar: # <<<<<<<<<<<<<<
- * dates = numpy.array([dates])
- * else:
- */
- goto __pyx_L26;
- }
-
- /* "netCDF4/_netCDF4.pyx":5231
- * dates = numpy.array([dates])
- * else:
- * dates = numpy.array(dates) # <<<<<<<<<<<<<<
- * shape = dates.shape
- * ismasked = False
- */
- /*else*/ {
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_dates); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5231, __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_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_dates);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF_SET(__pyx_v_dates, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5232
- * else:
- * dates = numpy.array(dates)
- * shape = dates.shape # <<<<<<<<<<<<<<
- * ismasked = False
- * if hasattr(dates,'mask'):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dates, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5232, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_shape = __pyx_t_1;
- __pyx_t_1 = 0;
- }
- __pyx_L26:;
-
- /* "netCDF4/_netCDF4.pyx":5233
- * dates = numpy.array(dates)
- * shape = dates.shape
- * ismasked = False # <<<<<<<<<<<<<<
- * if hasattr(dates,'mask'):
- * mask = dates.mask
- */
- __pyx_v_ismasked = 0;
-
- /* "netCDF4/_netCDF4.pyx":5234
- * shape = dates.shape
- * ismasked = False
- * if hasattr(dates,'mask'): # <<<<<<<<<<<<<<
- * mask = dates.mask
- * ismasked = True
- */
- __pyx_t_6 = PyObject_HasAttr(__pyx_v_dates, __pyx_n_s_mask); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 5234, __pyx_L1_error)
- __pyx_t_7 = (__pyx_t_6 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5235
- * ismasked = False
- * if hasattr(dates,'mask'):
- * mask = dates.mask # <<<<<<<<<<<<<<
- * ismasked = True
- * times = []
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dates, __pyx_n_s_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_mask = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5236
- * if hasattr(dates,'mask'):
- * mask = dates.mask
- * ismasked = True # <<<<<<<<<<<<<<
- * times = []
- * for date in dates.flat:
- */
- __pyx_v_ismasked = 1;
-
- /* "netCDF4/_netCDF4.pyx":5234
- * shape = dates.shape
- * ismasked = False
- * if hasattr(dates,'mask'): # <<<<<<<<<<<<<<
- * mask = dates.mask
- * ismasked = True
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5237
- * mask = dates.mask
- * ismasked = True
- * times = [] # <<<<<<<<<<<<<<
- * for date in dates.flat:
- * if ismasked and not date:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5237, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_times = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5238
- * ismasked = True
- * times = []
- * for date in dates.flat: # <<<<<<<<<<<<<<
- * if ismasked and not date:
- * times.append(None)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dates, __pyx_n_s_flat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0;
- __pyx_t_13 = NULL;
- } else {
- __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 5238, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_13)) {
- if (likely(PyList_CheckExact(__pyx_t_11))) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 5238, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 5238, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_13(__pyx_t_11);
- 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_ERR(0, 5238, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_date, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5239
- * times = []
- * for date in dates.flat:
- * if ismasked and not date: # <<<<<<<<<<<<<<
- * times.append(None)
- * else:
- */
- __pyx_t_6 = (__pyx_v_ismasked != 0);
- if (__pyx_t_6) {
- } else {
- __pyx_t_7 = __pyx_t_6;
- goto __pyx_L31_bool_binop_done;
- }
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_date); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5239, __pyx_L1_error)
- __pyx_t_5 = ((!__pyx_t_6) != 0);
- __pyx_t_7 = __pyx_t_5;
- __pyx_L31_bool_binop_done:;
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5240
- * for date in dates.flat:
- * if ismasked and not date:
- * times.append(None) # <<<<<<<<<<<<<<
- * else:
- * td = date - basedate
- */
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, Py_None); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5240, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5239
- * times = []
- * for date in dates.flat:
- * if ismasked and not date: # <<<<<<<<<<<<<<
- * times.append(None)
- * else:
- */
- goto __pyx_L30;
- }
-
- /* "netCDF4/_netCDF4.pyx":5242
- * times.append(None)
- * else:
- * td = date - basedate # <<<<<<<<<<<<<<
- * # total time in microseconds.
- * totaltime = td.microseconds + (td.seconds + td.days * 24 * 3600) * 1.e6
- */
- /*else*/ {
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_date, __pyx_v_basedate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_td, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5244
- * td = date - basedate
- * # total time in microseconds.
- * totaltime = td.microseconds + (td.seconds + td.days * 24 * 3600) * 1.e6 # <<<<<<<<<<<<<<
- * if unit in microsec_units:
- * times.append(totaltime)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_seconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_days); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_3600); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_float_1_e6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5244, __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_XDECREF_SET(__pyx_v_totaltime, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5245
- * # total time in microseconds.
- * totaltime = td.microseconds + (td.seconds + td.days * 24 * 3600) * 1.e6
- * if unit in microsec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime)
- * elif unit in millisec_units:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_microsec_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5245, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5245, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5246
- * totaltime = td.microseconds + (td.seconds + td.days * 24 * 3600) * 1.e6
- * if unit in microsec_units:
- * times.append(totaltime) # <<<<<<<<<<<<<<
- * elif unit in millisec_units:
- * times.append(totaltime/1.e3)
- */
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_v_totaltime); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5246, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5245
- * # total time in microseconds.
- * totaltime = td.microseconds + (td.seconds + td.days * 24 * 3600) * 1.e6
- * if unit in microsec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime)
- * elif unit in millisec_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5247
- * if unit in microsec_units:
- * times.append(totaltime)
- * elif unit in millisec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e3)
- * elif unit in sec_units:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_millisec_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5247, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5247, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5248
- * times.append(totaltime)
- * elif unit in millisec_units:
- * times.append(totaltime/1.e3) # <<<<<<<<<<<<<<
- * elif unit in sec_units:
- * times.append(totaltime/1.e6)
- */
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_totaltime, __pyx_float_1_e3, 1.e3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_t_3); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5248, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5247
- * if unit in microsec_units:
- * times.append(totaltime)
- * elif unit in millisec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e3)
- * elif unit in sec_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5249
- * elif unit in millisec_units:
- * times.append(totaltime/1.e3)
- * elif unit in sec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6)
- * elif unit in min_units:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sec_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5249, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5249, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5250
- * times.append(totaltime/1.e3)
- * elif unit in sec_units:
- * times.append(totaltime/1.e6) # <<<<<<<<<<<<<<
- * elif unit in min_units:
- * times.append(totaltime/1.e6/60)
- */
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_totaltime, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5250, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_t_3); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5250, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5249
- * elif unit in millisec_units:
- * times.append(totaltime/1.e3)
- * elif unit in sec_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6)
- * elif unit in min_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5251
- * elif unit in sec_units:
- * times.append(totaltime/1.e6)
- * elif unit in min_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/60)
- * elif unit in hr_units:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5251, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5251, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5252
- * times.append(totaltime/1.e6)
- * elif unit in min_units:
- * times.append(totaltime/1.e6/60) # <<<<<<<<<<<<<<
- * elif unit in hr_units:
- * times.append(totaltime/1.e6/3600)
- */
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_totaltime, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_t_2); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5252, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5251
- * elif unit in sec_units:
- * times.append(totaltime/1.e6)
- * elif unit in min_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/60)
- * elif unit in hr_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5253
- * elif unit in min_units:
- * times.append(totaltime/1.e6/60)
- * elif unit in hr_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/3600)
- * elif unit in day_units:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_hr_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5253, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5253, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5254
- * times.append(totaltime/1.e6/60)
- * elif unit in hr_units:
- * times.append(totaltime/1.e6/3600) # <<<<<<<<<<<<<<
- * elif unit in day_units:
- * times.append(totaltime/1.e6/3600./24.)
- */
- __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_v_totaltime, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5254, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_int_3600); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5254, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_t_3); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5254, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5253
- * elif unit in min_units:
- * times.append(totaltime/1.e6/60)
- * elif unit in hr_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/3600)
- * elif unit in day_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5255
- * elif unit in hr_units:
- * times.append(totaltime/1.e6/3600)
- * elif unit in day_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/3600./24.)
- * else:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_day_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5255, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5255, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5256
- * times.append(totaltime/1.e6/3600)
- * elif unit in day_units:
- * times.append(totaltime/1.e6/3600./24.) # <<<<<<<<<<<<<<
- * else:
- * raise ValueError('unsupported time units')
- */
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_totaltime, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_3, __pyx_float_3600_, 3600., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_24_, 24., 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5256, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_times, __pyx_t_3); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 5256, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5255
- * elif unit in hr_units:
- * times.append(totaltime/1.e6/3600)
- * elif unit in day_units: # <<<<<<<<<<<<<<
- * times.append(totaltime/1.e6/3600./24.)
- * else:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5258
- * times.append(totaltime/1.e6/3600./24.)
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * if isscalar:
- * return times[0]
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5258, __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_ERR(0, 5258, __pyx_L1_error)
- }
- __pyx_L33:;
- }
- __pyx_L30:;
-
- /* "netCDF4/_netCDF4.pyx":5238
- * ismasked = True
- * times = []
- * for date in dates.flat: # <<<<<<<<<<<<<<
- * if ismasked and not date:
- * times.append(None)
- */
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5259
- * else:
- * raise ValueError('unsupported time units')
- * if isscalar: # <<<<<<<<<<<<<<
- * return times[0]
- * else:
- */
- __pyx_t_7 = (__pyx_v_isscalar != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5260
- * raise ValueError('unsupported time units')
- * if isscalar:
- * return times[0] # <<<<<<<<<<<<<<
- * else:
- * return numpy.reshape(numpy.array(times), shape)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_times, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5260, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_r = __pyx_t_11;
- __pyx_t_11 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5259
- * else:
- * raise ValueError('unsupported time units')
- * if isscalar: # <<<<<<<<<<<<<<
- * return times[0]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5262
- * return times[0]
- * else:
- * return numpy.reshape(numpy.array(times), shape) # <<<<<<<<<<<<<<
- * else: # use netcdftime module for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar)
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_times); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_times);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_v_shape)) { __Pyx_RaiseUnboundLocalError("shape"); __PYX_ERR(0, 5262, __pyx_L1_error) }
- __pyx_t_4 = NULL;
- __pyx_t_12 = 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_12 = 1;
- }
- }
- __pyx_t_15 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_12, __pyx_t_3);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_12, __pyx_v_shape);
- __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_11;
- __pyx_t_11 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5220
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5264
- * return numpy.reshape(numpy.array(times), shape)
- * else: # use netcdftime module for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar) # <<<<<<<<<<<<<<
- * return cdftime.date2num(dates)
- *
- */
- /*else*/ {
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdftime); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_utime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_v_units);
- __Pyx_GIVEREF(__pyx_v_units);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_units);
- __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 5264, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_v_cdftime = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5265
- * else: # use netcdftime module for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar)
- * return cdftime.date2num(dates) # <<<<<<<<<<<<<<
- *
- * def num2date(times,units,calendar='standard'):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdftime, __pyx_n_s_date2num); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5265, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_15);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_15, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_dates); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5265, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5265, __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_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_dates);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5265, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5179
- * return a
- *
- * def date2num(dates,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`date2num(dates,units,calendar='standard')`**
- */
-
- /* 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_11);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("netCDF4._netCDF4.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_basedate);
- __Pyx_XDECREF(__pyx_v_unit);
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_mask);
- __Pyx_XDECREF(__pyx_v_times);
- __Pyx_XDECREF(__pyx_v_date);
- __Pyx_XDECREF(__pyx_v_td);
- __Pyx_XDECREF(__pyx_v_totaltime);
- __Pyx_XDECREF(__pyx_v_cdftime);
- __Pyx_XDECREF(__pyx_v_dates);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5267
- * return cdftime.date2num(dates)
- *
- * def num2date(times,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`num2date(times,units,calendar='standard')`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_19num2date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_18num2date[] = "\n**`num2date(times,units,calendar='standard')`**\n\nReturn datetime objects given numeric time values. The units\nof the numeric time values are described by the `units` argument\nand the `calendar` keyword. The returned datetime objects represent\nUTC with no time-zone offset, even if the specified\n`units` contain a time-zone offset.\n\n**`times`**: numeric time values.\n\n**`units`**: a string of the form `<time units> since <r [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_19num2date = {"num2date", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_19num2date, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_18num2date};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_19num2date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_times = 0;
- PyObject *__pyx_v_units = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("num2date (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_times,&__pyx_n_s_units,&__pyx_n_s_calendar,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)__pyx_n_s_standard);
- 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_times)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_units)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("num2date", 0, 2, 3, 1); __PYX_ERR(0, 5267, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "num2date") < 0)) __PYX_ERR(0, 5267, __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_times = values[0];
- __pyx_v_units = values[1];
- __pyx_v_calendar = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("num2date", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5267, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_18num2date(__pyx_self, __pyx_v_times, __pyx_v_units, __pyx_v_calendar);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_18num2date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_times, PyObject *__pyx_v_units, PyObject *__pyx_v_calendar) {
- PyObject *__pyx_v_basedate = NULL;
- PyObject *__pyx_v_unit = NULL;
- PyObject *__pyx_v_msg = NULL;
- int __pyx_v_isscalar;
- PyObject *__pyx_v_shape = NULL;
- int __pyx_v_ismasked;
- CYTHON_UNUSED PyObject *__pyx_v_mask = NULL;
- PyObject *__pyx_v_dates = NULL;
- PyObject *__pyx_v_time = NULL;
- PyObject *__pyx_v_tsecs = NULL;
- PyObject *__pyx_v_days = NULL;
- PyObject *__pyx_v_msecsd = NULL;
- PyObject *__pyx_v_secs = NULL;
- PyObject *__pyx_v_msecs = NULL;
- PyObject *__pyx_v_td = NULL;
- PyObject *__pyx_v_date = NULL;
- PyObject *__pyx_v_cdftime = 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;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- Py_ssize_t __pyx_t_11;
- PyObject *(*__pyx_t_12)(PyObject *);
- int __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- __Pyx_RefNannySetupContext("num2date", 0);
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netCDF4/_netCDF4.pyx":5304
- * contains one.
- * """
- * calendar = calendar.lower() # <<<<<<<<<<<<<<
- * basedate = _dateparse(units)
- * unit = units.split()[0].lower()
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_calendar, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5304, __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_ERR(0, 5304, __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_ERR(0, 5304, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5305
- * """
- * calendar = calendar.lower()
- * basedate = _dateparse(units) # <<<<<<<<<<<<<<
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5305, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- 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);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5305, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5305, __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 = NULL;
- __Pyx_INCREF(__pyx_v_units);
- __Pyx_GIVEREF(__pyx_v_units);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_units);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5305, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_basedate = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5306
- * calendar = calendar.lower()
- * basedate = _dateparse(units)
- * unit = units.split()[0].lower() # <<<<<<<<<<<<<<
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_units, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5306, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5306, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5306, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5306, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5306, __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 && 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_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5306, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5306, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_unit = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5308
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_1 = __pyx_v_calendar;
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5308, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5308, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5308, __pyx_L1_error)
- if (!__pyx_t_6) {
- } else {
- __pyx_t_5 = __pyx_t_6;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5308, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_6;
- __pyx_L4_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = (__pyx_t_5 != 0);
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5309
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5309, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5310
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * elif basedate.year < 0:
- */
- __Pyx_INCREF(__pyx_kp_s_zero_not_allowed_as_a_reference);
- __pyx_v_msg = __pyx_kp_s_zero_not_allowed_as_a_reference;
-
- /* "netCDF4/_netCDF4.pyx":5311
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5311, __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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5311, __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_ERR(0, 5311, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5309
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5312
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5312, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5312, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5313
- * raise ValueError(msg)
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- *
- */
- __Pyx_INCREF(__pyx_kp_s_negative_reference_year_in_time);
- __pyx_v_msg = __pyx_kp_s_negative_reference_year_in_time;
-
- /* "netCDF4/_netCDF4.pyx":5314
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5314, __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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5314, __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_ERR(0, 5314, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5312
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5308
- * unit = units.split()[0].lower()
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5316
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5316, __pyx_L1_error)
- if (!__pyx_t_5) {
- goto __pyx_L11_next_or;
- } else {
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5316, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5316, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!__pyx_t_5) {
- } else {
- __pyx_t_6 = __pyx_t_5;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_L11_next_or:;
-
- /* "netCDF4/_netCDF4.pyx":5317
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- * (calendar in ['gregorian','standard'] and basedate > gregorian): # <<<<<<<<<<<<<<
- * # use python datetime module,
- * isscalar = False
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_4 = __pyx_v_calendar;
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5317, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_5 = __pyx_t_7;
- goto __pyx_L14_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5317, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_7;
- __pyx_L14_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_6 = __pyx_t_7;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gregorian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5317, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_basedate, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5317, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5317, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __pyx_t_7;
- __pyx_L10_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":5316
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5319
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * times[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netCDF4/_netCDF4.pyx":5320
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * times[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
- __Pyx_XGOTREF(__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_10);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":5321
- * isscalar = False
- * try:
- * times[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_times, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5321, __pyx_L16_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5320
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * times[0]
- * except:
- */
- }
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L23_try_end;
- __pyx_L16_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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":5322
- * try:
- * times[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- * if isscalar:
- */
- /*except:*/ {
- __Pyx_AddTraceback("netCDF4._netCDF4.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 5322, __pyx_L18_except_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5323
- * times[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- * if isscalar:
- * times = numpy.array([times],dtype='d')
- */
- __pyx_v_isscalar = 1;
- __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_L17_exception_handled;
- }
- __pyx_L18_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5320
- * # use python datetime module,
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * times[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
- goto __pyx_L1_error;
- __pyx_L17_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
- __pyx_L23_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":5324
- * except:
- * isscalar = True
- * if isscalar: # <<<<<<<<<<<<<<
- * times = numpy.array([times],dtype='d')
- * else:
- */
- __pyx_t_6 = (__pyx_v_isscalar != 0);
- if (__pyx_t_6) {
-
- /* "netCDF4/_netCDF4.pyx":5325
- * isscalar = True
- * if isscalar:
- * times = numpy.array([times],dtype='d') # <<<<<<<<<<<<<<
- * else:
- * times = numpy.array(times, dtype='d')
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_times);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_d) < 0) __PYX_ERR(0, 5325, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_times, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5324
- * except:
- * isscalar = True
- * if isscalar: # <<<<<<<<<<<<<<
- * times = numpy.array([times],dtype='d')
- * else:
- */
- goto __pyx_L26;
- }
-
- /* "netCDF4/_netCDF4.pyx":5327
- * times = numpy.array([times],dtype='d')
- * else:
- * times = numpy.array(times, dtype='d') # <<<<<<<<<<<<<<
- * shape = times.shape
- * ismasked = False
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_times);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_d) < 0) __PYX_ERR(0, 5327, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5327, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_times, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5328
- * else:
- * times = numpy.array(times, dtype='d')
- * shape = times.shape # <<<<<<<<<<<<<<
- * ismasked = False
- * if hasattr(times,'mask'):
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_times, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5328, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_shape = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L26:;
-
- /* "netCDF4/_netCDF4.pyx":5329
- * times = numpy.array(times, dtype='d')
- * shape = times.shape
- * ismasked = False # <<<<<<<<<<<<<<
- * if hasattr(times,'mask'):
- * mask = times.mask
- */
- __pyx_v_ismasked = 0;
-
- /* "netCDF4/_netCDF4.pyx":5330
- * shape = times.shape
- * ismasked = False
- * if hasattr(times,'mask'): # <<<<<<<<<<<<<<
- * mask = times.mask
- * ismasked = True
- */
- __pyx_t_6 = PyObject_HasAttr(__pyx_v_times, __pyx_n_s_mask); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 5330, __pyx_L1_error)
- __pyx_t_7 = (__pyx_t_6 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5331
- * ismasked = False
- * if hasattr(times,'mask'):
- * mask = times.mask # <<<<<<<<<<<<<<
- * ismasked = True
- * dates = []
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_times, __pyx_n_s_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_mask = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5332
- * if hasattr(times,'mask'):
- * mask = times.mask
- * ismasked = True # <<<<<<<<<<<<<<
- * dates = []
- * for time in times.flat:
- */
- __pyx_v_ismasked = 1;
-
- /* "netCDF4/_netCDF4.pyx":5330
- * shape = times.shape
- * ismasked = False
- * if hasattr(times,'mask'): # <<<<<<<<<<<<<<
- * mask = times.mask
- * ismasked = True
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5333
- * mask = times.mask
- * ismasked = True
- * dates = [] # <<<<<<<<<<<<<<
- * for time in times.flat:
- * if ismasked and not time:
- */
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_dates = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5334
- * ismasked = True
- * dates = []
- * for time in times.flat: # <<<<<<<<<<<<<<
- * if ismasked and not time:
- * dates.append(None)
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_times, __pyx_n_s_flat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
- __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0;
- __pyx_t_12 = NULL;
- } else {
- __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5334, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_12)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5334, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 5334, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_12(__pyx_t_2);
- 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_ERR(0, 5334, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_time, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5335
- * dates = []
- * for time in times.flat:
- * if ismasked and not time: # <<<<<<<<<<<<<<
- * dates.append(None)
- * else:
- */
- __pyx_t_6 = (__pyx_v_ismasked != 0);
- if (__pyx_t_6) {
- } else {
- __pyx_t_7 = __pyx_t_6;
- goto __pyx_L31_bool_binop_done;
- }
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_time); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 5335, __pyx_L1_error)
- __pyx_t_5 = ((!__pyx_t_6) != 0);
- __pyx_t_7 = __pyx_t_5;
- __pyx_L31_bool_binop_done:;
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5336
- * for time in times.flat:
- * if ismasked and not time:
- * dates.append(None) # <<<<<<<<<<<<<<
- * else:
- * # convert to total seconds
- */
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_dates, Py_None); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 5336, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5335
- * dates = []
- * for time in times.flat:
- * if ismasked and not time: # <<<<<<<<<<<<<<
- * dates.append(None)
- * else:
- */
- goto __pyx_L30;
- }
-
- /* "netCDF4/_netCDF4.pyx":5339
- * else:
- * # convert to total seconds
- * if unit in microsec_units: # <<<<<<<<<<<<<<
- * tsecs = time/1.e6
- * elif unit in millisec_units:
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_microsec_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5339, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5339, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5340
- * # convert to total seconds
- * if unit in microsec_units:
- * tsecs = time/1.e6 # <<<<<<<<<<<<<<
- * elif unit in millisec_units:
- * tsecs = time/1.e3
- */
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_v_time, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5339
- * else:
- * # convert to total seconds
- * if unit in microsec_units: # <<<<<<<<<<<<<<
- * tsecs = time/1.e6
- * elif unit in millisec_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5341
- * if unit in microsec_units:
- * tsecs = time/1.e6
- * elif unit in millisec_units: # <<<<<<<<<<<<<<
- * tsecs = time/1.e3
- * elif unit in sec_units:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_millisec_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5341, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5341, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5342
- * tsecs = time/1.e6
- * elif unit in millisec_units:
- * tsecs = time/1.e3 # <<<<<<<<<<<<<<
- * elif unit in sec_units:
- * tsecs = time
- */
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_v_time, __pyx_float_1_e3, 1.e3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5341
- * if unit in microsec_units:
- * tsecs = time/1.e6
- * elif unit in millisec_units: # <<<<<<<<<<<<<<
- * tsecs = time/1.e3
- * elif unit in sec_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5343
- * elif unit in millisec_units:
- * tsecs = time/1.e3
- * elif unit in sec_units: # <<<<<<<<<<<<<<
- * tsecs = time
- * elif unit in min_units:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sec_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5343, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5344
- * tsecs = time/1.e3
- * elif unit in sec_units:
- * tsecs = time # <<<<<<<<<<<<<<
- * elif unit in min_units:
- * tsecs = time*60.
- */
- __Pyx_INCREF(__pyx_v_time);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_v_time);
-
- /* "netCDF4/_netCDF4.pyx":5343
- * elif unit in millisec_units:
- * tsecs = time/1.e3
- * elif unit in sec_units: # <<<<<<<<<<<<<<
- * tsecs = time
- * elif unit in min_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5345
- * elif unit in sec_units:
- * tsecs = time
- * elif unit in min_units: # <<<<<<<<<<<<<<
- * tsecs = time*60.
- * elif unit in hr_units:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5345, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5345, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5346
- * tsecs = time
- * elif unit in min_units:
- * tsecs = time*60. # <<<<<<<<<<<<<<
- * elif unit in hr_units:
- * tsecs = time*3600.
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_time, __pyx_float_60_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5345
- * elif unit in sec_units:
- * tsecs = time
- * elif unit in min_units: # <<<<<<<<<<<<<<
- * tsecs = time*60.
- * elif unit in hr_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5347
- * elif unit in min_units:
- * tsecs = time*60.
- * elif unit in hr_units: # <<<<<<<<<<<<<<
- * tsecs = time*3600.
- * elif unit in day_units:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hr_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5347, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5347, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = (__pyx_t_7 != 0);
- if (__pyx_t_5) {
-
- /* "netCDF4/_netCDF4.pyx":5348
- * tsecs = time*60.
- * elif unit in hr_units:
- * tsecs = time*3600. # <<<<<<<<<<<<<<
- * elif unit in day_units:
- * tsecs = time*86400.
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_time, __pyx_float_3600_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5347
- * elif unit in min_units:
- * tsecs = time*60.
- * elif unit in hr_units: # <<<<<<<<<<<<<<
- * tsecs = time*3600.
- * elif unit in day_units:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5349
- * elif unit in hr_units:
- * tsecs = time*3600.
- * elif unit in day_units: # <<<<<<<<<<<<<<
- * tsecs = time*86400.
- * else:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_day_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5349, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_unit, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 5349, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_5 != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5350
- * tsecs = time*3600.
- * elif unit in day_units:
- * tsecs = time*86400. # <<<<<<<<<<<<<<
- * else:
- * raise ValueError('unsupported time units')
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_time, __pyx_float_86400_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5350, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_tsecs, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5349
- * elif unit in hr_units:
- * tsecs = time*3600.
- * elif unit in day_units: # <<<<<<<<<<<<<<
- * tsecs = time*86400.
- * else:
- */
- goto __pyx_L33;
- }
-
- /* "netCDF4/_netCDF4.pyx":5352
- * tsecs = time*86400.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * # compute time delta.
- * days = tsecs // 86400.
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5352, __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_ERR(0, 5352, __pyx_L1_error)
- }
- __pyx_L33:;
-
- /* "netCDF4/_netCDF4.pyx":5354
- * raise ValueError('unsupported time units')
- * # compute time delta.
- * days = tsecs // 86400. # <<<<<<<<<<<<<<
- * msecsd = tsecs*1.e6 - days*86400.*1.e6
- * secs = msecsd // 1.e6
- */
- __pyx_t_4 = PyNumber_FloorDivide(__pyx_v_tsecs, __pyx_float_86400_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_days, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5355
- * # compute time delta.
- * days = tsecs // 86400.
- * msecsd = tsecs*1.e6 - days*86400.*1.e6 # <<<<<<<<<<<<<<
- * secs = msecsd // 1.e6
- * msecs = numpy.round(msecsd - secs*1.e6)
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_tsecs, __pyx_float_1_e6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyNumber_Multiply(__pyx_v_days, __pyx_float_86400_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_float_1_e6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5355, __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_XDECREF_SET(__pyx_v_msecsd, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5356
- * days = tsecs // 86400.
- * msecsd = tsecs*1.e6 - days*86400.*1.e6
- * secs = msecsd // 1.e6 # <<<<<<<<<<<<<<
- * msecs = numpy.round(msecsd - secs*1.e6)
- * td = timedelta(days=days,seconds=secs,microseconds=msecs)
- */
- __pyx_t_3 = PyNumber_FloorDivide(__pyx_v_msecsd, __pyx_float_1_e6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF_SET(__pyx_v_secs, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5357
- * msecsd = tsecs*1.e6 - days*86400.*1.e6
- * secs = msecsd // 1.e6
- * msecs = numpy.round(msecsd - secs*1.e6) # <<<<<<<<<<<<<<
- * td = timedelta(days=days,seconds=secs,microseconds=msecs)
- * # add time delta to base date.
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_round); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Multiply(__pyx_v_secs, __pyx_float_1_e6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = PyNumber_Subtract(__pyx_v_msecsd, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_msecs, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5358
- * secs = msecsd // 1.e6
- * msecs = numpy.round(msecsd - secs*1.e6)
- * td = timedelta(days=days,seconds=secs,microseconds=msecs) # <<<<<<<<<<<<<<
- * # add time delta to base date.
- * date = basedate + td
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_days, __pyx_v_days) < 0) __PYX_ERR(0, 5358, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_seconds, __pyx_v_secs) < 0) __PYX_ERR(0, 5358, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_v_msecs) < 0) __PYX_ERR(0, 5358, __pyx_L1_error)
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_td, __pyx_t_15);
- __pyx_t_15 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5360
- * td = timedelta(days=days,seconds=secs,microseconds=msecs)
- * # add time delta to base date.
- * date = basedate + td # <<<<<<<<<<<<<<
- * dates.append(date)
- * if isscalar:
- */
- __pyx_t_15 = PyNumber_Add(__pyx_v_basedate, __pyx_v_td); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_XDECREF_SET(__pyx_v_date, __pyx_t_15);
- __pyx_t_15 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5361
- * # add time delta to base date.
- * date = basedate + td
- * dates.append(date) # <<<<<<<<<<<<<<
- * if isscalar:
- * return dates[0]
- */
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_dates, __pyx_v_date); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 5361, __pyx_L1_error)
- }
- __pyx_L30:;
-
- /* "netCDF4/_netCDF4.pyx":5334
- * ismasked = True
- * dates = []
- * for time in times.flat: # <<<<<<<<<<<<<<
- * if ismasked and not time:
- * dates.append(None)
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5362
- * date = basedate + td
- * dates.append(date)
- * if isscalar: # <<<<<<<<<<<<<<
- * return dates[0]
- * else:
- */
- __pyx_t_7 = (__pyx_v_isscalar != 0);
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5363
- * dates.append(date)
- * if isscalar:
- * return dates[0] # <<<<<<<<<<<<<<
- * else:
- * return numpy.reshape(numpy.array(dates), shape)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5363, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5362
- * date = basedate + td
- * dates.append(date)
- * if isscalar: # <<<<<<<<<<<<<<
- * return dates[0]
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5365
- * return dates[0]
- * else:
- * return numpy.reshape(numpy.array(dates), shape) # <<<<<<<<<<<<<<
- * else: # use netcdftime for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar)
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_14, function);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_dates); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_INCREF(__pyx_v_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_dates);
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- if (unlikely(!__pyx_v_shape)) { __Pyx_RaiseUnboundLocalError("shape"); __PYX_ERR(0, 5365, __pyx_L1_error) }
- __pyx_t_14 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_14)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- __pyx_t_11 = 1;
- }
- }
- __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5365, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (__pyx_t_14) {
- __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); __pyx_t_14 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_11, __pyx_t_15);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_v_shape);
- __pyx_t_15 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5365, __pyx_L1_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_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5316
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime module,
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5367
- * return numpy.reshape(numpy.array(dates), shape)
- * else: # use netcdftime for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar) # <<<<<<<<<<<<<<
- * return cdftime.num2date(times)
- *
- */
- /*else*/ {
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdftime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_units);
- __Pyx_GIVEREF(__pyx_v_units);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_units);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 5367, __pyx_L1_error)
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_cdftime = __pyx_t_15;
- __pyx_t_15 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5368
- * else: # use netcdftime for other calendars
- * cdftime = netcdftime.utime(units,calendar=calendar)
- * return cdftime.num2date(times) # <<<<<<<<<<<<<<
- *
- * def date2index(dates, nctime, calendar=None, select='exact'):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdftime, __pyx_n_s_num2date); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5368, __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_15 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_times); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5368, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5368, __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_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_times);
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5368, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_15;
- __pyx_t_15 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5267
- * return cdftime.date2num(dates)
- *
- * def num2date(times,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`num2date(times,units,calendar='standard')`**
- */
-
- /* 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_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("netCDF4._netCDF4.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_basedate);
- __Pyx_XDECREF(__pyx_v_unit);
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_mask);
- __Pyx_XDECREF(__pyx_v_dates);
- __Pyx_XDECREF(__pyx_v_time);
- __Pyx_XDECREF(__pyx_v_tsecs);
- __Pyx_XDECREF(__pyx_v_days);
- __Pyx_XDECREF(__pyx_v_msecsd);
- __Pyx_XDECREF(__pyx_v_secs);
- __Pyx_XDECREF(__pyx_v_msecs);
- __Pyx_XDECREF(__pyx_v_td);
- __Pyx_XDECREF(__pyx_v_date);
- __Pyx_XDECREF(__pyx_v_cdftime);
- __Pyx_XDECREF(__pyx_v_times);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5370
- * return cdftime.num2date(times)
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * **`date2index(dates, nctime, calendar=None, select='exact')`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_21date2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_20date2index[] = "\n**`date2index(dates, nctime, calendar=None, select='exact')`**\n\nReturn indices of a netCDF time variable corresponding to the given dates.\n\n**`dates`**: A datetime object or a sequence of datetime objects.\nThe datetime objects should not include a time-zone offset.\n\n**`nctime`**: A netCDF time variable object. The nctime object must have a\n`units` attribute.\n\n**`calendar`**: describes the calendar used in the time cal [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_21date2index = {"date2index", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_21date2index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_20date2index};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_21date2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dates = 0;
- PyObject *__pyx_v_nctime = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_v_select = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("date2index (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dates,&__pyx_n_s_nctime,&__pyx_n_s_calendar,&__pyx_n_s_select,0};
- PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)Py_None);
- values[3] = ((PyObject *)__pyx_n_s_exact);
- 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_dates)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nctime)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("date2index", 0, 2, 4, 1); __PYX_ERR(0, 5370, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_select);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date2index") < 0)) __PYX_ERR(0, 5370, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_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);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_dates = values[0];
- __pyx_v_nctime = values[1];
- __pyx_v_calendar = values[2];
- __pyx_v_select = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("date2index", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5370, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_20date2index(__pyx_self, __pyx_v_dates, __pyx_v_nctime, __pyx_v_calendar, __pyx_v_select);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_20date2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dates, PyObject *__pyx_v_nctime, PyObject *__pyx_v_calendar, PyObject *__pyx_v_select) {
- PyObject *__pyx_v_basedate = NULL;
- PyObject *__pyx_v_msg = NULL;
- PyObject *__pyx_v_times = 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;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- int __pyx_t_12;
- Py_ssize_t __pyx_t_13;
- __Pyx_RefNannySetupContext("date2index", 0);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netCDF4/_netCDF4.pyx":5401
- * to the given datetime object(s).
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":5402
- * """
- * try:
- * nctime.units # <<<<<<<<<<<<<<
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5402, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5401
- * to the given datetime object(s).
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5403
- * try:
- * nctime.units
- * except AttributeError: # <<<<<<<<<<<<<<
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * if calendar == None:
- */
- __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
- if (__pyx_t_5) {
- __Pyx_AddTraceback("netCDF4._netCDF4.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 5403, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":5404
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard')
- */
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5404, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __PYX_ERR(0, 5404, __pyx_L5_except_error)
- }
- goto __pyx_L5_except_error;
- __pyx_L5_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5401
- * to the given datetime object(s).
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- __Pyx_PyThreadState_assign
- __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":5405
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- * calendar = calendar.lower()
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_calendar, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5405, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5405, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_9) {
-
- /* "netCDF4/_netCDF4.pyx":5406
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard') # <<<<<<<<<<<<<<
- * calendar = calendar.lower()
- * basedate = _dateparse(nctime.units)
- */
- __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_nctime, __pyx_n_s_calendar, __pyx_n_s_standard); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5406, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5405
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- * calendar = calendar.lower()
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5407
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard')
- * calendar = calendar.lower() # <<<<<<<<<<<<<<
- * basedate = _dateparse(nctime.units)
- * # real-world calendars limited to positive reference years.
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_calendar, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5407, __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_ERR(0, 5407, __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_ERR(0, 5407, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5408
- * calendar = getattr(nctime, 'calendar', 'standard')
- * calendar = calendar.lower()
- * basedate = _dateparse(nctime.units) # <<<<<<<<<<<<<<
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = NULL;
- 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);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5408, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __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+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_basedate = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5410
- * basedate = _dateparse(nctime.units)
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_7 = __pyx_v_calendar;
- __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5410, __pyx_L1_error)
- if (!__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5410, __pyx_L1_error)
- if (!__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5410, __pyx_L1_error)
- if (!__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5410, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_11;
- __pyx_L15_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = (__pyx_t_9 != 0);
- if (__pyx_t_11) {
-
- /* "netCDF4/_netCDF4.pyx":5411
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5411, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_11) {
-
- /* "netCDF4/_netCDF4.pyx":5412
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * elif basedate.year < 0:
- */
- __Pyx_INCREF(__pyx_kp_s_zero_not_allowed_as_a_reference);
- __pyx_v_msg = __pyx_kp_s_zero_not_allowed_as_a_reference;
-
- /* "netCDF4/_netCDF4.pyx":5413
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5413, __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_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5413, __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_ERR(0, 5413, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5411
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if basedate.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5414
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5414, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5414, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_11) {
-
- /* "netCDF4/_netCDF4.pyx":5415
- * raise ValueError(msg)
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- *
- */
- __Pyx_INCREF(__pyx_kp_s_negative_reference_year_in_time);
- __pyx_v_msg = __pyx_kp_s_negative_reference_year_in_time;
-
- /* "netCDF4/_netCDF4.pyx":5416
- * elif basedate.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5416, __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_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5416, __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_ERR(0, 5416, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5414
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif basedate.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5410
- * basedate = _dateparse(nctime.units)
- * # real-world calendars limited to positive reference years.
- * if calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if basedate.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5418
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime
- */
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5418, __pyx_L1_error)
- if (!__pyx_t_9) {
- goto __pyx_L22_next_or;
- } else {
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_basedate, __pyx_n_s_year); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5418, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 5418, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (!__pyx_t_9) {
- } else {
- __pyx_t_11 = __pyx_t_9;
- goto __pyx_L21_bool_binop_done;
- }
- __pyx_L22_next_or:;
-
- /* "netCDF4/_netCDF4.pyx":5419
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- * (calendar in ['gregorian','standard'] and basedate > gregorian): # <<<<<<<<<<<<<<
- * # use python datetime
- * times = date2num(dates,nctime.units,calendar=calendar)
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_10 = __pyx_v_calendar;
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5419, __pyx_L1_error)
- if (!__pyx_t_12) {
- } else {
- __pyx_t_9 = __pyx_t_12;
- goto __pyx_L25_bool_binop_done;
- }
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5419, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_12;
- __pyx_L25_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_12 = (__pyx_t_9 != 0);
- if (__pyx_t_12) {
- } else {
- __pyx_t_11 = __pyx_t_12;
- goto __pyx_L21_bool_binop_done;
- }
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_gregorian); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_basedate, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5419, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5419, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __pyx_t_12;
- __pyx_L21_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":5418
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime
- */
- if (__pyx_t_11) {
-
- /* "netCDF4/_netCDF4.pyx":5421
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime
- * times = date2num(dates,nctime.units,calendar=calendar) # <<<<<<<<<<<<<<
- * return netcdftime.time2index(times, nctime, calendar, select)
- * else: # use netcdftime module for other cases
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_date2num); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_dates);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 5421, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_v_times = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5422
- * # use python datetime
- * times = date2num(dates,nctime.units,calendar=calendar)
- * return netcdftime.time2index(times, nctime, calendar, select) # <<<<<<<<<<<<<<
- * else: # use netcdftime module for other cases
- * return netcdftime.date2index(dates, nctime, calendar, select)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdftime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_time2index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- __pyx_t_13 = 0;
- 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);
- __pyx_t_13 = 1;
- }
- }
- __pyx_t_6 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_v_times);
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_GIVEREF(__pyx_v_nctime);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_v_nctime);
- __Pyx_INCREF(__pyx_v_calendar);
- __Pyx_GIVEREF(__pyx_v_calendar);
- PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_13, __pyx_v_calendar);
- __Pyx_INCREF(__pyx_v_select);
- __Pyx_GIVEREF(__pyx_v_select);
- PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_13, __pyx_v_select);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5418
- * raise ValueError(msg)
- *
- * if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \ # <<<<<<<<<<<<<<
- * (calendar in ['gregorian','standard'] and basedate > gregorian):
- * # use python datetime
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5424
- * return netcdftime.time2index(times, nctime, calendar, select)
- * else: # use netcdftime module for other cases
- * return netcdftime.date2index(dates, nctime, calendar, select) # <<<<<<<<<<<<<<
- *
- * class MFDataset(Dataset):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_date2index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- __pyx_t_13 = 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_13 = 1;
- }
- }
- __pyx_t_10 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5424, __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_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_v_dates);
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_GIVEREF(__pyx_v_nctime);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_v_nctime);
- __Pyx_INCREF(__pyx_v_calendar);
- __Pyx_GIVEREF(__pyx_v_calendar);
- PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_13, __pyx_v_calendar);
- __Pyx_INCREF(__pyx_v_select);
- __Pyx_GIVEREF(__pyx_v_select);
- PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_13, __pyx_v_select);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5370
- * return cdftime.num2date(times)
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * **`date2index(dates, nctime, calendar=None, select='exact')`**
- */
-
- /* function exit code */
- __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_10);
- __Pyx_AddTraceback("netCDF4._netCDF4.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_basedate);
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XDECREF(__pyx_v_times);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5456
- * """
- *
- * def __init__(self, files, check=False, aggdim=None, exclude=[]): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, files, check=False, aggdim=None, exclude=[])`**
- */
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("__defaults__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5456, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)Py_False));
- __Pyx_GIVEREF(((PyObject *)Py_False));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False));
- __Pyx_INCREF(((PyObject *)Py_None));
- __Pyx_GIVEREF(((PyObject *)Py_None));
- PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
- __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exclude);
- __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exclude);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exclude);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5456, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
- __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_9MFDataset___init__[] = "\n **`__init__(self, files, check=False, aggdim=None, exclude=[])`**\n\n Open a Dataset spanning multiple files, making it look as if it was a\n single file. Variables in the list of files that share the same\n dimension (specified with the keyword `aggdim`) are aggregated. If\n `aggdim` is not specified, the unlimited is aggregated. Currently,\n `aggdim` must be the leftmost (slo [...]
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_9MFDataset___init__};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_files = 0;
- PyObject *__pyx_v_check = 0;
- PyObject *__pyx_v_aggdim = 0;
- PyObject *__pyx_v_exclude = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_files,&__pyx_n_s_check,&__pyx_n_s_aggdim,&__pyx_n_s_exclude,0};
- PyObject* values[5] = {0,0,0,0,0};
- __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
- values[2] = ((PyObject *)((PyObject *)Py_False));
- values[3] = ((PyObject *)((PyObject *)Py_None));
- values[4] = __pyx_dynamic_args->__pyx_arg_exclude;
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- 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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_files)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 5456, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_aggdim);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exclude);
- if (value) { values[4] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5456, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- 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_self = values[0];
- __pyx_v_files = values[1];
- __pyx_v_check = values[2];
- __pyx_v_aggdim = values[3];
- __pyx_v_exclude = values[4];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5456, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset___init__(__pyx_self, __pyx_v_self, __pyx_v_files, __pyx_v_check, __pyx_v_aggdim, __pyx_v_exclude);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_v_msg = NULL;
- PyObject *__pyx_v_master = NULL;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_cdfm = NULL;
- PyObject *__pyx_v_name = NULL;
- PyObject *__pyx_v_value = NULL;
- PyObject *__pyx_v_aggDimId = NULL;
- PyObject *__pyx_v_dimname = NULL;
- PyObject *__pyx_v_dim = NULL;
- PyObject *__pyx_v_aggDimName = NULL;
- PyObject *__pyx_v_masterRecVar = NULL;
- PyObject *__pyx_v_vName = NULL;
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_v_dims = NULL;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_dtype = NULL;
- PyObject *__pyx_v_cdf = NULL;
- PyObject *__pyx_v_cdfVLen = NULL;
- PyObject *__pyx_v_cdfRecVar = NULL;
- PyObject *__pyx_v_f = NULL;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_part = NULL;
- PyObject *__pyx_v_varInfo = NULL;
- PyObject *__pyx_v_masterDims = NULL;
- PyObject *__pyx_v_masterShape = NULL;
- PyObject *__pyx_v_masterType = NULL;
- PyObject *__pyx_v_extDims = NULL;
- PyObject *__pyx_v_extShape = NULL;
- PyObject *__pyx_v_extType = NULL;
- PyObject *__pyx_v_vInst = NULL;
- PyObject *__pyx_v_varname = NULL;
- PyObject *__pyx_v_var = NULL;
- PyObject *__pyx_v_dset = NULL;
- 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;
- int __pyx_t_8;
- Py_ssize_t __pyx_t_9;
- PyObject *(*__pyx_t_10)(PyObject *);
- PyObject *(*__pyx_t_11)(PyObject *);
- Py_ssize_t __pyx_t_12;
- PyObject *(*__pyx_t_13)(PyObject *);
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- Py_ssize_t __pyx_t_16;
- Py_ssize_t __pyx_t_17;
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_files);
-
- /* "netCDF4/_netCDF4.pyx":5489
- * # Open the master file in the base class, so that the CDFMF instance
- * # can be used like a CDF instance.
- * if isinstance(files, str): # <<<<<<<<<<<<<<
- * if files.startswith('http'):
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- */
- __pyx_t_1 = PyString_Check(__pyx_v_files);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5490
- * # can be used like a CDF instance.
- * if isinstance(files, str):
- * if files.startswith('http'): # <<<<<<<<<<<<<<
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- * raise ValueError(msg)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_files, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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_ERR(0, 5490, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5491
- * if isinstance(files, str):
- * if files.startswith('http'):
- * msg='cannot using file globbing for remote (OPeNDAP) datasets' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * else:
- */
- __Pyx_INCREF(__pyx_kp_s_cannot_using_file_globbing_for_r);
- __pyx_v_msg = __pyx_kp_s_cannot_using_file_globbing_for_r;
-
- /* "netCDF4/_netCDF4.pyx":5492
- * if files.startswith('http'):
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * else:
- * files = sorted(glob(files))
- */
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5492, __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_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5492, __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_ERR(0, 5492, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5490
- * # can be used like a CDF instance.
- * if isinstance(files, str):
- * if files.startswith('http'): # <<<<<<<<<<<<<<
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- * raise ValueError(msg)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5494
- * raise ValueError(msg)
- * else:
- * files = sorted(glob(files)) # <<<<<<<<<<<<<<
- *
- * master = files[0]
- */
- /*else*/ {
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5494, __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_files); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5494, __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_files);
- __Pyx_GIVEREF(__pyx_v_files);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_files);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5494, __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_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = ((PyObject*)__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_8 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5494, __pyx_L1_error)
- __Pyx_DECREF_SET(__pyx_v_files, __pyx_t_3);
- __pyx_t_3 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5489
- * # Open the master file in the base class, so that the CDFMF instance
- * # can be used like a CDF instance.
- * if isinstance(files, str): # <<<<<<<<<<<<<<
- * if files.startswith('http'):
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5496
- * files = sorted(glob(files))
- *
- * master = files[0] # <<<<<<<<<<<<<<
- *
- * # Open the master again, this time as a classic CDF instance. This will avoid
- */
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_files, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5496, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_master = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5500
- * # Open the master again, this time as a classic CDF instance. This will avoid
- * # calling methods of the CDFMF subclass when querying the master file.
- * cdfm = Dataset(master) # <<<<<<<<<<<<<<
- * # copy attributes from master.
- * for name, value in cdfm.__dict__.items():
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_master);
- __Pyx_GIVEREF(__pyx_v_master);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_master);
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_cdfm = ((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5502
- * cdfm = Dataset(master)
- * # copy attributes from master.
- * for name, value in cdfm.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cdfm), __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5502, __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 && likely(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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5502, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5502, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5502, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_10(__pyx_t_4);
- 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_ERR(0, 5502, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #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_ERR(0, 5502, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 5502, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L8_unpacking_done;
- __pyx_L7_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5502, __pyx_L1_error)
- __pyx_L8_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5503
- * # copy attributes from master.
- * for name, value in cdfm.__dict__.items():
- * self.__dict__[name] = value # <<<<<<<<<<<<<<
- *
- * # Make sure the master defines a dim with name aggdim,
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5503, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 5503, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5502
- * cdfm = Dataset(master)
- * # copy attributes from master.
- * for name, value in cdfm.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- *
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5507
- * # Make sure the master defines a dim with name aggdim,
- * # or an unlimited dimension.
- * aggDimId = None # <<<<<<<<<<<<<<
- * for dimname,dim in cdfm.dimensions.items():
- * if aggdim is None:
- */
- __Pyx_INCREF(Py_None);
- __pyx_v_aggDimId = Py_None;
-
- /* "netCDF4/_netCDF4.pyx":5508
- * # or an unlimited dimension.
- * aggDimId = None
- * for dimname,dim in cdfm.dimensions.items(): # <<<<<<<<<<<<<<
- * if aggdim is None:
- * if dim.isunlimited():
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdfm->dimensions, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = NULL;
- 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);
- }
- }
- if (__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5508, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- 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_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5508, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5508, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5508, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_10(__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_ERR(0, 5508, __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_ERR(0, 5508, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 5508, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L12_unpacking_done;
- __pyx_L11_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5508, __pyx_L1_error)
- __pyx_L12_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_7);
- __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5509
- * aggDimId = None
- * for dimname,dim in cdfm.dimensions.items():
- * if aggdim is None: # <<<<<<<<<<<<<<
- * if dim.isunlimited():
- * aggDimId = dim
- */
- __pyx_t_2 = (__pyx_v_aggdim == Py_None);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5510
- * for dimname,dim in cdfm.dimensions.items():
- * if aggdim is None:
- * if dim.isunlimited(): # <<<<<<<<<<<<<<
- * aggDimId = dim
- * aggDimName = dimname
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5510, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5510, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5510, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5510, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5511
- * if aggdim is None:
- * if dim.isunlimited():
- * aggDimId = dim # <<<<<<<<<<<<<<
- * aggDimName = dimname
- * else:
- */
- __Pyx_INCREF(__pyx_v_dim);
- __Pyx_DECREF_SET(__pyx_v_aggDimId, __pyx_v_dim);
-
- /* "netCDF4/_netCDF4.pyx":5512
- * if dim.isunlimited():
- * aggDimId = dim
- * aggDimName = dimname # <<<<<<<<<<<<<<
- * else:
- * if dimname == aggdim:
- */
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_XDECREF_SET(__pyx_v_aggDimName, __pyx_v_dimname);
-
- /* "netCDF4/_netCDF4.pyx":5510
- * for dimname,dim in cdfm.dimensions.items():
- * if aggdim is None:
- * if dim.isunlimited(): # <<<<<<<<<<<<<<
- * aggDimId = dim
- * aggDimName = dimname
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5509
- * aggDimId = None
- * for dimname,dim in cdfm.dimensions.items():
- * if aggdim is None: # <<<<<<<<<<<<<<
- * if dim.isunlimited():
- * aggDimId = dim
- */
- goto __pyx_L13;
- }
-
- /* "netCDF4/_netCDF4.pyx":5514
- * aggDimName = dimname
- * else:
- * if dimname == aggdim: # <<<<<<<<<<<<<<
- * aggDimId = dim
- * aggDimName = dimname
- */
- /*else*/ {
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_dimname, __pyx_v_aggdim, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5514, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5514, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5515
- * else:
- * if dimname == aggdim:
- * aggDimId = dim # <<<<<<<<<<<<<<
- * aggDimName = dimname
- * if aggDimId is None:
- */
- __Pyx_INCREF(__pyx_v_dim);
- __Pyx_DECREF_SET(__pyx_v_aggDimId, __pyx_v_dim);
-
- /* "netCDF4/_netCDF4.pyx":5516
- * if dimname == aggdim:
- * aggDimId = dim
- * aggDimName = dimname # <<<<<<<<<<<<<<
- * if aggDimId is None:
- * raise IOError("master dataset %s does not have a aggregation dimension" % master)
- */
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_XDECREF_SET(__pyx_v_aggDimName, __pyx_v_dimname);
-
- /* "netCDF4/_netCDF4.pyx":5514
- * aggDimName = dimname
- * else:
- * if dimname == aggdim: # <<<<<<<<<<<<<<
- * aggDimId = dim
- * aggDimName = dimname
- */
- }
- }
- __pyx_L13:;
-
- /* "netCDF4/_netCDF4.pyx":5508
- * # or an unlimited dimension.
- * aggDimId = None
- * for dimname,dim in cdfm.dimensions.items(): # <<<<<<<<<<<<<<
- * if aggdim is None:
- * if dim.isunlimited():
- */
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5517
- * aggDimId = dim
- * aggDimName = dimname
- * if aggDimId is None: # <<<<<<<<<<<<<<
- * raise IOError("master dataset %s does not have a aggregation dimension" % master)
- *
- */
- __pyx_t_1 = (__pyx_v_aggDimId == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5518
- * aggDimName = dimname
- * if aggDimId is None:
- * raise IOError("master dataset %s does not have a aggregation dimension" % master) # <<<<<<<<<<<<<<
- *
- * # Get info on all aggregation variables defined in the master.
- */
- __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_master_dataset_s_does_not_have_a, __pyx_v_master); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5518, __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 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5518, __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_ERR(0, 5518, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5517
- * aggDimId = dim
- * aggDimName = dimname
- * if aggDimId is None: # <<<<<<<<<<<<<<
- * raise IOError("master dataset %s does not have a aggregation dimension" % master)
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5522
- * # Get info on all aggregation variables defined in the master.
- * # Make sure the master defines at least one aggregation variable.
- * masterRecVar = {} # <<<<<<<<<<<<<<
- * for vName,v in cdfm.variables.items():
- * # skip variables specified in exclude list.
- */
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5522, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_masterRecVar = ((PyObject*)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5523
- * # Make sure the master defines at least one aggregation variable.
- * masterRecVar = {}
- * for vName,v in cdfm.variables.items(): # <<<<<<<<<<<<<<
- * # skip variables specified in exclude list.
- * if vName in exclude: continue
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdfm->variables, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5523, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5523, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5523, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5523, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_10(__pyx_t_4);
- 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_ERR(0, 5523, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #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_ERR(0, 5523, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5523, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L19_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 5523, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L20_unpacking_done;
- __pyx_L19_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5523, __pyx_L1_error)
- __pyx_L20_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_vName, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5525
- * for vName,v in cdfm.variables.items():
- * # skip variables specified in exclude list.
- * if vName in exclude: continue # <<<<<<<<<<<<<<
- * dims = v.dimensions
- * shape = v.shape
- */
- __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_vName, __pyx_v_exclude, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5525, __pyx_L1_error)
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
- goto __pyx_L17_continue;
- }
-
- /* "netCDF4/_netCDF4.pyx":5526
- * # skip variables specified in exclude list.
- * if vName in exclude: continue
- * dims = v.dimensions # <<<<<<<<<<<<<<
- * shape = v.shape
- * dtype = v.dtype
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_dims, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5527
- * if vName in exclude: continue
- * dims = v.dimensions
- * shape = v.shape # <<<<<<<<<<<<<<
- * dtype = v.dtype
- * # Be careful: we may deal with a scalar (dimensionless) variable.
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5527, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5528
- * dims = v.dimensions
- * shape = v.shape
- * dtype = v.dtype # <<<<<<<<<<<<<<
- * # Be careful: we may deal with a scalar (dimensionless) variable.
- * # Unlimited dimension always occupies index 0.
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5528, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5531
- * # Be careful: we may deal with a scalar (dimensionless) variable.
- * # Unlimited dimension always occupies index 0.
- * if (len(dims) > 0 and aggDimName == dims[0]): # <<<<<<<<<<<<<<
- * masterRecVar[vName] = (dims, shape, dtype)
- * if len(masterRecVar) == 0:
- */
- __pyx_t_12 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 5531, __pyx_L1_error)
- __pyx_t_2 = ((__pyx_t_12 > 0) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L23_bool_binop_done;
- }
- if (unlikely(!__pyx_v_aggDimName)) { __Pyx_RaiseUnboundLocalError("aggDimName"); __PYX_ERR(0, 5531, __pyx_L1_error) }
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_dims, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_aggDimName, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5531, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5531, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = __pyx_t_2;
- __pyx_L23_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5532
- * # Unlimited dimension always occupies index 0.
- * if (len(dims) > 0 and aggDimName == dims[0]):
- * masterRecVar[vName] = (dims, shape, dtype) # <<<<<<<<<<<<<<
- * if len(masterRecVar) == 0:
- * raise IOError("master dataset %s does not have any variables to aggregate" % master)
- */
- __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_dims);
- __Pyx_GIVEREF(__pyx_v_dims);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_dims);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_shape);
- __Pyx_INCREF(__pyx_v_dtype);
- __Pyx_GIVEREF(__pyx_v_dtype);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_dtype);
- if (unlikely(PyDict_SetItem(__pyx_v_masterRecVar, __pyx_v_vName, __pyx_t_7) < 0)) __PYX_ERR(0, 5532, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5531
- * # Be careful: we may deal with a scalar (dimensionless) variable.
- * # Unlimited dimension always occupies index 0.
- * if (len(dims) > 0 and aggDimName == dims[0]): # <<<<<<<<<<<<<<
- * masterRecVar[vName] = (dims, shape, dtype)
- * if len(masterRecVar) == 0:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5523
- * # Make sure the master defines at least one aggregation variable.
- * masterRecVar = {}
- * for vName,v in cdfm.variables.items(): # <<<<<<<<<<<<<<
- * # skip variables specified in exclude list.
- * if vName in exclude: continue
- */
- __pyx_L17_continue:;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5533
- * if (len(dims) > 0 and aggDimName == dims[0]):
- * masterRecVar[vName] = (dims, shape, dtype)
- * if len(masterRecVar) == 0: # <<<<<<<<<<<<<<
- * raise IOError("master dataset %s does not have any variables to aggregate" % master)
- *
- */
- __pyx_t_9 = PyDict_Size(__pyx_v_masterRecVar); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5533, __pyx_L1_error)
- __pyx_t_1 = ((__pyx_t_9 == 0) != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5534
- * masterRecVar[vName] = (dims, shape, dtype)
- * if len(masterRecVar) == 0:
- * raise IOError("master dataset %s does not have any variables to aggregate" % master) # <<<<<<<<<<<<<<
- *
- * # Create the following:
- */
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_master_dataset_s_does_not_have_a_2, __pyx_v_master); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 5534, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5533
- * if (len(dims) > 0 and aggDimName == dims[0]):
- * masterRecVar[vName] = (dims, shape, dtype)
- * if len(masterRecVar) == 0: # <<<<<<<<<<<<<<
- * raise IOError("master dataset %s does not have any variables to aggregate" % master)
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5542
- * # a list of the corresponding Variable instance, one for each
- * # cdf file of the file set
- * cdf = [cdfm] # <<<<<<<<<<<<<<
- * self._cdf = cdf # Store this now, because dim() method needs it
- * cdfVLen = [len(aggDimId)]
- */
- __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_cdfm));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_cdfm));
- PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_cdfm));
- __pyx_v_cdf = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5543
- * # cdf file of the file set
- * cdf = [cdfm]
- * self._cdf = cdf # Store this now, because dim() method needs it # <<<<<<<<<<<<<<
- * cdfVLen = [len(aggDimId)]
- * cdfRecVar = {}
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdf, __pyx_v_cdf) < 0) __PYX_ERR(0, 5543, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5544
- * cdf = [cdfm]
- * self._cdf = cdf # Store this now, because dim() method needs it
- * cdfVLen = [len(aggDimId)] # <<<<<<<<<<<<<<
- * cdfRecVar = {}
- * for v in masterRecVar.keys():
- */
- __pyx_t_9 = PyObject_Length(__pyx_v_aggDimId); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5544, __pyx_L1_error)
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_4);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_v_cdfVLen = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5545
- * self._cdf = cdf # Store this now, because dim() method needs it
- * cdfVLen = [len(aggDimId)]
- * cdfRecVar = {} # <<<<<<<<<<<<<<
- * for v in masterRecVar.keys():
- * cdfRecVar[v] = [cdfm.variables[v]]
- */
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_cdfRecVar = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5546
- * cdfVLen = [len(aggDimId)]
- * cdfRecVar = {}
- * for v in masterRecVar.keys(): # <<<<<<<<<<<<<<
- * cdfRecVar[v] = [cdfm.variables[v]]
- *
- */
- __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_masterRecVar); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
- __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5546, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5546, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5546, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5546, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- }
- } else {
- __pyx_t_7 = __pyx_t_10(__pyx_t_4);
- 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_ERR(0, 5546, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5547
- * cdfRecVar = {}
- * for v in masterRecVar.keys():
- * cdfRecVar[v] = [cdfm.variables[v]] # <<<<<<<<<<<<<<
- *
- * # Open each remaining file in read-only mode.
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_cdfm->variables, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5547, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_7);
- PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
- __pyx_t_7 = 0;
- if (unlikely(PyDict_SetItem(__pyx_v_cdfRecVar, __pyx_v_v, __pyx_t_5) < 0)) __PYX_ERR(0, 5547, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5546
- * cdfVLen = [len(aggDimId)]
- * cdfRecVar = {}
- * for v in masterRecVar.keys(): # <<<<<<<<<<<<<<
- * cdfRecVar[v] = [cdfm.variables[v]]
- *
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5552
- * # Make sure each file defines the same aggregation variables as the master
- * # and that the variables are defined in the same way (name, shape and type)
- * for f in files[1:]: # <<<<<<<<<<<<<<
- * part = Dataset(f)
- * varInfo = part.variables
- */
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_files, 1, 0, NULL, NULL, &__pyx_slice__114, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5552, __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_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5552, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5552, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5552, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_10(__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_ERR(0, 5552, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5553
- * # and that the variables are defined in the same way (name, shape and type)
- * for f in files[1:]:
- * part = Dataset(f) # <<<<<<<<<<<<<<
- * varInfo = part.variables
- * for v in masterRecVar.keys():
- */
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f);
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_part, ((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_t_7));
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5554
- * for f in files[1:]:
- * part = Dataset(f)
- * varInfo = part.variables # <<<<<<<<<<<<<<
- * for v in masterRecVar.keys():
- * if check:
- */
- __pyx_t_7 = __pyx_v_part->variables;
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_varInfo, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5555
- * part = Dataset(f)
- * varInfo = part.variables
- * for v in masterRecVar.keys(): # <<<<<<<<<<<<<<
- * if check:
- * # Make sure master rec var is also defined here.
- */
- __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_masterRecVar); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
- __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
- __pyx_t_13 = NULL;
- } else {
- __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 5555, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (likely(!__pyx_t_13)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 5555, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- } else {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 5555, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- }
- } else {
- __pyx_t_7 = __pyx_t_13(__pyx_t_4);
- 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_ERR(0, 5555, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5556
- * varInfo = part.variables
- * for v in masterRecVar.keys():
- * if check: # <<<<<<<<<<<<<<
- * # Make sure master rec var is also defined here.
- * if v not in varInfo.keys():
- */
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_check); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5556, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5558
- * if check:
- * # Make sure master rec var is also defined here.
- * if v not in varInfo.keys(): # <<<<<<<<<<<<<<
- * raise IOError("aggregation variable %s not defined in %s" % (v, f))
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_varInfo, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5558, __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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5558, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5558, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_v, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5558, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5559
- * # Make sure master rec var is also defined here.
- * if v not in varInfo.keys():
- * raise IOError("aggregation variable %s not defined in %s" % (v, f)) # <<<<<<<<<<<<<<
- *
- * #if not vInst.dimensions[0] != aggDimName:
- */
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5559, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_v);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_f);
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_aggregation_variable_s_not_defin, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5559, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5559, __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 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5559, __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_ERR(0, 5559, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5558
- * if check:
- * # Make sure master rec var is also defined here.
- * if v not in varInfo.keys(): # <<<<<<<<<<<<<<
- * raise IOError("aggregation variable %s not defined in %s" % (v, f))
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5563
- * #if not vInst.dimensions[0] != aggDimName:
- *
- * masterDims, masterShape, masterType = masterRecVar[v][:3] # <<<<<<<<<<<<<<
- * extDims = varInfo[v].dimensions
- * extShape = varInfo[v].shape
- */
- __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_masterRecVar, __pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__115, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- 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_ERR(0, 5563, __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_14 = PyTuple_GET_ITEM(sequence, 2);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_14 = PyList_GET_ITEM(sequence, 2);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_14);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- #endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_15 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_15)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L34_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_15); if (unlikely(!__pyx_t_6)) goto __pyx_L34_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- index = 2; __pyx_t_14 = __pyx_t_11(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L34_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_14);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_15), 3) < 0) __PYX_ERR(0, 5563, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- goto __pyx_L35_unpacking_done;
- __pyx_L34_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5563, __pyx_L1_error)
- __pyx_L35_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_masterDims, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_masterShape, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_masterType, __pyx_t_14);
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5564
- *
- * masterDims, masterShape, masterType = masterRecVar[v][:3]
- * extDims = varInfo[v].dimensions # <<<<<<<<<<<<<<
- * extShape = varInfo[v].shape
- * extType = varInfo[v].dtype
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_varInfo, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5564, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5564, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_extDims, __pyx_t_14);
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5565
- * masterDims, masterShape, masterType = masterRecVar[v][:3]
- * extDims = varInfo[v].dimensions
- * extShape = varInfo[v].shape # <<<<<<<<<<<<<<
- * extType = varInfo[v].dtype
- * # Check that dimension names are identical.
- */
- __pyx_t_14 = PyObject_GetItem(__pyx_v_varInfo, __pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5565, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5565, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF_SET(__pyx_v_extShape, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5566
- * extDims = varInfo[v].dimensions
- * extShape = varInfo[v].shape
- * extType = varInfo[v].dtype # <<<<<<<<<<<<<<
- * # Check that dimension names are identical.
- * if masterDims != extDims:
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_varInfo, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5566, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5566, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_extType, __pyx_t_14);
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5568
- * extType = varInfo[v].dtype
- * # Check that dimension names are identical.
- * if masterDims != extDims: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : dimensions mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- __pyx_t_14 = PyObject_RichCompare(__pyx_v_masterDims, __pyx_v_extDims, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5568, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5568, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5571
- * raise IOError("variable %s : dimensions mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterDims, f, extDims)) # <<<<<<<<<<<<<<
- *
- * # Check that the ranks are identical, and the dimension lengths are
- */
- __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5571, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_INCREF(__pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_v);
- __Pyx_INCREF(__pyx_v_master);
- __Pyx_GIVEREF(__pyx_v_master);
- PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_master);
- __Pyx_INCREF(__pyx_v_masterDims);
- __Pyx_GIVEREF(__pyx_v_masterDims);
- PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_masterDims);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_f);
- __Pyx_INCREF(__pyx_v_extDims);
- __Pyx_GIVEREF(__pyx_v_extDims);
- PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_v_extDims);
-
- /* "netCDF4/_netCDF4.pyx":5570
- * if masterDims != extDims:
- * raise IOError("variable %s : dimensions mismatch between "
- * "master %s (%s) and extension %s (%s)" % # <<<<<<<<<<<<<<
- * (v, master, masterDims, f, extDims))
- *
- */
- __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_variable_s_dimensions_mismatch_b, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5569
- * # Check that dimension names are identical.
- * if masterDims != extDims:
- * raise IOError("variable %s : dimensions mismatch between " # <<<<<<<<<<<<<<
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterDims, f, extDims))
- */
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 5569, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5568
- * extType = varInfo[v].dtype
- * # Check that dimension names are identical.
- * if masterDims != extDims: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : dimensions mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5576
- * # identical (except for that of the unlimited dimension, which of
- * # course may vary.
- * if len(masterShape) != len(extShape): # <<<<<<<<<<<<<<
- * raise IOError("variable %s : rank mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- __pyx_t_16 = PyObject_Length(__pyx_v_masterShape); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 5576, __pyx_L1_error)
- __pyx_t_17 = PyObject_Length(__pyx_v_extShape); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 5576, __pyx_L1_error)
- __pyx_t_2 = ((__pyx_t_16 != __pyx_t_17) != 0);
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5579
- * raise IOError("variable %s : rank mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, len(masterShape), f, len(extShape))) # <<<<<<<<<<<<<<
- * if masterShape[1:] != extShape[1:]:
- * raise IOError("variable %s : shape mismatch between "
- */
- __pyx_t_17 = PyObject_Length(__pyx_v_masterShape); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 5579, __pyx_L1_error)
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5579, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_17 = PyObject_Length(__pyx_v_extShape); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 5579, __pyx_L1_error)
- __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5579, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5579, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_v);
- __Pyx_INCREF(__pyx_v_master);
- __Pyx_GIVEREF(__pyx_v_master);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_master);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_f);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_14);
- __pyx_t_7 = 0;
- __pyx_t_14 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5578
- * if len(masterShape) != len(extShape):
- * raise IOError("variable %s : rank mismatch between "
- * "master %s (%s) and extension %s (%s)" % # <<<<<<<<<<<<<<
- * (v, master, len(masterShape), f, len(extShape)))
- * if masterShape[1:] != extShape[1:]:
- */
- __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_variable_s_rank_mismatch_between, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5578, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5577
- * # course may vary.
- * if len(masterShape) != len(extShape):
- * raise IOError("variable %s : rank mismatch between " # <<<<<<<<<<<<<<
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, len(masterShape), f, len(extShape)))
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_14, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __PYX_ERR(0, 5577, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5576
- * # identical (except for that of the unlimited dimension, which of
- * # course may vary.
- * if len(masterShape) != len(extShape): # <<<<<<<<<<<<<<
- * raise IOError("variable %s : rank mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5580
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, len(masterShape), f, len(extShape)))
- * if masterShape[1:] != extShape[1:]: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : shape mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- __pyx_t_14 = __Pyx_PyObject_GetSlice(__pyx_v_masterShape, 1, 0, NULL, NULL, &__pyx_slice__116, 1, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_extShape, 1, 0, NULL, NULL, &__pyx_slice__117, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_14, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5583
- * raise IOError("variable %s : shape mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterShape, f, extShape)) # <<<<<<<<<<<<<<
- *
- * # Check that the data types are identical.
- */
- __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5583, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_v);
- __Pyx_INCREF(__pyx_v_master);
- __Pyx_GIVEREF(__pyx_v_master);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_master);
- __Pyx_INCREF(__pyx_v_masterShape);
- __Pyx_GIVEREF(__pyx_v_masterShape);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_masterShape);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_f);
- __Pyx_INCREF(__pyx_v_extShape);
- __Pyx_GIVEREF(__pyx_v_extShape);
- PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_extShape);
-
- /* "netCDF4/_netCDF4.pyx":5582
- * if masterShape[1:] != extShape[1:]:
- * raise IOError("variable %s : shape mismatch between "
- * "master %s (%s) and extension %s (%s)" % # <<<<<<<<<<<<<<
- * (v, master, masterShape, f, extShape))
- *
- */
- __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_variable_s_shape_mismatch_betwee, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5582, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5581
- * (v, master, len(masterShape), f, len(extShape)))
- * if masterShape[1:] != extShape[1:]:
- * raise IOError("variable %s : shape mismatch between " # <<<<<<<<<<<<<<
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterShape, f, extShape))
- */
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5581, __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_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5581, __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_ERR(0, 5581, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5580
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, len(masterShape), f, len(extShape)))
- * if masterShape[1:] != extShape[1:]: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : shape mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5586
- *
- * # Check that the data types are identical.
- * if masterType != extType: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : data type mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_masterType, __pyx_v_extType, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5586, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5586, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5589
- * raise IOError("variable %s : data type mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterType, f, extType)) # <<<<<<<<<<<<<<
- *
- * # Everything ok.
- */
- __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5589, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_v);
- __Pyx_INCREF(__pyx_v_master);
- __Pyx_GIVEREF(__pyx_v_master);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_master);
- __Pyx_INCREF(__pyx_v_masterType);
- __Pyx_GIVEREF(__pyx_v_masterType);
- PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_masterType);
- __Pyx_INCREF(__pyx_v_f);
- __Pyx_GIVEREF(__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_f);
- __Pyx_INCREF(__pyx_v_extType);
- __Pyx_GIVEREF(__pyx_v_extType);
- PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_extType);
-
- /* "netCDF4/_netCDF4.pyx":5588
- * if masterType != extType:
- * raise IOError("variable %s : data type mismatch between "
- * "master %s (%s) and extension %s (%s)" % # <<<<<<<<<<<<<<
- * (v, master, masterType, f, extType))
- *
- */
- __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_variable_s_data_type_mismatch_be, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5588, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5587
- * # Check that the data types are identical.
- * if masterType != extType:
- * raise IOError("variable %s : data type mismatch between " # <<<<<<<<<<<<<<
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, masterType, f, extType))
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5587, __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(__pyx_builtin_IOError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5587, __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_ERR(0, 5587, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5586
- *
- * # Check that the data types are identical.
- * if masterType != extType: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : data type mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5592
- *
- * # Everything ok.
- * vInst = part.variables[v] # <<<<<<<<<<<<<<
- * cdfRecVar[v].append(vInst)
- * else:
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_part->variables, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5592, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_vInst, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5593
- * # Everything ok.
- * vInst = part.variables[v]
- * cdfRecVar[v].append(vInst) # <<<<<<<<<<<<<<
- * else:
- * # No making sure of anything -- assume this is ok..
- */
- __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_cdfRecVar, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5593, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_v_vInst); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5593, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5556
- * varInfo = part.variables
- * for v in masterRecVar.keys():
- * if check: # <<<<<<<<<<<<<<
- * # Make sure master rec var is also defined here.
- * if v not in varInfo.keys():
- */
- goto __pyx_L32;
- }
-
- /* "netCDF4/_netCDF4.pyx":5596
- * else:
- * # No making sure of anything -- assume this is ok..
- * vInst = part.variables[v] # <<<<<<<<<<<<<<
- * cdfRecVar[v].append(vInst)
- *
- */
- /*else*/ {
- __pyx_t_7 = PyObject_GetItem(__pyx_v_part->variables, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5596, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_vInst, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5597
- * # No making sure of anything -- assume this is ok..
- * vInst = part.variables[v]
- * cdfRecVar[v].append(vInst) # <<<<<<<<<<<<<<
- *
- * cdf.append(part)
- */
- __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_cdfRecVar, __pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5597, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_v_vInst); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5597, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __pyx_L32:;
-
- /* "netCDF4/_netCDF4.pyx":5555
- * part = Dataset(f)
- * varInfo = part.variables
- * for v in masterRecVar.keys(): # <<<<<<<<<<<<<<
- * if check:
- * # Make sure master rec var is also defined here.
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5599
- * cdfRecVar[v].append(vInst)
- *
- * cdf.append(part) # <<<<<<<<<<<<<<
- * cdfVLen.append(len(part.dimensions[aggDimName]))
- *
- */
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cdf, ((PyObject *)__pyx_v_part)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5599, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5600
- *
- * cdf.append(part)
- * cdfVLen.append(len(part.dimensions[aggDimName])) # <<<<<<<<<<<<<<
- *
- * # Attach attributes to the MFDataset instance.
- */
- if (unlikely(!__pyx_v_aggDimName)) { __Pyx_RaiseUnboundLocalError("aggDimName"); __PYX_ERR(0, 5600, __pyx_L1_error) }
- __pyx_t_4 = PyObject_GetItem(__pyx_v_part->dimensions, __pyx_v_aggDimName); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5600, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 5600, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5600, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cdfVLen, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5600, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5552
- * # Make sure each file defines the same aggregation variables as the master
- * # and that the variables are defined in the same way (name, shape and type)
- * for f in files[1:]: # <<<<<<<<<<<<<<
- * part = Dataset(f)
- * varInfo = part.variables
- */
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5604
- * # Attach attributes to the MFDataset instance.
- * # A local __setattr__() method is required for them.
- * self._files = files # list of cdf file names in the set # <<<<<<<<<<<<<<
- * self._cdfVLen = cdfVLen # list of unlimited lengths
- * self._cdfTLen = sum(cdfVLen) # total length
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_files_2, __pyx_v_files) < 0) __PYX_ERR(0, 5604, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5605
- * # A local __setattr__() method is required for them.
- * self._files = files # list of cdf file names in the set
- * self._cdfVLen = cdfVLen # list of unlimited lengths # <<<<<<<<<<<<<<
- * self._cdfTLen = sum(cdfVLen) # total length
- * self._cdfRecVar = cdfRecVar # dictionary of Variable instances for all
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdfVLen, __pyx_v_cdfVLen) < 0) __PYX_ERR(0, 5605, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5606
- * self._files = files # list of cdf file names in the set
- * self._cdfVLen = cdfVLen # list of unlimited lengths
- * self._cdfTLen = sum(cdfVLen) # total length # <<<<<<<<<<<<<<
- * self._cdfRecVar = cdfRecVar # dictionary of Variable instances for all
- * # the aggregation variables
- */
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5606, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_cdfVLen);
- __Pyx_GIVEREF(__pyx_v_cdfVLen);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cdfVLen);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5606, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdfTLen, __pyx_t_4) < 0) __PYX_ERR(0, 5606, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5607
- * self._cdfVLen = cdfVLen # list of unlimited lengths
- * self._cdfTLen = sum(cdfVLen) # total length
- * self._cdfRecVar = cdfRecVar # dictionary of Variable instances for all # <<<<<<<<<<<<<<
- * # the aggregation variables
- * self._dims = cdfm.dimensions
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdfRecVar, __pyx_v_cdfRecVar) < 0) __PYX_ERR(0, 5607, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5609
- * self._cdfRecVar = cdfRecVar # dictionary of Variable instances for all
- * # the aggregation variables
- * self._dims = cdfm.dimensions # <<<<<<<<<<<<<<
- * self._grps = cdfm.groups
- * for dimname, dim in self._dims.items():
- */
- __pyx_t_4 = __pyx_v_cdfm->dimensions;
- __Pyx_INCREF(__pyx_t_4);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dims, __pyx_t_4) < 0) __PYX_ERR(0, 5609, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5610
- * # the aggregation variables
- * self._dims = cdfm.dimensions
- * self._grps = cdfm.groups # <<<<<<<<<<<<<<
- * for dimname, dim in self._dims.items():
- * if dimname == aggDimName:
- */
- __pyx_t_4 = __pyx_v_cdfm->groups;
- __Pyx_INCREF(__pyx_t_4);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_grps, __pyx_t_4) < 0) __PYX_ERR(0, 5610, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5611
- * self._dims = cdfm.dimensions
- * self._grps = cdfm.groups
- * for dimname, dim in self._dims.items(): # <<<<<<<<<<<<<<
- * if dimname == aggDimName:
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5611, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
- __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5611, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5611, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5611, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_10(__pyx_t_7);
- 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_ERR(0, 5611, __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_ERR(0, 5611, __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_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_14 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5611, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext;
- index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L42_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_6)) goto __pyx_L42_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(0, 5611, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- goto __pyx_L43_unpacking_done;
- __pyx_L42_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5611, __pyx_L1_error)
- __pyx_L43_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5612
- * self._grps = cdfm.groups
- * for dimname, dim in self._dims.items():
- * if dimname == aggDimName: # <<<<<<<<<<<<<<
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- * self._vars = cdfm.variables
- */
- if (unlikely(!__pyx_v_aggDimName)) { __Pyx_RaiseUnboundLocalError("aggDimName"); __PYX_ERR(0, 5612, __pyx_L1_error) }
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_dimname, __pyx_v_aggDimName, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5612, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5612, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netCDF4/_netCDF4.pyx":5613
- * for dimname, dim in self._dims.items():
- * if dimname == aggDimName:
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen) # <<<<<<<<<<<<<<
- * self._vars = cdfm.variables
- * for varname,var in self._vars.items():
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dimension); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdfVLen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdfTLen); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_3 = NULL;
- __pyx_t_12 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
- __pyx_t_12 = 1;
- }
- }
- __pyx_t_15 = PyTuple_New(4+__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_GIVEREF(__pyx_v_dimname);
- PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_12, __pyx_v_dimname);
- __Pyx_INCREF(__pyx_v_dim);
- __Pyx_GIVEREF(__pyx_v_dim);
- PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_12, __pyx_v_dim);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_12, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_12, __pyx_t_14);
- __pyx_t_5 = 0;
- __pyx_t_14 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_dimname, __pyx_t_4) < 0)) __PYX_ERR(0, 5613, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5612
- * self._grps = cdfm.groups
- * for dimname, dim in self._dims.items():
- * if dimname == aggDimName: # <<<<<<<<<<<<<<
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- * self._vars = cdfm.variables
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5611
- * self._dims = cdfm.dimensions
- * self._grps = cdfm.groups
- * for dimname, dim in self._dims.items(): # <<<<<<<<<<<<<<
- * if dimname == aggDimName:
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5614
- * if dimname == aggDimName:
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- * self._vars = cdfm.variables # <<<<<<<<<<<<<<
- * for varname,var in self._vars.items():
- * if varname in self._cdfRecVar.keys():
- */
- __pyx_t_7 = __pyx_v_cdfm->variables;
- __Pyx_INCREF(__pyx_t_7);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vars, __pyx_t_7) < 0) __PYX_ERR(0, 5614, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5615
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- * self._vars = cdfm.variables
- * for varname,var in self._vars.items(): # <<<<<<<<<<<<<<
- * if varname in self._cdfRecVar.keys():
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __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_ERR(0, 5615, __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_ERR(0, 5615, __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_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_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5615, __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_ERR(0, 5615, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5615, __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_ERR(0, 5615, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5615, __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_ERR(0, 5615, __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 != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 5615, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_15);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- #endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5615, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_4)) goto __pyx_L47_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_15 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_15)) goto __pyx_L47_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_15);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(0, 5615, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- goto __pyx_L48_unpacking_done;
- __pyx_L47_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5615, __pyx_L1_error)
- __pyx_L48_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_varname, __pyx_t_4);
- __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_15);
- __pyx_t_15 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5616
- * self._vars = cdfm.variables
- * for varname,var in self._vars.items():
- * if varname in self._cdfRecVar.keys(): # <<<<<<<<<<<<<<
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- * self._file_format = []
- */
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdfRecVar); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 5616, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5616, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5616, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- } else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5616, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_varname, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5616, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5617
- * for varname,var in self._vars.items():
- * if varname in self._cdfRecVar.keys():
- * self._vars[varname] = _Variable(self, varname, var, aggDimName) # <<<<<<<<<<<<<<
- * self._file_format = []
- * self._data_model = []
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_v_aggDimName)) { __Pyx_RaiseUnboundLocalError("aggDimName"); __PYX_ERR(0, 5617, __pyx_L1_error) }
- __pyx_t_15 = NULL;
- __pyx_t_12 = 0;
- 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);
- __pyx_t_12 = 1;
- }
- }
- __pyx_t_14 = PyTuple_New(4+__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- if (__pyx_t_15) {
- __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL;
- }
- __Pyx_INCREF(__pyx_v_self);
- __Pyx_GIVEREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_12, __pyx_v_self);
- __Pyx_INCREF(__pyx_v_varname);
- __Pyx_GIVEREF(__pyx_v_varname);
- PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_12, __pyx_v_varname);
- __Pyx_INCREF(__pyx_v_var);
- __Pyx_GIVEREF(__pyx_v_var);
- PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_12, __pyx_v_var);
- __Pyx_INCREF(__pyx_v_aggDimName);
- __Pyx_GIVEREF(__pyx_v_aggDimName);
- PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_12, __pyx_v_aggDimName);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_varname, __pyx_t_7) < 0)) __PYX_ERR(0, 5617, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5616
- * self._vars = cdfm.variables
- * for varname,var in self._vars.items():
- * if varname in self._cdfRecVar.keys(): # <<<<<<<<<<<<<<
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- * self._file_format = []
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5615
- * self._dims[dimname] = _Dimension(dimname, dim, self._cdfVLen, self._cdfTLen)
- * self._vars = cdfm.variables
- * for varname,var in self._vars.items(): # <<<<<<<<<<<<<<
- * if varname in self._cdfRecVar.keys():
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- */
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5618
- * if varname in self._cdfRecVar.keys():
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- * self._file_format = [] # <<<<<<<<<<<<<<
- * self._data_model = []
- * self._disk_format = []
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5618, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_format_2, __pyx_t_6) < 0) __PYX_ERR(0, 5618, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5619
- * self._vars[varname] = _Variable(self, varname, var, aggDimName)
- * self._file_format = []
- * self._data_model = [] # <<<<<<<<<<<<<<
- * self._disk_format = []
- * for dset in self._cdf:
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5619, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data_model_2, __pyx_t_6) < 0) __PYX_ERR(0, 5619, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5620
- * self._file_format = []
- * self._data_model = []
- * self._disk_format = [] # <<<<<<<<<<<<<<
- * for dset in self._cdf:
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5620, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_disk_format, __pyx_t_6) < 0) __PYX_ERR(0, 5620, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5621
- * self._data_model = []
- * self._disk_format = []
- * for dset in self._cdf: # <<<<<<<<<<<<<<
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5621, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5621, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5621, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_10(__pyx_t_7);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 5621, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_dset, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5622
- * self._disk_format = []
- * for dset in self._cdf:
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4': # <<<<<<<<<<<<<<
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- * self._file_format.append(dset.file_format)
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_file_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5622, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5622, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (!__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L53_bool_binop_done;
- }
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_data_model); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5622, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5622, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_1 = __pyx_t_2;
- __pyx_L53_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netCDF4/_netCDF4.pyx":5623
- * for dset in self._cdf:
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4') # <<<<<<<<<<<<<<
- * self._file_format.append(dset.file_format)
- * self._data_model.append(dset.data_model)
- */
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5623, __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_ERR(0, 5623, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5622
- * self._disk_format = []
- * for dset in self._cdf:
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4': # <<<<<<<<<<<<<<
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- * self._file_format.append(dset.file_format)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5624
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- * self._file_format.append(dset.file_format) # <<<<<<<<<<<<<<
- * self._data_model.append(dset.data_model)
- * self._disk_format.append(dset.disk_format)
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_format_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5624, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_file_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5624, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5624, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5625
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- * self._file_format.append(dset.file_format)
- * self._data_model.append(dset.data_model) # <<<<<<<<<<<<<<
- * self._disk_format.append(dset.disk_format)
- * self._path = '/'
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data_model_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5625, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_data_model); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5625, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5625, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5626
- * self._file_format.append(dset.file_format)
- * self._data_model.append(dset.data_model)
- * self._disk_format.append(dset.disk_format) # <<<<<<<<<<<<<<
- * self._path = '/'
- *
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_disk_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5626, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_disk_format_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5626, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5626, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5621
- * self._data_model = []
- * self._disk_format = []
- * for dset in self._cdf: # <<<<<<<<<<<<<<
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4')
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5627
- * self._data_model.append(dset.data_model)
- * self._disk_format.append(dset.disk_format)
- * self._path = '/' # <<<<<<<<<<<<<<
- *
- * def __setattr__(self, name, value):
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path_2, __pyx_kp_s__15) < 0) __PYX_ERR(0, 5627, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5456
- * """
- *
- * def __init__(self, files, check=False, aggdim=None, exclude=[]): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, files, check=False, aggdim=None, exclude=[])`**
- */
-
- /* 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_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XDECREF(__pyx_v_master);
- __Pyx_XDECREF((PyObject *)__pyx_v_cdfm);
- __Pyx_XDECREF(__pyx_v_name);
- __Pyx_XDECREF(__pyx_v_value);
- __Pyx_XDECREF(__pyx_v_aggDimId);
- __Pyx_XDECREF(__pyx_v_dimname);
- __Pyx_XDECREF(__pyx_v_dim);
- __Pyx_XDECREF(__pyx_v_aggDimName);
- __Pyx_XDECREF(__pyx_v_masterRecVar);
- __Pyx_XDECREF(__pyx_v_vName);
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XDECREF(__pyx_v_dims);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_dtype);
- __Pyx_XDECREF(__pyx_v_cdf);
- __Pyx_XDECREF(__pyx_v_cdfVLen);
- __Pyx_XDECREF(__pyx_v_cdfRecVar);
- __Pyx_XDECREF(__pyx_v_f);
- __Pyx_XDECREF((PyObject *)__pyx_v_part);
- __Pyx_XDECREF(__pyx_v_varInfo);
- __Pyx_XDECREF(__pyx_v_masterDims);
- __Pyx_XDECREF(__pyx_v_masterShape);
- __Pyx_XDECREF(__pyx_v_masterType);
- __Pyx_XDECREF(__pyx_v_extDims);
- __Pyx_XDECREF(__pyx_v_extShape);
- __Pyx_XDECREF(__pyx_v_extType);
- __Pyx_XDECREF(__pyx_v_vInst);
- __Pyx_XDECREF(__pyx_v_varname);
- __Pyx_XDECREF(__pyx_v_var);
- __Pyx_XDECREF(__pyx_v_dset);
- __Pyx_XDECREF(__pyx_v_files);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5629
- * self._path = '/'
- *
- * def __setattr__(self, name, value): # <<<<<<<<<<<<<<
- * """override base class attribute creation"""
- * self.__dict__[name] = value
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_3__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_2__setattr__[] = "override base class attribute creation";
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_3__setattr__ = {"__setattr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_3__setattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_2__setattr__};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_3__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_v_value = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,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_self)) != 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("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 5629, __pyx_L3_error)
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 5629, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 5629, __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_self = values[0];
- __pyx_v_name = values[1];
- __pyx_v_value = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5629, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_2__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__setattr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5631
- * def __setattr__(self, name, value):
- * """override base class attribute creation"""
- * self.__dict__[name] = value # <<<<<<<<<<<<<<
- *
- * def __getattribute__(self, name):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5631, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 5631, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5629
- * self._path = '/'
- *
- * def __setattr__(self, name, value): # <<<<<<<<<<<<<<
- * """override base class attribute creation"""
- * self.__dict__[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_AddTraceback("netCDF4._netCDF4.MFDataset.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5633
- * self.__dict__[name] = value
- *
- * def __getattribute__(self, name): # <<<<<<<<<<<<<<
- * if name in ['variables','dimensions','file_format','groups',\
- * 'data_model','disk_format','path']:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_5__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_5__getattribute__ = {"__getattribute__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_5__getattribute__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_5__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__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_self)) != 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("__getattribute__", 1, 2, 2, 1); __PYX_ERR(0, 5633, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattribute__") < 0)) __PYX_ERR(0, 5633, __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_self = values[0];
- __pyx_v_name = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getattribute__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5633, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_4__getattribute__(__pyx_self, __pyx_v_self, __pyx_v_name);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_4__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
- 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;
- Py_ssize_t __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("__getattribute__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5634
- *
- * def __getattribute__(self, name):
- * if name in ['variables','dimensions','file_format','groups',\ # <<<<<<<<<<<<<<
- * 'data_model','disk_format','path']:
- * if name == 'dimensions': return self._dims
- */
- __Pyx_INCREF(__pyx_v_name);
- __pyx_t_1 = __pyx_v_name;
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_variables, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_dimensions, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_file_format, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_groups, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_data_model, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_disk_format_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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_path, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5634, __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":5636
- * if name in ['variables','dimensions','file_format','groups',\
- * 'data_model','disk_format','path']:
- * if name == 'dimensions': return self._dims # <<<<<<<<<<<<<<
- * if name == 'variables': return self._vars
- * if name == 'file_format': return self._file_format
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dimensions, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5636, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5636, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5637
- * 'data_model','disk_format','path']:
- * if name == 'dimensions': return self._dims
- * if name == 'variables': return self._vars # <<<<<<<<<<<<<<
- * if name == 'file_format': return self._file_format
- * if name == 'data_model': return self._data_model
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_variables, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5637, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5637, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5638
- * if name == 'dimensions': return self._dims
- * if name == 'variables': return self._vars
- * if name == 'file_format': return self._file_format # <<<<<<<<<<<<<<
- * if name == 'data_model': return self._data_model
- * if name == 'disk_format': return self._disk_format
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_file_format, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5638, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_format_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5638, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5639
- * if name == 'variables': return self._vars
- * if name == 'file_format': return self._file_format
- * if name == 'data_model': return self._data_model # <<<<<<<<<<<<<<
- * if name == 'disk_format': return self._disk_format
- * if name == 'path': return self._path
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_data_model, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5639, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data_model_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5639, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5640
- * if name == 'file_format': return self._file_format
- * if name == 'data_model': return self._data_model
- * if name == 'disk_format': return self._disk_format # <<<<<<<<<<<<<<
- * if name == 'path': return self._path
- * if name == 'groups': return self._grps
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_disk_format_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5640, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_disk_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5640, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5641
- * if name == 'data_model': return self._data_model
- * if name == 'disk_format': return self._disk_format
- * if name == 'path': return self._path # <<<<<<<<<<<<<<
- * if name == 'groups': return self._grps
- * else:
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_path, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5641, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5641, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5642
- * if name == 'disk_format': return self._disk_format
- * if name == 'path': return self._path
- * if name == 'groups': return self._grps # <<<<<<<<<<<<<<
- * else:
- * return Dataset.__getattribute__(self, name)
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_groups, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 5642, __pyx_L1_error)
- if (__pyx_t_3) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_grps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5642, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5634
- *
- * def __getattribute__(self, name):
- * if name in ['variables','dimensions','file_format','groups',\ # <<<<<<<<<<<<<<
- * 'data_model','disk_format','path']:
- * if name == 'dimensions': return self._dims
- */
- goto __pyx_L3;
- }
-
- /* "netCDF4/_netCDF4.pyx":5644
- * if name == 'groups': return self._grps
- * else:
- * return Dataset.__getattribute__(self, name) # <<<<<<<<<<<<<<
- *
- * def ncattrs(self):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset), __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5644, __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_ERR(0, 5644, __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_self);
- __Pyx_GIVEREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5644, __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_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- /* "netCDF4/_netCDF4.pyx":5633
- * self.__dict__[name] = value
- *
- * def __getattribute__(self, name): # <<<<<<<<<<<<<<
- * if name in ['variables','dimensions','file_format','groups',\
- * 'data_model','disk_format','path']:
- */
-
- /* 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_7);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5646
- * return Dataset.__getattribute__(self, name)
- *
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * """
- * **`ncattrs(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_7ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_6ncattrs[] = "\n **`ncattrs(self)`**\n\n return the netcdf attribute names from the master file.\n ";
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_7ncattrs = {"ncattrs", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_7ncattrs, METH_O, __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_6ncattrs};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_7ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_6ncattrs(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_6ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("ncattrs", 0);
-
- /* "netCDF4/_netCDF4.pyx":5652
- * return the netcdf attribute names from the master file.
- * """
- * return self._cdf[0].__dict__.keys() # <<<<<<<<<<<<<<
- *
- * def close(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5652, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5652, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5652, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5652, __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_ERR(0, 5652, __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_ERR(0, 5652, __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":5646
- * return Dataset.__getattribute__(self, name)
- *
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * """
- * **`ncattrs(self)`**
- */
-
- /* 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.MFDataset.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5654
- * return self._cdf[0].__dict__.keys()
- *
- * def close(self): # <<<<<<<<<<<<<<
- * """
- * **`close(self)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_9close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_8close[] = "\n **`close(self)`**\n\n close all the open files.\n ";
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_9close = {"close", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_9close, METH_O, __pyx_doc_7netCDF4_8_netCDF4_9MFDataset_8close};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_9close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("close (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_8close(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_8close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_v_dset = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- __Pyx_RefNannySetupContext("close", 0);
-
- /* "netCDF4/_netCDF4.pyx":5660
- * close all the open files.
- * """
- * for dset in self._cdf: # <<<<<<<<<<<<<<
- * dset.close()
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5660, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5660, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5660, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5660, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5660, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5660, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5660, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_4(__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_ERR(0, 5660, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_dset, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5661
- * """
- * for dset in self._cdf:
- * dset.close() # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5661, __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_ERR(0, 5661, __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_ERR(0, 5661, __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":5660
- * close all the open files.
- * """
- * for dset in self._cdf: # <<<<<<<<<<<<<<
- * dset.close()
- *
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5654
- * return self._cdf[0].__dict__.keys()
- *
- * 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_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_dset);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5663
- * dset.close()
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_11__repr__ = {"__repr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_11__repr__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_10__repr__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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_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 *);
- int __pyx_t_7;
- int __pyx_t_8;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5664
- *
- * def __repr__(self):
- * ncdump = ['%r\n' % type(self)] # <<<<<<<<<<<<<<
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- * varnames = tuple([str(varname) for varname in self.variables.keys()])
- */
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_r_3, ((PyObject *)Py_TYPE(__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5664, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5664, __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":5665
- * def __repr__(self):
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()]) # <<<<<<<<<<<<<<
- * varnames = tuple([str(varname) for varname in self.variables.keys()])
- * grpnames = ()
- */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5665, __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 && likely(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_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __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_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5665, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5665, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5665, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_6(__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_ERR(0, 5665, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_GIVEREF(__pyx_v_dimname);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dimname);
- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_dimnames = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5666
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- * varnames = tuple([str(varname) for varname in self.variables.keys()]) # <<<<<<<<<<<<<<
- * grpnames = ()
- * if self.path == '/':
- */
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5666, __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 && likely(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, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5666, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __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_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5666, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (likely(!__pyx_t_6)) {
- 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_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5666, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5666, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_6(__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_ERR(0, 5666, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_XDECREF_SET(__pyx_v_varname, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_varname);
- __Pyx_GIVEREF(__pyx_v_varname);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_varname);
- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_varnames = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5667
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- * varnames = tuple([str(varname) for varname in self.variables.keys()])
- * grpnames = () # <<<<<<<<<<<<<<
- * if self.path == '/':
- * ncdump.append('root group (%s data model, file format %s):\n' %
- */
- __Pyx_INCREF(__pyx_empty_tuple);
- __pyx_v_grpnames = __pyx_empty_tuple;
-
- /* "netCDF4/_netCDF4.pyx":5668
- * varnames = tuple([str(varname) for varname in self.variables.keys()])
- * grpnames = ()
- * if self.path == '/': # <<<<<<<<<<<<<<
- * ncdump.append('root group (%s data model, file format %s):\n' %
- * (self.data_model[0], self.disk_format[0]))
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5668, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__15, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 5668, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_7) {
-
- /* "netCDF4/_netCDF4.pyx":5670
- * if self.path == '/':
- * ncdump.append('root group (%s data model, file format %s):\n' %
- * (self.data_model[0], self.disk_format[0])) # <<<<<<<<<<<<<<
- * else:
- * ncdump.append('group %s:\n' % self.path)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5670, __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)) __PYX_ERR(0, 5670, __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_self, __pyx_n_s_disk_format_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5670, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5670, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5670, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
- __pyx_t_4 = 0;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5669
- * grpnames = ()
- * if self.path == '/':
- * ncdump.append('root group (%s data model, file format %s):\n' % # <<<<<<<<<<<<<<
- * (self.data_model[0], self.disk_format[0]))
- * else:
- */
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_root_group_s_data_model_file_for, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5669, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5669, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5668
- * varnames = tuple([str(varname) for varname in self.variables.keys()])
- * grpnames = ()
- * if self.path == '/': # <<<<<<<<<<<<<<
- * ncdump.append('root group (%s data model, file format %s):\n' %
- * (self.data_model[0], self.disk_format[0]))
- */
- goto __pyx_L7;
- }
-
- /* "netCDF4/_netCDF4.pyx":5672
- * (self.data_model[0], self.disk_format[0]))
- * else:
- * ncdump.append('group %s:\n' % self.path) # <<<<<<<<<<<<<<
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()]
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5672, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_group_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5672, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5672, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L7:;
-
- /* "netCDF4/_netCDF4.pyx":5673
- * else:
- * ncdump.append('group %s:\n' % self.path)
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\ # <<<<<<<<<<<<<<
- * self.ncattrs()]
- * ncdump = ncdump + attrs
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5673, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5674
- * ncdump.append('group %s:\n' % self.path)
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()] # <<<<<<<<<<<<<<
- * ncdump = ncdump + attrs
- * ncdump.append(' dimensions = %s\n' % str(dimnames))
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5674, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (__pyx_t_2) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5674, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5674, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_4 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5674, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5674, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5674, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5674, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5674, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5674, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_6(__pyx_t_4);
- 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_ERR(0, 5674, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5673
- * else:
- * ncdump.append('group %s:\n' % self.path)
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\ # <<<<<<<<<<<<<<
- * self.ncattrs()]
- * ncdump = ncdump + attrs
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5673, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5673, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5673, __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_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5673, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5673, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_attrs = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5675
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()]
- * ncdump = ncdump + attrs # <<<<<<<<<<<<<<
- * ncdump.append(' dimensions = %s\n' % str(dimnames))
- * ncdump.append(' variables = %s\n' % str(varnames))
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_ncdump, __pyx_v_attrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5675, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_ncdump, ((PyObject*)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5676
- * self.ncattrs()]
- * ncdump = ncdump + attrs
- * ncdump.append(' dimensions = %s\n' % str(dimnames)) # <<<<<<<<<<<<<<
- * ncdump.append(' variables = %s\n' % str(varnames))
- * ncdump.append(' groups = %s\n' % str(grpnames))
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5676, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_dimnames);
- __Pyx_GIVEREF(__pyx_v_dimnames);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dimnames);
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5676, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_dimensions_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5676, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5676, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5677
- * ncdump = ncdump + attrs
- * ncdump.append(' dimensions = %s\n' % str(dimnames))
- * ncdump.append(' variables = %s\n' % str(varnames)) # <<<<<<<<<<<<<<
- * ncdump.append(' groups = %s\n' % str(grpnames))
- * return ''.join(ncdump)
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5677, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_varnames);
- __Pyx_GIVEREF(__pyx_v_varnames);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_varnames);
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5677, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_variables_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5677, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5677, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5678
- * ncdump.append(' dimensions = %s\n' % str(dimnames))
- * ncdump.append(' variables = %s\n' % str(varnames))
- * ncdump.append(' groups = %s\n' % str(grpnames)) # <<<<<<<<<<<<<<
- * return ''.join(ncdump)
- *
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5678, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_grpnames);
- __Pyx_GIVEREF(__pyx_v_grpnames);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_grpnames);
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5678, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_groups_s_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5678, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5678, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5679
- * ncdump.append(' variables = %s\n' % str(varnames))
- * ncdump.append(' groups = %s\n' % str(grpnames))
- * return ''.join(ncdump) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_ncdump); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5663
- * dset.close()
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- */
-
- /* 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.MFDataset.__repr__", __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_name);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5681
- * return ''.join(ncdump)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_13__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_13__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_13__reduce__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9MFDataset_13__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_12__reduce__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_12__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5683
- * def __reduce__(self):
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable') # <<<<<<<<<<<<<<
- *
- * class _Dimension(object):
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5683, __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_ERR(0, 5683, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5681
- * return ''.join(ncdump)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFDataset.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5686
- *
- * class _Dimension(object):
- * def __init__(self, dimname, dim, dimlens, dimtotlen): # <<<<<<<<<<<<<<
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_dimname = 0;
- CYTHON_UNUSED PyObject *__pyx_v_dim = 0;
- PyObject *__pyx_v_dimlens = 0;
- PyObject *__pyx_v_dimtotlen = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dimname,&__pyx_n_s_dim,&__pyx_n_s_dimlens,&__pyx_n_s_dimtotlen,0};
- PyObject* values[5] = {0,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 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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimname)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 5686, __pyx_L3_error)
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 5686, __pyx_L3_error)
- }
- case 3:
- if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimlens)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 5686, __pyx_L3_error)
- }
- case 4:
- if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimtotlen)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 5686, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5686, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
- 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);
- values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- }
- __pyx_v_self = values[0];
- __pyx_v_dimname = values[1];
- __pyx_v_dim = values[2];
- __pyx_v_dimlens = values[3];
- __pyx_v_dimtotlen = values[4];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5686, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_10_Dimension___init__(__pyx_self, __pyx_v_self, __pyx_v_dimname, __pyx_v_dim, __pyx_v_dimlens, __pyx_v_dimtotlen);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5687
- * class _Dimension(object):
- * def __init__(self, dimname, dim, dimlens, dimtotlen):
- * self.dimlens = dimlens # <<<<<<<<<<<<<<
- * self.dimtotlen = dimtotlen
- * self._name = dimname
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dimlens, __pyx_v_dimlens) < 0) __PYX_ERR(0, 5687, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5688
- * def __init__(self, dimname, dim, dimlens, dimtotlen):
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen # <<<<<<<<<<<<<<
- * self._name = dimname
- * def __len__(self):
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dimtotlen, __pyx_v_dimtotlen) < 0) __PYX_ERR(0, 5688, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5689
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen
- * self._name = dimname # <<<<<<<<<<<<<<
- * def __len__(self):
- * return self.dimtotlen
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_v_dimname) < 0) __PYX_ERR(0, 5689, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5686
- *
- * class _Dimension(object):
- * def __init__(self, dimname, dim, dimlens, dimtotlen): # <<<<<<<<<<<<<<
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5690
- * self.dimtotlen = dimtotlen
- * self._name = dimname
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self.dimtotlen
- * def isunlimited(self):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_3__len__ = {"__len__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_3__len__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_10_Dimension_2__len__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5691
- * self._name = dimname
- * def __len__(self):
- * return self.dimtotlen # <<<<<<<<<<<<<<
- * def isunlimited(self):
- * return True
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dimtotlen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5691, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5690
- * self.dimtotlen = dimtotlen
- * self._name = dimname
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self.dimtotlen
- * def isunlimited(self):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4._Dimension.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5692
- * def __len__(self):
- * return self.dimtotlen
- * def isunlimited(self): # <<<<<<<<<<<<<<
- * return True
- * def __repr__(self):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_5isunlimited(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_5isunlimited = {"isunlimited", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_5isunlimited, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_5isunlimited(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("isunlimited (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_10_Dimension_4isunlimited(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_4isunlimited(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("isunlimited", 0);
-
- /* "netCDF4/_netCDF4.pyx":5693
- * return self.dimtotlen
- * def isunlimited(self):
- * return True # <<<<<<<<<<<<<<
- * def __repr__(self):
- * if self.isunlimited():
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_True);
- __pyx_r = Py_True;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5692
- * def __len__(self):
- * return self.dimtotlen
- * def isunlimited(self): # <<<<<<<<<<<<<<
- * return True
- * def __repr__(self):
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5694
- * def isunlimited(self):
- * return True
- * def __repr__(self): # <<<<<<<<<<<<<<
- * if self.isunlimited():
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_7__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_7__repr__ = {"__repr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_7__repr__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_10_Dimension_7__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_10_Dimension_6__repr__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_6__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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_t_4;
- Py_ssize_t __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5695
- * return True
- * def __repr__(self):
- * if self.isunlimited(): # <<<<<<<<<<<<<<
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- * else:
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5695, __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_ERR(0, 5695, __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_ERR(0, 5695, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 5695, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_4) {
-
- /* "netCDF4/_netCDF4.pyx":5696
- * def __repr__(self):
- * 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_1 = PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unlimited_name_s_size_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5695
- * return True
- * def __repr__(self):
- * if self.isunlimited(): # <<<<<<<<<<<<<<
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5698
- * 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)) # <<<<<<<<<<<<<<
- *
- * class _Variable(object):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_self))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
- __pyx_t_3 = 0;
- __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_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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":5694
- * def isunlimited(self):
- * return True
- * def __repr__(self): # <<<<<<<<<<<<<<
- * if self.isunlimited():
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- */
-
- /* 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_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":5701
- *
- * class _Variable(object):
- * def __init__(self, dset, varname, var, recdimname): # <<<<<<<<<<<<<<
- * self.dimensions = var.dimensions
- * self._dset = dset
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_dset = 0;
- PyObject *__pyx_v_varname = 0;
- PyObject *__pyx_v_var = 0;
- PyObject *__pyx_v_recdimname = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dset,&__pyx_n_s_varname,&__pyx_n_s_var,&__pyx_n_s_recdimname,0};
- PyObject* values[5] = {0,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 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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dset)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 5701, __pyx_L3_error)
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_varname)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 5701, __pyx_L3_error)
- }
- case 3:
- if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 5701, __pyx_L3_error)
- }
- case 4:
- if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_recdimname)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 5701, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5701, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
- 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);
- values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- }
- __pyx_v_self = values[0];
- __pyx_v_dset = values[1];
- __pyx_v_varname = values[2];
- __pyx_v_var = values[3];
- __pyx_v_recdimname = values[4];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5701, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable___init__(__pyx_self, __pyx_v_self, __pyx_v_dset, __pyx_v_varname, __pyx_v_var, __pyx_v_recdimname);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_v_name = NULL;
- PyObject *__pyx_v_value = 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 *);
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5702
- * class _Variable(object):
- * def __init__(self, dset, varname, var, recdimname):
- * self.dimensions = var.dimensions # <<<<<<<<<<<<<<
- * self._dset = dset
- * self._grp = dset
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5702, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dimensions, __pyx_t_1) < 0) __PYX_ERR(0, 5702, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5703
- * def __init__(self, dset, varname, var, recdimname):
- * self.dimensions = var.dimensions
- * self._dset = dset # <<<<<<<<<<<<<<
- * self._grp = dset
- * self._mastervar = var
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dset_2, __pyx_v_dset) < 0) __PYX_ERR(0, 5703, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5704
- * self.dimensions = var.dimensions
- * self._dset = dset
- * self._grp = dset # <<<<<<<<<<<<<<
- * self._mastervar = var
- * self._recVar = dset._cdfRecVar[varname]
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_grp_2, __pyx_v_dset) < 0) __PYX_ERR(0, 5704, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5705
- * self._dset = dset
- * self._grp = dset
- * self._mastervar = var # <<<<<<<<<<<<<<
- * self._recVar = dset._cdfRecVar[varname]
- * self._recdimname = recdimname
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mastervar, __pyx_v_var) < 0) __PYX_ERR(0, 5705, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5706
- * self._grp = dset
- * self._mastervar = var
- * self._recVar = dset._cdfRecVar[varname] # <<<<<<<<<<<<<<
- * self._recdimname = recdimname
- * self._recLen = dset._cdfVLen
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_cdfRecVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_varname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_recVar, __pyx_t_2) < 0) __PYX_ERR(0, 5706, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5707
- * self._mastervar = var
- * self._recVar = dset._cdfRecVar[varname]
- * self._recdimname = recdimname # <<<<<<<<<<<<<<
- * self._recLen = dset._cdfVLen
- * self.dtype = var.dtype
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_recdimname_2, __pyx_v_recdimname) < 0) __PYX_ERR(0, 5707, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5708
- * self._recVar = dset._cdfRecVar[varname]
- * self._recdimname = recdimname
- * self._recLen = dset._cdfVLen # <<<<<<<<<<<<<<
- * self.dtype = var.dtype
- * self._name = var._name
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dset, __pyx_n_s_cdfVLen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5708, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_recLen, __pyx_t_2) < 0) __PYX_ERR(0, 5708, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5709
- * self._recdimname = recdimname
- * self._recLen = dset._cdfVLen
- * self.dtype = var.dtype # <<<<<<<<<<<<<<
- * self._name = var._name
- * # copy attributes from master.
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5709, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 5709, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5710
- * self._recLen = dset._cdfVLen
- * self.dtype = var.dtype
- * self._name = var._name # <<<<<<<<<<<<<<
- * # copy attributes from master.
- * for name, value in var.__dict__.items():
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5710, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 5710, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5712
- * self._name = var._name
- * # copy attributes from master.
- * for name, value in var.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- * def typecode(self):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5712, __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_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5712, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5712, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5712, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_5(__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_ERR(0, 5712, __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_ERR(0, 5712, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_6);
- #else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- 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_ERR(0, 5712, __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_ERR(0, 5712, __pyx_L1_error)
- __pyx_L6_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
- __pyx_t_1 = 0;
- __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5713
- * # copy attributes from master.
- * for name, value in var.__dict__.items():
- * self.__dict__[name] = value # <<<<<<<<<<<<<<
- * def typecode(self):
- * return self.dtype
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5713, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 5713, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5712
- * self._name = var._name
- * # copy attributes from master.
- * for name, value in var.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- * def typecode(self):
- */
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5701
- *
- * class _Variable(object):
- * def __init__(self, dset, varname, var, recdimname): # <<<<<<<<<<<<<<
- * self.dimensions = var.dimensions
- * self._dset = dset
- */
-
- /* 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_AddTraceback("netCDF4._netCDF4._Variable.__init__", __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":5714
- * for name, value in var.__dict__.items():
- * self.__dict__[name] = value
- * def typecode(self): # <<<<<<<<<<<<<<
- * return self.dtype
- * def ncattrs(self):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_3typecode(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_3typecode = {"typecode", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_3typecode, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_3typecode(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("typecode (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_2typecode(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_2typecode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("typecode", 0);
-
- /* "netCDF4/_netCDF4.pyx":5715
- * self.__dict__[name] = value
- * def typecode(self):
- * return self.dtype # <<<<<<<<<<<<<<
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5715, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5714
- * for name, value in var.__dict__.items():
- * self.__dict__[name] = value
- * def typecode(self): # <<<<<<<<<<<<<<
- * return self.dtype
- * def ncattrs(self):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.typecode", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5716
- * def typecode(self):
- * return self.dtype
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_5ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_5ncattrs = {"ncattrs", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_5ncattrs, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_5ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_4ncattrs(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_4ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("ncattrs", 0);
-
- /* "netCDF4/_netCDF4.pyx":5717
- * return self.dtype
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys() # <<<<<<<<<<<<<<
- * def __getattr__(self,name):
- * if name == 'shape': return self._shape()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mastervar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5717, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5717, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5717, __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_ERR(0, 5717, __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_ERR(0, 5717, __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":5716
- * def typecode(self):
- * return self.dtype
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name):
- */
-
- /* 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.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5718
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name): # <<<<<<<<<<<<<<
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_7__getattr__ = {"__getattr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_7__getattr__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_name = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__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_self)) != 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("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 5718, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 5718, __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_self = values[0];
- __pyx_v_name = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5718, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_6__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
- 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 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- __Pyx_RefNannySetupContext("__getattr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5719
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name):
- * if name == 'shape': return self._shape() # <<<<<<<<<<<<<<
- * if name == 'ndim': return len(self._shape())
- * try:
- */
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_shape, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5719, __pyx_L1_error)
- if (__pyx_t_1) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5719, __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_ERR(0, 5719, __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_ERR(0, 5719, __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":5720
- * def __getattr__(self,name):
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape()) # <<<<<<<<<<<<<<
- * try:
- * return self.__dict__[name]
- */
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_ndim, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 5720, __pyx_L1_error)
- if (__pyx_t_1) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5720, __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_ERR(0, 5720, __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_ERR(0, 5720, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 5720, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5720, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5721
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- * try: # <<<<<<<<<<<<<<
- * return self.__dict__[name]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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":5722
- * if name == 'ndim': return len(self._shape())
- * try:
- * return self.__dict__[name] # <<<<<<<<<<<<<<
- * except:
- * raise AttributeError(name)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5722, __pyx_L5_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5722, __pyx_L5_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_L9_try_return;
-
- /* "netCDF4/_netCDF4.pyx":5721
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- * try: # <<<<<<<<<<<<<<
- * return self.__dict__[name]
- * except:
- */
- }
- __pyx_L5_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5723
- * try:
- * return self.__dict__[name]
- * except: # <<<<<<<<<<<<<<
- * raise AttributeError(name)
- * def __repr__(self):
- */
- /*except:*/ {
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 5723, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "netCDF4/_netCDF4.pyx":5724
- * return self.__dict__[name]
- * except:
- * raise AttributeError(name) # <<<<<<<<<<<<<<
- * def __repr__(self):
- * ncdump_var = ['%r\n' % type(self)]
- */
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5724, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_name);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5724, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __PYX_ERR(0, 5724, __pyx_L7_except_error)
- }
- __pyx_L7_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5721
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- * try: # <<<<<<<<<<<<<<
- * return self.__dict__[name]
- * except:
- */
- __Pyx_PyThreadState_assign
- __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_L9_try_return:;
- __Pyx_PyThreadState_assign
- __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_L0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5718
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name): # <<<<<<<<<<<<<<
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5725
- * except:
- * raise AttributeError(name)
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_9__repr__ = {"__repr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_9__repr__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- 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_name = 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;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5726
- * raise AttributeError(name)
- * def __repr__(self):
- * ncdump_var = ['%r\n' % type(self)] # <<<<<<<<<<<<<<
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- */
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_r_3, ((PyObject *)Py_TYPE(__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5726, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5726, __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_var = ((PyObject*)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5727
- * def __repr__(self):
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions]) # <<<<<<<<<<<<<<
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()]
- */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_ERR(0, 5727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5727, __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_ERR(0, 5727, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5727, __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_ERR(0, 5727, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5727, __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_ERR(0, 5727, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_GIVEREF(__pyx_v_dimname);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dimname);
- __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 5727, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5727, __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":5728
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\ # <<<<<<<<<<<<<<
- * self.ncattrs()]
- * ncdump_var.append('%s %s%s\n' %\
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netCDF4/_netCDF4.pyx":5729
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()] # <<<<<<<<<<<<<<
- * ncdump_var.append('%s %s%s\n' %\
- * (self.dtype,self._name,dimnames))
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5729, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5729, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5729, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
- __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5729, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5729, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5729, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5729, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5729, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5729, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_5(__pyx_t_6);
- 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_ERR(0, 5729, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5728
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\ # <<<<<<<<<<<<<<
- * self.ncattrs()]
- * ncdump_var.append('%s %s%s\n' %\
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_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_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5728, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_attrs = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5731
- * self.ncattrs()]
- * ncdump_var.append('%s %s%s\n' %\
- * (self.dtype,self._name,dimnames)) # <<<<<<<<<<<<<<
- * ncdump_var = ncdump_var + attrs
- * unlimdims = []
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5731, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5731, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5731, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
- __Pyx_INCREF(__pyx_v_dimnames);
- __Pyx_GIVEREF(__pyx_v_dimnames);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_dimnames);
- __pyx_t_3 = 0;
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5730
- * attrs = [' %s: %s\n' % (name,self.__dict__[name]) for name in\
- * self.ncattrs()]
- * ncdump_var.append('%s %s%s\n' %\ # <<<<<<<<<<<<<<
- * (self.dtype,self._name,dimnames))
- * ncdump_var = ncdump_var + attrs
- */
- __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5730, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5730, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5732
- * ncdump_var.append('%s %s%s\n' %\
- * (self.dtype,self._name,dimnames))
- * ncdump_var = ncdump_var + attrs # <<<<<<<<<<<<<<
- * unlimdims = []
- * for dimname in self.dimensions:
- */
- __pyx_t_6 = PyNumber_Add(__pyx_v_ncdump_var, __pyx_v_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_ncdump_var, ((PyObject*)__pyx_t_6));
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5733
- * (self.dtype,self._name,dimnames))
- * ncdump_var = ncdump_var + attrs
- * unlimdims = [] # <<<<<<<<<<<<<<
- * for dimname in self.dimensions:
- * dim = _find_dim(self._grp, dimname)
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5733, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_unlimdims = ((PyObject*)__pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5734
- * ncdump_var = ncdump_var + attrs
- * unlimdims = []
- * for dimname in self.dimensions: # <<<<<<<<<<<<<<
- * dim = _find_dim(self._grp, dimname)
- * if dim.isunlimited():
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_1 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5734, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5734, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5734, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_5(__pyx_t_1);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 5734, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5735
- * unlimdims = []
- * for dimname in self.dimensions:
- * dim = _find_dim(self._grp, dimname) # <<<<<<<<<<<<<<
- * if dim.isunlimited():
- * unlimdims.append(str(dimname))
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_find_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5735, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_grp_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5735, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = NULL;
- __pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_9 = 1;
- }
- }
- __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5735, __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_2);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_2);
- __Pyx_INCREF(__pyx_v_dimname);
- __Pyx_GIVEREF(__pyx_v_dimname);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_dimname);
- __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5735, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5736
- * for dimname in self.dimensions:
- * dim = _find_dim(self._grp, dimname)
- * if dim.isunlimited(): # <<<<<<<<<<<<<<
- * unlimdims.append(str(dimname))
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims)))
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5736, __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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5736, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5736, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5736, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_11) {
-
- /* "netCDF4/_netCDF4.pyx":5737
- * dim = _find_dim(self._grp, dimname)
- * if dim.isunlimited():
- * unlimdims.append(str(dimname)) # <<<<<<<<<<<<<<
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims)))
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5737, __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_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5737, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unlimdims, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5737, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5736
- * for dimname in self.dimensions:
- * dim = _find_dim(self._grp, dimname)
- * if dim.isunlimited(): # <<<<<<<<<<<<<<
- * unlimdims.append(str(dimname))
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims)))
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5734
- * ncdump_var = ncdump_var + attrs
- * unlimdims = []
- * for dimname in self.dimensions: # <<<<<<<<<<<<<<
- * dim = _find_dim(self._grp, dimname)
- * if dim.isunlimited():
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5738
- * if dim.isunlimited():
- * unlimdims.append(str(dimname))
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims))) # <<<<<<<<<<<<<<
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var)
- */
- __pyx_t_1 = PyList_AsTuple(__pyx_v_unlimdims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5738, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5738, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_unlimited_dimensions_s_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5738, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5738, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5739
- * unlimdims.append(str(dimname))
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims)))
- * ncdump_var.append('current size = %s\n' % repr(self.shape)) # <<<<<<<<<<<<<<
- * return ''.join(ncdump_var)
- * def __len__(self):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5739, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5739, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_current_size_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5739, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 5739, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5740
- * ncdump_var.append('unlimited dimensions = %s\n' % repr(tuple(unlimdims)))
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var) # <<<<<<<<<<<<<<
- * def __len__(self):
- * if not self._shape:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_ncdump_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5740, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5725
- * except:
- * raise AttributeError(name)
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- */
-
- /* 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_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__repr__", __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_name);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5741
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var)
- * def __len__(self): # <<<<<<<<<<<<<<
- * if not self._shape:
- * raise TypeError('len() of unsized object')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_11__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_11__len__ = {"__len__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_11__len__, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_11__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_10__len__(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_10__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- 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;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5742
- * return ''.join(ncdump_var)
- * def __len__(self):
- * if not self._shape: # <<<<<<<<<<<<<<
- * raise TypeError('len() of unsized object')
- * else:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5742, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 5742, __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":5743
- * 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__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5743, __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_ERR(0, 5743, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5742
- * return ''.join(ncdump_var)
- * def __len__(self):
- * if not self._shape: # <<<<<<<<<<<<<<
- * raise TypeError('len() of unsized object')
- * else:
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5745
- * raise TypeError('len() of unsized object')
- * else:
- * return self._shape()[0] # <<<<<<<<<<<<<<
- * def _shape(self):
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5745, __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_ERR(0, 5745, __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_ERR(0, 5745, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5745, __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":5741
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var)
- * 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_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5746
- * else:
- * return self._shape()[0]
- * def _shape(self): # <<<<<<<<<<<<<<
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_13_shape(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_13_shape = {"_shape", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_13_shape, METH_O, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_13_shape(PyObject *__pyx_self, PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_shape (wrapper)", 0);
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_12_shape(__pyx_self, ((PyObject *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_12_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- Py_ssize_t __pyx_v_recdimlen;
- 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;
- __Pyx_RefNannySetupContext("_shape", 0);
-
- /* "netCDF4/_netCDF4.pyx":5747
- * return self._shape()[0]
- * def _shape(self):
- * recdimlen = len(self._dset.dimensions[self._recdimname]) # <<<<<<<<<<<<<<
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dset_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recdimname_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5747, __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_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 5747, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_recdimlen = __pyx_t_4;
-
- /* "netCDF4/_netCDF4.pyx":5748
- * def _shape(self):
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:] # <<<<<<<<<<<<<<
- * def set_auto_maskandscale(self,val):
- * for v in self._recVar:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_recdimlen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5748, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5748, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mastervar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5748, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5748, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__121, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5748, __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_ERR(0, 5748, __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":5746
- * else:
- * return self._shape()[0]
- * def _shape(self): # <<<<<<<<<<<<<<
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- */
-
- /* 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._shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5749
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_15set_auto_maskandscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_15set_auto_maskandscale = {"set_auto_maskandscale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_15set_auto_maskandscale, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_15set_auto_maskandscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_val = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("set_auto_maskandscale (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_val,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("set_auto_maskandscale", 1, 2, 2, 1); __PYX_ERR(0, 5749, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_auto_maskandscale") < 0)) __PYX_ERR(0, 5749, __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_self = values[0];
- __pyx_v_val = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_auto_maskandscale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5749, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_maskandscale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_14set_auto_maskandscale(__pyx_self, __pyx_v_self, __pyx_v_val);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("set_auto_maskandscale", 0);
-
- /* "netCDF4/_netCDF4.pyx":5750
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5750, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5750, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5750, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5750, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5750, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5750, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5750, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_4(__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_ERR(0, 5750, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5751
- * def set_auto_maskandscale(self,val):
- * for v in self._recVar:
- * v.set_auto_maskandscale(val) # <<<<<<<<<<<<<<
- * def set_auto_mask(self,val):
- * for v in self._recVar:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_set_auto_maskandscale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5751, __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_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5751, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5751, __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_val);
- __Pyx_GIVEREF(__pyx_v_val);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_val);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5751, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5750
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val):
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5749
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- */
-
- /* 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_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_maskandscale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5752
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_mask(val)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_17set_auto_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_17set_auto_mask = {"set_auto_mask", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_17set_auto_mask, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_17set_auto_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_val = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("set_auto_mask (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_val,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("set_auto_mask", 1, 2, 2, 1); __PYX_ERR(0, 5752, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_auto_mask") < 0)) __PYX_ERR(0, 5752, __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_self = values[0];
- __pyx_v_val = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_auto_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5752, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_16set_auto_mask(__pyx_self, __pyx_v_self, __pyx_v_val);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_16set_auto_mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("set_auto_mask", 0);
-
- /* "netCDF4/_netCDF4.pyx":5753
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5753, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5753, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5753, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5753, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5753, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5753, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5753, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_4(__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_ERR(0, 5753, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5754
- * def set_auto_mask(self,val):
- * for v in self._recVar:
- * v.set_auto_mask(val) # <<<<<<<<<<<<<<
- * def set_auto_scale(self,val):
- * for v in self._recVar:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_set_auto_mask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5754, __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_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5754, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5754, __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_val);
- __Pyx_GIVEREF(__pyx_v_val);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_val);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5754, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5753
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val):
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5752
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_mask(val)
- */
-
- /* 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_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5755
- * for v in self._recVar:
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_scale(val)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_19set_auto_scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_19set_auto_scale = {"set_auto_scale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_19set_auto_scale, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_19set_auto_scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_val = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("set_auto_scale (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_val,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("set_auto_scale", 1, 2, 2, 1); __PYX_ERR(0, 5755, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_auto_scale") < 0)) __PYX_ERR(0, 5755, __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_self = values[0];
- __pyx_v_val = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("set_auto_scale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5755, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_18set_auto_scale(__pyx_self, __pyx_v_self, __pyx_v_val);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_18set_auto_scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("set_auto_scale", 0);
-
- /* "netCDF4/_netCDF4.pyx":5756
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_scale(val)
- * def __getitem__(self, elem):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5756, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5756, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5756, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5756, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5756, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 5756, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5756, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_4(__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_ERR(0, 5756, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5757
- * def set_auto_scale(self,val):
- * for v in self._recVar:
- * v.set_auto_scale(val) # <<<<<<<<<<<<<<
- * def __getitem__(self, elem):
- * """Get records from a concatenated set of variables."""
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_set_auto_scale); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5757, __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_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5757, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5757, __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_val);
- __Pyx_GIVEREF(__pyx_v_val);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_val);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5757, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5756
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val):
- * for v in self._recVar: # <<<<<<<<<<<<<<
- * v.set_auto_scale(val)
- * def __getitem__(self, elem):
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5755
- * for v in self._recVar:
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_scale(val)
- */
-
- /* 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_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.set_auto_scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5758
- * for v in self._recVar:
- * v.set_auto_scale(val)
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * """Get records from a concatenated set of variables."""
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_21__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_9_Variable_20__getitem__[] = "Get records from a concatenated set of variables.";
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9_Variable_21__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9_Variable_21__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_9_Variable_20__getitem__};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9_Variable_21__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_elem = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 5758, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 5758, __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_self = values[0];
- __pyx_v_elem = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5758, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9_Variable_20__getitem__(__pyx_self, __pyx_v_self, __pyx_v_elem);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_20__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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_strt = NULL;
- PyObject *__pyx_v_cnt = NULL;
- PyObject *__pyx_v_strd = NULL;
- Py_ssize_t __pyx_v_nv;
- PyObject *__pyx_v_ind = NULL;
- PyObject *__pyx_v_sta = NULL;
- PyObject *__pyx_v_step = NULL;
- PyObject *__pyx_v_stop = NULL;
- PyObject *__pyx_v_idx = NULL;
- PyObject *__pyx_v_vid = NULL;
- PyObject *__pyx_v_k = NULL;
- PyObject *__pyx_v_lst = NULL;
- PyObject *__pyx_v_newSlice = NULL;
- PyObject *__pyx_v_s = NULL;
- PyObject *__pyx_v_lstArr = NULL;
- int __pyx_v_ismasked;
- PyObject *__pyx_v_dat = NULL;
- CYTHON_UNUSED PyObject *__pyx_v_fill_value = NULL;
- PyObject *__pyx_v_numv = 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 *);
- PyObject *(*__pyx_t_9)(PyObject *);
- int __pyx_t_10;
- int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- PyObject *(*__pyx_t_14)(PyObject *);
- int __pyx_t_15;
- Py_ssize_t __pyx_t_16;
- PyObject *(*__pyx_t_17)(PyObject *);
- PyObject *__pyx_t_18 = NULL;
- PyObject *__pyx_t_19 = NULL;
- PyObject *__pyx_t_20 = NULL;
- PyObject *__pyx_t_21 = NULL;
- int __pyx_t_22;
- int __pyx_t_23;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5767
- * # to use.
- * start, count, stride, put_ind =\
- * _StartCountStride(elem, self.shape) # <<<<<<<<<<<<<<
- * datashape = _out_array_shape(count)
- * data = ma.empty(datashape, dtype=self.dtype)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_StartCountStride); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5767, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5767, __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_ERR(0, 5767, __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_ERR(0, 5767, __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_ERR(0, 5766, __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_ERR(0, 5766, __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_ERR(0, 5766, __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_ERR(0, 5766, __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_ERR(0, 5766, __pyx_L1_error)
- __pyx_L4_unpacking_done:;
- }
-
- /* "netCDF4/_netCDF4.pyx":5766
- * # 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)
- */
- __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":5768
- * start, count, stride, put_ind =\
- * _StartCountStride(elem, self.shape)
- * datashape = _out_array_shape(count) # <<<<<<<<<<<<<<
- * data = ma.empty(datashape, dtype=self.dtype)
- *
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_out_array_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5768, __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_ERR(0, 5768, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5768, __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_ERR(0, 5768, __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":5769
- * _StartCountStride(elem, self.shape)
- * datashape = _out_array_shape(count)
- * data = ma.empty(datashape, dtype=self.dtype) # <<<<<<<<<<<<<<
- *
- * # Determine which dimensions need to be squeezed
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5769, __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_ERR(0, 5769, __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_ERR(0, 5769, __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_ERR(0, 5769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 5769, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5769, __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":5775
- * # 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_slice__122);
- __Pyx_GIVEREF(__pyx_slice__122);
- PyList_SET_ITEM(__pyx_t_6, 0, __pyx_slice__122);
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_squeeze = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5776
- * # 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_1 = __pyx_int_0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, -1L, NULL, NULL, &__pyx_slice__123, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0;
- __pyx_t_9 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5776, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5776, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5776, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_9(__pyx_t_6);
- 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_ERR(0, 5776, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5777
- * 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_3 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_10 = __pyx_t_11;
- goto __pyx_L8_bool_binop_done;
- }
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(Py_Ellipsis);
- __Pyx_GIVEREF(Py_Ellipsis);
- PyTuple_SET_ITEM(__pyx_t_4, 0, Py_Ellipsis);
- __Pyx_INCREF(__pyx_v_i);
- __Pyx_GIVEREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_i);
- __pyx_t_2 = PyObject_GetItem(__pyx_v_put_ind, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (__pyx_t_2) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5777, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __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_ERR(0, 5777, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_10 = __pyx_t_11;
- __pyx_L8_bool_binop_done:;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5778
- * 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_ERR(0, 5778, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5777
- * 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":5776
- * # 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_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5781
- *
- * # Reshape the arrays so we can iterate over them.
- * strt = start.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<<
- * cnt = count.reshape((-1, self.ndim or 1))
- * strd = stride.reshape((-1, self.ndim or 1))
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_start, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5781, __pyx_L1_error)
- if (!__pyx_t_10) {
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_3 = __pyx_t_4;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_L10_bool_binop_done:;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5781, __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_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5781, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_strt = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5782
- * # Reshape the arrays so we can iterate over them.
- * strt = start.reshape((-1, self.ndim or 1))
- * cnt = count.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<<
- * strd = stride.reshape((-1, self.ndim or 1))
- * put_ind = put_ind.reshape((-1, self.ndim or 1))
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_count, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5782, __pyx_L1_error)
- if (!__pyx_t_10) {
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_2 = __pyx_t_4;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L12_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_L12_bool_binop_done:;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5782, __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_ERR(0, 5782, __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_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_cnt = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5783
- * strt = start.reshape((-1, self.ndim or 1))
- * cnt = count.reshape((-1, self.ndim or 1))
- * strd = stride.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<<
- * put_ind = put_ind.reshape((-1, self.ndim or 1))
- *
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stride, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5783, __pyx_L1_error)
- if (!__pyx_t_10) {
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_3 = __pyx_t_4;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L14_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_L14_bool_binop_done:;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5783, __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_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_strd = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5784
- * cnt = count.reshape((-1, self.ndim or 1))
- * strd = 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5784, __pyx_L1_error)
- if (!__pyx_t_10) {
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_2 = __pyx_t_4;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L16_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_L16_bool_binop_done:;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5784, __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_ERR(0, 5784, __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_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_put_ind, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5788
- * # Fill output array with data chunks.
- * # Number of variables making up the MFVariable.Variable.
- * nv = len(self._recLen) # <<<<<<<<<<<<<<
- * for (start,count,stride,ind) in zip(strt, cnt, strd, put_ind):
- * # make sure count=-1 becomes count=1
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recLen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5788, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 5788, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_nv = __pyx_t_5;
-
- /* "netCDF4/_netCDF4.pyx":5789
- * # Number of variables making up the MFVariable.Variable.
- * nv = len(self._recLen)
- * for (start,count,stride,ind) in zip(strt, cnt, strd, put_ind): # <<<<<<<<<<<<<<
- * # make sure count=-1 becomes count=1
- * count = [abs(cnt) for cnt in count]
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5789, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
- __pyx_t_5 = 1;
- }
- }
- __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5789, __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_INCREF(__pyx_v_strt);
- __Pyx_GIVEREF(__pyx_v_strt);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_strt);
- __Pyx_INCREF(__pyx_v_cnt);
- __Pyx_GIVEREF(__pyx_v_cnt);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_cnt);
- __Pyx_INCREF(__pyx_v_strd);
- __Pyx_GIVEREF(__pyx_v_strd);
- PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_strd);
- __Pyx_INCREF(__pyx_v_put_ind);
- __Pyx_GIVEREF(__pyx_v_put_ind);
- PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_put_ind);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5789, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __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_5 = 0;
- __pyx_t_9 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5789, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 5789, __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_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5789, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5789, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 5789, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5789, __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_ERR(0, 5789, __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 != 4)) {
- if (size > 4) __Pyx_RaiseTooManyValuesError(4);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 5789, __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_2 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = 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_4);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_7);
- #else
- {
- Py_ssize_t i;
- PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_3,&__pyx_t_2,&__pyx_t_7};
- for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 5789, __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_4,&__pyx_t_3,&__pyx_t_2,&__pyx_t_7};
- __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5789, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_L20_unpacking_failed;
- __Pyx_GOTREF(item);
- *(temps[index]) = item;
- }
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_12), 4) < 0) __PYX_ERR(0, 5789, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- goto __pyx_L21_unpacking_done;
- __pyx_L20_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5789, __pyx_L1_error)
- __pyx_L21_unpacking_done:;
- }
- __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_4);
- __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_stride, __pyx_t_2);
- __pyx_t_2 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5791
- * for (start,count,stride,ind) in zip(strt, cnt, strd, put_ind):
- * # make sure count=-1 becomes count=1
- * count = [abs(cnt) for cnt in count] # <<<<<<<<<<<<<<
- * if (numpy.array(stride) < 0).any():
- * raise IndexError('negative strides not allowed when slicing MFVariable Variable instance')
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(PyList_CheckExact(__pyx_v_count)) || PyTuple_CheckExact(__pyx_v_count)) {
- __pyx_t_7 = __pyx_v_count; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5791, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_14)) {
- 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_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5791, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5791, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_14(__pyx_t_7);
- 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_ERR(0, 5791, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_DECREF_SET(__pyx_v_cnt, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Absolute(__pyx_v_cnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5791, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5792
- * # make sure count=-1 becomes count=1
- * count = [abs(cnt) for cnt in count]
- * if (numpy.array(stride) < 0).any(): # <<<<<<<<<<<<<<
- * raise IndexError('negative strides not allowed when slicing MFVariable Variable instance')
- * # Start, stop and step along 1st dimension, eg the unlimited
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5792, __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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5792, __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_stride);
- __Pyx_GIVEREF(__pyx_v_stride);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_stride);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5792, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5792, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5793
- * count = [abs(cnt) for cnt in count]
- * if (numpy.array(stride) < 0).any():
- * raise IndexError('negative strides not allowed when slicing MFVariable Variable instance') # <<<<<<<<<<<<<<
- * # Start, stop and step along 1st dimension, eg the unlimited
- * # dimension.
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5793, __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_ERR(0, 5793, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5792
- * # make sure count=-1 becomes count=1
- * count = [abs(cnt) for cnt in count]
- * if (numpy.array(stride) < 0).any(): # <<<<<<<<<<<<<<
- * raise IndexError('negative strides not allowed when slicing MFVariable Variable instance')
- * # Start, stop and step along 1st dimension, eg the unlimited
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5796
- * # Start, stop and step along 1st dimension, eg the unlimited
- * # dimension.
- * sta = start[0] # <<<<<<<<<<<<<<
- * step = stride[0]
- * stop = sta + count[0] * step
- */
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_start, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5796, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_sta, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5797
- * # dimension.
- * sta = start[0]
- * step = stride[0] # <<<<<<<<<<<<<<
- * stop = sta + count[0] * step
- *
- */
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_stride, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5797, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_step, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5798
- * sta = start[0]
- * step = stride[0]
- * stop = sta + count[0] * step # <<<<<<<<<<<<<<
- *
- * # Build a list representing the concatenated list of all records in
- */
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_count, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5798, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_v_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5798, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_v_sta, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5798, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5805
- * # the record index inside the variables, from 0 to n
- * # the index of the Variable instance to which each record belongs
- * idx = [] # list of record indices # <<<<<<<<<<<<<<
- * vid = [] # list of Variable indices
- * for n in range(nv):
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5805, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_idx, ((PyObject*)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5806
- * # the index of the Variable instance to which each record belongs
- * idx = [] # list of record indices
- * vid = [] # list of Variable indices # <<<<<<<<<<<<<<
- * for n in range(nv):
- * k = self._recLen[n] # number of records in this variable
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5806, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_vid, ((PyObject*)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5807
- * idx = [] # list of record indices
- * vid = [] # list of Variable indices
- * for n in range(nv): # <<<<<<<<<<<<<<
- * k = self._recLen[n] # number of records in this variable
- * idx.extend(range(k))
- */
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5807, __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_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5807, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- 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_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5807, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5807, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_14(__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_ERR(0, 5807, __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":5808
- * vid = [] # list of Variable indices
- * for n in range(nv):
- * k = self._recLen[n] # number of records in this variable # <<<<<<<<<<<<<<
- * idx.extend(range(k))
- * vid.extend([n] * k)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recLen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5809
- * for n in range(nv):
- * k = self._recLen[n] # number of records in this variable
- * idx.extend(range(k)) # <<<<<<<<<<<<<<
- * vid.extend([n] * k)
- *
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5809, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_k);
- __Pyx_GIVEREF(__pyx_v_k);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_k);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5809, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_idx, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5809, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5810
- * k = self._recLen[n] # number of records in this variable
- * idx.extend(range(k))
- * vid.extend([n] * k) # <<<<<<<<<<<<<<
- *
- * # Merge the two lists to get a list of 2-elem lists.
- */
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_k); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 5810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_temp;
- }
- __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_vid, __pyx_t_1); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5810, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5807
- * idx = [] # list of record indices
- * vid = [] # list of Variable indices
- * for n in range(nv): # <<<<<<<<<<<<<<
- * k = self._recLen[n] # number of records in this variable
- * idx.extend(range(k))
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5814
- * # Merge the two lists to get a list of 2-elem lists.
- * # Slice this list along the first dimension.
- * lst = list(zip(idx, vid)).__getitem__(slice(sta, stop, step)) # <<<<<<<<<<<<<<
- *
- * # Rebuild the slicing expression for dimensions 1 and ssq.
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- __pyx_t_13 = 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_13 = 1;
- }
- }
- __pyx_t_2 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_INCREF(__pyx_v_idx);
- __Pyx_GIVEREF(__pyx_v_idx);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_13, __pyx_v_idx);
- __Pyx_INCREF(__pyx_v_vid);
- __Pyx_GIVEREF(__pyx_v_vid);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_13, __pyx_v_vid);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PySlice_New(__pyx_v_sta, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __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_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5814, __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_3);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5817
- *
- * # Rebuild the slicing expression for dimensions 1 and ssq.
- * newSlice = [slice(None, None, None)] # <<<<<<<<<<<<<<
- * for n in range(1, len(start)): # skip dimension 0
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n])
- */
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5817, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_slice__125);
- __Pyx_GIVEREF(__pyx_slice__125);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_slice__125);
- __Pyx_XDECREF_SET(__pyx_v_newSlice, ((PyObject*)__pyx_t_7));
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5818
- * # Rebuild the slicing expression for dimensions 1 and ssq.
- * newSlice = [slice(None, None, None)]
- * for n in range(1, len(start)): # skip dimension 0 # <<<<<<<<<<<<<<
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n])
- * newSlice.append(s)
- */
- __pyx_t_13 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5818, __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_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5818, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5818, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5818, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- }
- } else {
- __pyx_t_7 = __pyx_t_14(__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_ERR(0, 5818, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5819
- * newSlice = [slice(None, None, None)]
- * for n in range(1, len(start)): # skip dimension 0
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n]) # <<<<<<<<<<<<<<
- * newSlice.append(s)
- *
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_start, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = PyObject_GetItem(__pyx_v_start, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_count, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_12 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = PySlice_New(__pyx_t_7, __pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5819, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_4));
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5820
- * for n in range(1, len(start)): # skip dimension 0
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n])
- * newSlice.append(s) # <<<<<<<<<<<<<<
- *
- * # Apply the slicing expression to each var in turn, extracting records
- */
- __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_newSlice, __pyx_v_s); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5820, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5818
- * # Rebuild the slicing expression for dimensions 1 and ssq.
- * newSlice = [slice(None, None, None)]
- * for n in range(1, len(start)): # skip dimension 0 # <<<<<<<<<<<<<<
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n])
- * newSlice.append(s)
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5824
- * # Apply the slicing expression to each var in turn, extracting records
- * # in a list of arrays.
- * lstArr = [] # <<<<<<<<<<<<<<
- * ismasked = False
- * for n in range(nv):
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5824, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_lstArr, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5825
- * # in a list of arrays.
- * lstArr = []
- * ismasked = False # <<<<<<<<<<<<<<
- * for n in range(nv):
- * # Get the list of indices for variable 'n'.
- */
- __pyx_v_ismasked = 0;
-
- /* "netCDF4/_netCDF4.pyx":5826
- * lstArr = []
- * ismasked = False
- * for n in range(nv): # <<<<<<<<<<<<<<
- * # Get the list of indices for variable 'n'.
- * idx = [i for i,numv in lst if numv == n]
- */
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5826, __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_ERR(0, 5826, __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_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5826, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5826, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5826, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5826, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_14(__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_ERR(0, 5826, __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":5828
- * for n in range(nv):
- * # Get the list of indices for variable 'n'.
- * idx = [i for i,numv in lst if numv == n] # <<<<<<<<<<<<<<
- * if idx:
- * # Rebuild slicing expression for dimension 0.
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
- __pyx_t_12 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0;
- __pyx_t_17 = NULL;
- } else {
- __pyx_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_17 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 5828, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_17)) {
- if (likely(PyList_CheckExact(__pyx_t_12))) {
- if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_12)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5828, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_12, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 5828, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_12, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_17(__pyx_t_12);
- 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_ERR(0, 5828, __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_ERR(0, 5828, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_18 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_18);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_18)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_18); if (unlikely(!__pyx_t_7)) goto __pyx_L33_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_18); if (unlikely(!__pyx_t_3)) goto __pyx_L33_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_18), 2) < 0) __PYX_ERR(0, 5828, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- goto __pyx_L34_unpacking_done;
- __pyx_L33_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 5828, __pyx_L1_error)
- __pyx_L34_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
- __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_numv, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_numv, __pyx_v_n, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5828, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_10) {
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_i))) __PYX_ERR(0, 5828, __pyx_L1_error)
- }
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF_SET(__pyx_v_idx, ((PyObject*)__pyx_t_1));
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5829
- * # Get the list of indices for variable 'n'.
- * idx = [i for i,numv in lst if numv == n]
- * if idx: # <<<<<<<<<<<<<<
- * # Rebuild slicing expression for dimension 0.
- * newSlice[0] = slice(idx[0], idx[-1] + 1, step)
- */
- __pyx_t_10 = (__pyx_v_idx != Py_None) && (PyList_GET_SIZE(__pyx_v_idx) != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5831
- * if idx:
- * # Rebuild slicing expression for dimension 0.
- * newSlice[0] = slice(idx[0], idx[-1] + 1, step) # <<<<<<<<<<<<<<
- * # Extract records from the var, and append them to a list
- * # of arrays.
- */
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_idx, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5831, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_idx, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5831, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5831, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PySlice_New(__pyx_t_1, __pyx_t_2, __pyx_v_step); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5831, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(__Pyx_SetItemInt(__pyx_v_newSlice, 0, __pyx_t_12, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 5831, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5834
- * # Extract records from the var, and append them to a list
- * # of arrays.
- * dat = Variable.__getitem__(self._recVar[n],tuple(newSlice)) # <<<<<<<<<<<<<<
- * if ma.isMA(dat) and not ismasked:
- * ismasked=True
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Variable), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_AsTuple(__pyx_v_newSlice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = NULL;
- __pyx_t_16 = 0;
- 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);
- __pyx_t_16 = 1;
- }
- }
- __pyx_t_18 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_18);
- if (__pyx_t_7) {
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_7); __pyx_t_7 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_16, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_16, __pyx_t_1);
- __pyx_t_3 = 0;
- __pyx_t_1 = 0;
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_18, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5834, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dat, __pyx_t_12);
- __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5835
- * # of arrays.
- * dat = Variable.__getitem__(self._recVar[n],tuple(newSlice))
- * if ma.isMA(dat) and not ismasked: # <<<<<<<<<<<<<<
- * ismasked=True
- * fill_value = dat.fill_value
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isMA); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_18);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_18))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_18, function);
- }
- }
- if (!__pyx_t_2) {
- __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_v_dat); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_INCREF(__pyx_v_dat);
- __Pyx_GIVEREF(__pyx_v_dat);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_dat);
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5835, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_10 = __pyx_t_11;
- goto __pyx_L38_bool_binop_done;
- }
- __pyx_t_11 = ((!(__pyx_v_ismasked != 0)) != 0);
- __pyx_t_10 = __pyx_t_11;
- __pyx_L38_bool_binop_done:;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5836
- * dat = Variable.__getitem__(self._recVar[n],tuple(newSlice))
- * if ma.isMA(dat) and not ismasked:
- * ismasked=True # <<<<<<<<<<<<<<
- * fill_value = dat.fill_value
- * lstArr.append(dat)
- */
- __pyx_v_ismasked = 1;
-
- /* "netCDF4/_netCDF4.pyx":5837
- * if ma.isMA(dat) and not ismasked:
- * ismasked=True
- * fill_value = dat.fill_value # <<<<<<<<<<<<<<
- * lstArr.append(dat)
- * if ismasked:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_dat, __pyx_n_s_fill_value); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5837, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_XDECREF_SET(__pyx_v_fill_value, __pyx_t_12);
- __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5835
- * # of arrays.
- * dat = Variable.__getitem__(self._recVar[n],tuple(newSlice))
- * if ma.isMA(dat) and not ismasked: # <<<<<<<<<<<<<<
- * ismasked=True
- * fill_value = dat.fill_value
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5838
- * ismasked=True
- * fill_value = dat.fill_value
- * lstArr.append(dat) # <<<<<<<<<<<<<<
- * if ismasked:
- * lstArr = ma.concatenate(lstArr)
- */
- __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_lstArr, __pyx_v_dat); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 5838, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5829
- * # Get the list of indices for variable 'n'.
- * idx = [i for i,numv in lst if numv == n]
- * if idx: # <<<<<<<<<<<<<<
- * # Rebuild slicing expression for dimension 0.
- * newSlice[0] = slice(idx[0], idx[-1] + 1, step)
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5826
- * lstArr = []
- * ismasked = False
- * for n in range(nv): # <<<<<<<<<<<<<<
- * # Get the list of indices for variable 'n'.
- * idx = [i for i,numv in lst if numv == n]
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5839
- * fill_value = dat.fill_value
- * lstArr.append(dat)
- * if ismasked: # <<<<<<<<<<<<<<
- * lstArr = ma.concatenate(lstArr)
- * else:
- */
- __pyx_t_10 = (__pyx_v_ismasked != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5840
- * lstArr.append(dat)
- * if ismasked:
- * lstArr = ma.concatenate(lstArr) # <<<<<<<<<<<<<<
- * else:
- * lstArr = numpy.concatenate(lstArr)
- */
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_18);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_18))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_18);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_18, function);
- }
- }
- if (!__pyx_t_12) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_v_lstArr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL;
- __Pyx_INCREF(__pyx_v_lstArr);
- __Pyx_GIVEREF(__pyx_v_lstArr);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_lstArr);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5840, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __Pyx_DECREF_SET(__pyx_v_lstArr, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5839
- * fill_value = dat.fill_value
- * lstArr.append(dat)
- * if ismasked: # <<<<<<<<<<<<<<
- * lstArr = ma.concatenate(lstArr)
- * else:
- */
- goto __pyx_L40;
- }
-
- /* "netCDF4/_netCDF4.pyx":5842
- * lstArr = ma.concatenate(lstArr)
- * else:
- * lstArr = numpy.concatenate(lstArr) # <<<<<<<<<<<<<<
- * if lstArr.dtype != data.dtype: data = data.astype(lstArr.dtype)
- * # sometimes there are legitimate singleton dimensions, in which
- */
- /*else*/ {
- __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 5842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_18);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = NULL;
- 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);
- }
- }
- if (!__pyx_t_18) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_lstArr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_18); __pyx_t_18 = NULL;
- __Pyx_INCREF(__pyx_v_lstArr);
- __Pyx_GIVEREF(__pyx_v_lstArr);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_lstArr);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5842, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_lstArr, __pyx_t_4);
- __pyx_t_4 = 0;
- }
- __pyx_L40:;
-
- /* "netCDF4/_netCDF4.pyx":5843
- * else:
- * lstArr = numpy.concatenate(lstArr)
- * if lstArr.dtype != data.dtype: data = data.astype(lstArr.dtype) # <<<<<<<<<<<<<<
- * # sometimes there are legitimate singleton dimensions, in which
- * # case the array shapes won't conform. If so, a ValueError will
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_lstArr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (__pyx_t_10) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_lstArr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_18 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
- }
- }
- if (!__pyx_t_18) {
- __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- } else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); __pyx_t_18 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5843, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_12);
- __pyx_t_12 = 0;
- }
-
- /* "netCDF4/_netCDF4.pyx":5847
- * # case the array shapes won't conform. If so, a ValueError will
- * # result, and no squeeze will be done.
- * try: # <<<<<<<<<<<<<<
- * data[tuple(ind)] = lstArr.squeeze()
- * except ValueError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
- __Pyx_XGOTREF(__pyx_t_19);
- __Pyx_XGOTREF(__pyx_t_20);
- __Pyx_XGOTREF(__pyx_t_21);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":5848
- * # result, and no squeeze will be done.
- * try:
- * data[tuple(ind)] = lstArr.squeeze() # <<<<<<<<<<<<<<
- * except ValueError:
- * data[tuple(ind)] = lstArr
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lstArr, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5848, __pyx_L42_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_12 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5848, __pyx_L42_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5848, __pyx_L42_error)
- }
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PySequence_Tuple(__pyx_v_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5848, __pyx_L42_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_v_data, __pyx_t_1, __pyx_t_12) < 0)) __PYX_ERR(0, 5848, __pyx_L42_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5847
- * # case the array shapes won't conform. If so, a ValueError will
- * # result, and no squeeze will be done.
- * try: # <<<<<<<<<<<<<<
- * data[tuple(ind)] = lstArr.squeeze()
- * except ValueError:
- */
- }
- __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
- __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
- goto __pyx_L49_try_end;
- __pyx_L42_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5849
- * try:
- * data[tuple(ind)] = lstArr.squeeze()
- * except ValueError: # <<<<<<<<<<<<<<
- * data[tuple(ind)] = lstArr
- *
- */
- __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
- if (__pyx_t_22) {
- __Pyx_AddTraceback("netCDF4._netCDF4._Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 5849, __pyx_L44_except_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netCDF4/_netCDF4.pyx":5850
- * data[tuple(ind)] = lstArr.squeeze()
- * except ValueError:
- * data[tuple(ind)] = lstArr # <<<<<<<<<<<<<<
- *
- * # Remove extra singleton dimensions.
- */
- __pyx_t_4 = PySequence_Tuple(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5850, __pyx_L44_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(PyObject_SetItem(__pyx_v_data, __pyx_t_4, __pyx_v_lstArr) < 0)) __PYX_ERR(0, 5850, __pyx_L44_except_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L43_exception_handled;
- }
- goto __pyx_L44_except_error;
- __pyx_L44_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":5847
- * # case the array shapes won't conform. If so, a ValueError will
- * # result, and no squeeze will be done.
- * try: # <<<<<<<<<<<<<<
- * data[tuple(ind)] = lstArr.squeeze()
- * except ValueError:
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
- goto __pyx_L1_error;
- __pyx_L43_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_19);
- __Pyx_XGIVEREF(__pyx_t_20);
- __Pyx_XGIVEREF(__pyx_t_21);
- __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
- __pyx_L49_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":5789
- * # Number of variables making up the MFVariable.Variable.
- * nv = len(self._recLen)
- * for (start,count,stride,ind) in zip(strt, cnt, strd, put_ind): # <<<<<<<<<<<<<<
- * # make sure count=-1 becomes count=1
- * count = [abs(cnt) for cnt in count]
- */
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5853
- *
- * # Remove extra singleton dimensions.
- * data = data[tuple(squeeze)] # <<<<<<<<<<<<<<
- *
- * # if no masked elements, return numpy array.
- */
- __pyx_t_6 = PySequence_Tuple(__pyx_v_squeeze); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5856
- *
- * # if no masked elements, return numpy array.
- * if ma.isMA(data) and not data.mask.any(): # <<<<<<<<<<<<<<
- * data = data.filled()
- *
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isMA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_data);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_10 = __pyx_t_11;
- goto __pyx_L53_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5856, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 5856, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_23 = ((!__pyx_t_11) != 0);
- __pyx_t_10 = __pyx_t_23;
- __pyx_L53_bool_binop_done:;
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5857
- * # if no masked elements, return numpy array.
- * if ma.isMA(data) and not data.mask.any():
- * data = data.filled() # <<<<<<<<<<<<<<
- *
- * return data
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_filled); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 5857, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5857, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5857, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5856
- *
- * # if no masked elements, return numpy array.
- * if ma.isMA(data) and not data.mask.any(): # <<<<<<<<<<<<<<
- * data = data.filled()
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5859
- * data = data.filled()
- *
- * return data # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_data);
- __pyx_r = __pyx_v_data;
- goto __pyx_L0;
-
- /* "netCDF4/_netCDF4.pyx":5758
- * for v in self._recVar:
- * v.set_auto_scale(val)
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * """Get records from a concatenated set of variables."""
- *
- */
-
- /* 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_XDECREF(__pyx_t_18);
- __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_strt);
- __Pyx_XDECREF(__pyx_v_cnt);
- __Pyx_XDECREF(__pyx_v_strd);
- __Pyx_XDECREF(__pyx_v_ind);
- __Pyx_XDECREF(__pyx_v_sta);
- __Pyx_XDECREF(__pyx_v_step);
- __Pyx_XDECREF(__pyx_v_stop);
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_XDECREF(__pyx_v_vid);
- __Pyx_XDECREF(__pyx_v_k);
- __Pyx_XDECREF(__pyx_v_lst);
- __Pyx_XDECREF(__pyx_v_newSlice);
- __Pyx_XDECREF(__pyx_v_s);
- __Pyx_XDECREF(__pyx_v_lstArr);
- __Pyx_XDECREF(__pyx_v_dat);
- __Pyx_XDECREF(__pyx_v_fill_value);
- __Pyx_XDECREF(__pyx_v_numv);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5897
- * """
- *
- * def __init__(self, time, units=None): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, time, units=None)`**
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6MFTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7netCDF4_8_netCDF4_6MFTime___init__[] = "\n **`__init__(self, time, units=None)`**\n\n Create a time Variable with units consistent across a multifile\n dataset.\n \n **`time`**: Time variable from a `netCDF4.MFDataset`.\n \n **`units`**: Time units, for example, `days since 1979-01-01`. If None, use\n the units from the master variable.\n ";
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_6MFTime_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_6MFTime_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_6MFTime___init__};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6MFTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_time = 0;
- PyObject *__pyx_v_units = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_time,&__pyx_n_s_units,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)((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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 5897, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_units);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5897, __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_self = values[0];
- __pyx_v_time = values[1];
- __pyx_v_units = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5897, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.MFTime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6MFTime___init__(__pyx_self, __pyx_v_self, __pyx_v_time, __pyx_v_units);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-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) {
- PyObject *__pyx_v_datetime = NULL;
- PyObject *__pyx_v_name = NULL;
- PyObject *__pyx_v_value = NULL;
- PyObject *__pyx_v_t = NULL;
- PyObject *__pyx_v_ref_date = NULL;
- PyObject *__pyx_v_ref_num = NULL;
- PyObject *__pyx_v_i0 = NULL;
- PyObject *__pyx_v_i1 = NULL;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_num = 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 *);
- int __pyx_t_9;
- int __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5909
- * the units from the master variable.
- * """
- * import datetime # <<<<<<<<<<<<<<
- * self.__time = time
- *
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5909, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_datetime = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5910
- * """
- * import datetime
- * self.__time = time # <<<<<<<<<<<<<<
- *
- * # copy attributes from master time variable.
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_MFTime__time, __pyx_v_time) < 0) __PYX_ERR(0, 5910, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5913
- *
- * # copy attributes from master time variable.
- * for name, value in time.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5913, __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_ERR(0, 5913, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5913, __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_ERR(0, 5913, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __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_ERR(0, 5913, __pyx_L1_error)
- __pyx_L6_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
- __pyx_t_2 = 0;
- __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5914
- * # copy attributes from master time variable.
- * for name, value in time.__dict__.items():
- * self.__dict__[name] = value # <<<<<<<<<<<<<<
- *
- * # make sure calendar attribute present in all files.
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5914, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 5914, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5913
- *
- * # copy attributes from master time variable.
- * for name, value in time.__dict__.items(): # <<<<<<<<<<<<<<
- * self.__dict__[name] = value
- *
- */
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5917
- *
- * # make sure calendar attribute present in all files.
- * for t in self._recVar: # <<<<<<<<<<<<<<
- * if not hasattr(t,'calendar'):
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute')
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- 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_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5917, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5917, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5917, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_5(__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_ERR(0, 5917, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5918
- * # make sure calendar attribute present in all files.
- * for t in self._recVar:
- * if not hasattr(t,'calendar'): # <<<<<<<<<<<<<<
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute')
- *
- */
- __pyx_t_9 = PyObject_HasAttr(__pyx_v_t, __pyx_n_s_calendar); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 5918, __pyx_L1_error)
- __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5919
- * for t in self._recVar:
- * if not hasattr(t,'calendar'):
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute') # <<<<<<<<<<<<<<
- *
- * # Check that calendar is the same in all files.
- */
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5919, __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_ERR(0, 5919, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5918
- * # make sure calendar attribute present in all files.
- * for t in self._recVar:
- * if not hasattr(t,'calendar'): # <<<<<<<<<<<<<<
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute')
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5917
- *
- * # make sure calendar attribute present in all files.
- * for t in self._recVar: # <<<<<<<<<<<<<<
- * if not hasattr(t,'calendar'):
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute')
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5922
- *
- * # Check that calendar is the same in all files.
- * if len(set([t.calendar for t in self._recVar])) > 1: # <<<<<<<<<<<<<<
- * raise ValueError('MFTime requires that the same time calendar is used by all files.')
- *
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5922, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5922, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5922, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_5(__pyx_t_6);
- 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_ERR(0, 5922, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = PySet_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 5922, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = ((__pyx_t_4 > 1) != 0);
- if (__pyx_t_10) {
-
- /* "netCDF4/_netCDF4.pyx":5923
- * # Check that calendar is the same in all files.
- * if len(set([t.calendar for t in self._recVar])) > 1:
- * raise ValueError('MFTime requires that the same time calendar is used by all files.') # <<<<<<<<<<<<<<
- *
- * # Override units if units is specified.
- */
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5923, __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_ERR(0, 5923, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5922
- *
- * # Check that calendar is the same in all files.
- * if len(set([t.calendar for t in self._recVar])) > 1: # <<<<<<<<<<<<<<
- * raise ValueError('MFTime requires that the same time calendar is used by all files.')
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":5926
- *
- * # Override units if units is specified.
- * self.units = units or time.units # <<<<<<<<<<<<<<
- *
- * # Reference date to compute the difference between different time units.
- */
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_units); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 5926, __pyx_L1_error)
- if (!__pyx_t_10) {
- } else {
- __Pyx_INCREF(__pyx_v_units);
- __pyx_t_6 = __pyx_v_units;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5926, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_6 = __pyx_t_1;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_L13_bool_binop_done:;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_units, __pyx_t_6) < 0) __PYX_ERR(0, 5926, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5929
- *
- * # Reference date to compute the difference between different time units.
- * ref_date = datetime.datetime(1900,1,1) # <<<<<<<<<<<<<<
- * ref_num = date2num(ref_date, self.units, self.calendar)
- *
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5929, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5929, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ref_date = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5930
- * # Reference date to compute the difference between different time units.
- * ref_date = datetime.datetime(1900,1,1)
- * ref_num = date2num(ref_date, self.units, self.calendar) # <<<<<<<<<<<<<<
- *
- * # Create delta vector: delta = ref_num(ref_date) - num(ref_date)
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_date2num); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5930, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5930, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5930, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __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_11 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5930, __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_INCREF(__pyx_v_ref_date);
- __Pyx_GIVEREF(__pyx_v_ref_date);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_ref_date);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_4, __pyx_t_2);
- __pyx_t_3 = 0;
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5930, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ref_num = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5934
- * # Create delta vector: delta = ref_num(ref_date) - num(ref_date)
- * # So that ref_num(date) = num(date) + delta
- * self.__delta = numpy.empty(len(self), time.dtype) # <<<<<<<<<<<<<<
- *
- * i0 = 0; i1 = 0
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- __pyx_t_4 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_4 = 1;
- }
- }
- __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_2);
- __pyx_t_6 = 0;
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_MFTime__delta, __pyx_t_1) < 0) __PYX_ERR(0, 5934, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5936
- * self.__delta = numpy.empty(len(self), time.dtype)
- *
- * i0 = 0; i1 = 0 # <<<<<<<<<<<<<<
- * for i,v in enumerate(self._recVar):
- * n = self._recLen[i] # Length of time vector.
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_i0 = __pyx_int_0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_i1 = __pyx_int_0;
-
- /* "netCDF4/_netCDF4.pyx":5937
- *
- * i0 = 0; i1 = 0
- * for i,v in enumerate(self._recVar): # <<<<<<<<<<<<<<
- * n = self._recLen[i] # Length of time vector.
- * num = date2num(ref_date, v.units, self.calendar)
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_1 = __pyx_int_0;
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recVar); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
- __pyx_t_7 = __pyx_t_11; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5937, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_11 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5937, __pyx_L1_error)
- #else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- #endif
- } else {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 5937, __pyx_L1_error)
- #else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- #endif
- }
- } else {
- __pyx_t_11 = __pyx_t_5(__pyx_t_7);
- if (unlikely(!__pyx_t_11)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 5937, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_11);
- }
- __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_11);
- __pyx_t_11 = 0;
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
- __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5938
- * i0 = 0; i1 = 0
- * for i,v in enumerate(self._recVar):
- * n = self._recLen[i] # Length of time vector. # <<<<<<<<<<<<<<
- * num = date2num(ref_date, v.units, self.calendar)
- * i1 += n
- */
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recLen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5938, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_11, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5938, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5939
- * for i,v in enumerate(self._recVar):
- * n = self._recLen[i] # Length of time vector.
- * num = date2num(ref_date, v.units, self.calendar) # <<<<<<<<<<<<<<
- * i1 += n
- * self.__delta[i0:i1] = ref_num - num
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_date2num); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_12 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_13 = 1;
- }
- }
- __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 5939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- if (__pyx_t_12) {
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
- }
- __Pyx_INCREF(__pyx_v_ref_date);
- __Pyx_GIVEREF(__pyx_v_ref_date);
- PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_v_ref_date);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_3);
- __pyx_t_6 = 0;
- __pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF_SET(__pyx_v_num, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5940
- * n = self._recLen[i] # Length of time vector.
- * num = date2num(ref_date, v.units, self.calendar)
- * i1 += n # <<<<<<<<<<<<<<
- * self.__delta[i0:i1] = ref_num - num
- * i0 += n
- */
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i1, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5940, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_i1, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5941
- * num = date2num(ref_date, v.units, self.calendar)
- * i1 += n
- * self.__delta[i0:i1] = ref_num - num # <<<<<<<<<<<<<<
- * i0 += n
- *
- */
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_ref_num, __pyx_v_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MFTime__delta); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__Pyx_PyObject_SetSlice(__pyx_t_11, __pyx_t_2, 0, 0, &__pyx_v_i0, &__pyx_v_i1, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 5941, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5942
- * i1 += n
- * self.__delta[i0:i1] = ref_num - num
- * i0 += n # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i0, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_i0, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5937
- *
- * i0 = 0; i1 = 0
- * for i,v in enumerate(self._recVar): # <<<<<<<<<<<<<<
- * n = self._recLen[i] # Length of time vector.
- * num = date2num(ref_date, v.units, self.calendar)
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5897
- * """
- *
- * def __init__(self, time, units=None): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, time, units=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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_AddTraceback("netCDF4._netCDF4.MFTime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_datetime);
- __Pyx_XDECREF(__pyx_v_name);
- __Pyx_XDECREF(__pyx_v_value);
- __Pyx_XDECREF(__pyx_v_t);
- __Pyx_XDECREF(__pyx_v_ref_date);
- __Pyx_XDECREF(__pyx_v_ref_num);
- __Pyx_XDECREF(__pyx_v_i0);
- __Pyx_XDECREF(__pyx_v_i1);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_num);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netCDF4/_netCDF4.pyx":5945
- *
- *
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * return self.__time[elem] + self.__delta[elem]
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6MFTime_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_6MFTime_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_6MFTime_3__getitem__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6MFTime_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_elem = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 5945, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 5945, __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_self = values[0];
- __pyx_v_elem = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5945, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netCDF4._netCDF4.MFTime.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6MFTime_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_elem);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6MFTime_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "netCDF4/_netCDF4.pyx":5946
- *
- * def __getitem__(self, elem):
- * return self.__time[elem] + self.__delta[elem] # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MFTime__time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MFTime__delta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_elem); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":5945
- *
- *
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * return self.__time[elem] + self.__delta[elem]
- */
-
- /* 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.MFTime.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Dataset(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)o);
- p->groups = Py_None; Py_INCREF(Py_None);
- p->dimensions = Py_None; Py_INCREF(Py_None);
- p->variables = Py_None; Py_INCREF(Py_None);
- p->disk_format = Py_None; Py_INCREF(Py_None);
- p->path = Py_None; Py_INCREF(Py_None);
- p->parent = Py_None; Py_INCREF(Py_None);
- p->file_format = Py_None; Py_INCREF(Py_None);
- p->data_model = Py_None; Py_INCREF(Py_None);
- p->cmptypes = Py_None; Py_INCREF(Py_None);
- p->vltypes = Py_None; Py_INCREF(Py_None);
- p->enumtypes = Py_None; Py_INCREF(Py_None);
- p->__orthogonal_indexing__ = Py_None; Py_INCREF(Py_None);
- p->keepweakref = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_Dataset(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_pw_7netCDF4_8_netCDF4_7Dataset_19__dealloc__(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- if (p->__weakref__) PyObject_ClearWeakRefs(o);
- Py_CLEAR(p->groups);
- Py_CLEAR(p->dimensions);
- Py_CLEAR(p->variables);
- Py_CLEAR(p->disk_format);
- Py_CLEAR(p->path);
- Py_CLEAR(p->parent);
- Py_CLEAR(p->file_format);
- Py_CLEAR(p->data_model);
- Py_CLEAR(p->cmptypes);
- Py_CLEAR(p->vltypes);
- Py_CLEAR(p->enumtypes);
- Py_CLEAR(p->__orthogonal_indexing__);
- Py_CLEAR(p->keepweakref);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_Dataset(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)o;
- if (p->groups) {
- e = (*v)(p->groups, a); if (e) return e;
- }
- if (p->dimensions) {
- e = (*v)(p->dimensions, a); if (e) return e;
- }
- if (p->variables) {
- e = (*v)(p->variables, a); if (e) return e;
- }
- if (p->disk_format) {
- e = (*v)(p->disk_format, a); if (e) return e;
- }
- if (p->path) {
- e = (*v)(p->path, a); if (e) return e;
- }
- if (p->parent) {
- e = (*v)(p->parent, a); if (e) return e;
- }
- if (p->file_format) {
- e = (*v)(p->file_format, a); if (e) return e;
- }
- if (p->data_model) {
- e = (*v)(p->data_model, a); if (e) return e;
- }
- if (p->cmptypes) {
- e = (*v)(p->cmptypes, a); if (e) return e;
- }
- if (p->vltypes) {
- e = (*v)(p->vltypes, a); if (e) return e;
- }
- if (p->enumtypes) {
- e = (*v)(p->enumtypes, a); if (e) return e;
- }
- if (p->__orthogonal_indexing__) {
- e = (*v)(p->__orthogonal_indexing__, a); if (e) return e;
- }
- if (p->keepweakref) {
- e = (*v)(p->keepweakref, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_Dataset(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)o;
- tmp = ((PyObject*)p->groups);
- p->groups = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->dimensions);
- p->dimensions = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->variables);
- p->variables = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->disk_format);
- p->disk_format = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->path);
- p->path = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->parent);
- p->parent = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->file_format);
- p->file_format = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->data_model);
- p->data_model = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->cmptypes);
- p->cmptypes = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->vltypes);
- p->vltypes = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->enumtypes);
- p->enumtypes = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__orthogonal_indexing__);
- p->__orthogonal_indexing__ = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->keepweakref);
- p->keepweakref = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *__pyx_sq_item_7netCDF4_8_netCDF4_Dataset(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static PyObject *__pyx_tp_getattro_7netCDF4_8_netCDF4_Dataset(PyObject *o, PyObject *n) {
- PyObject *v = PyObject_GenericGetAttr(o, n);
- if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- v = __pyx_pw_7netCDF4_8_netCDF4_7Dataset_65__getattr__(o, n);
- }
- return v;
-}
-
-static int __pyx_tp_setattro_7netCDF4_8_netCDF4_Dataset(PyObject *o, PyObject *n, PyObject *v) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_63__setattr__(o, n, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_59__delattr__(o, n);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset__grpid(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset__grpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset__isopen(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset__isopen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_groups(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_groups(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_dimensions(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_dimensions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_variables(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_variables(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_disk_format(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_disk_format(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_path(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_path(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_parent(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_parent(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_file_format(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_file_format(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_data_model(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_data_model(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_cmptypes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_cmptypes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_vltypes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_vltypes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_enumtypes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_enumtypes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset___orthogonal_indexing__(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset___orthogonal_indexing__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_7Dataset_keepweakref(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_keepweakref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_Dataset[] = {
- {"__enter__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_3__enter__, METH_NOARGS, 0},
- {"__exit__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_5__exit__, METH_VARARGS|METH_KEYWORDS, 0},
- {"filepath", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9filepath, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_8filepath},
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_13__unicode__, METH_NOARGS, 0},
- {"close", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_15close, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_14close},
- {"isopen", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_17isopen, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_16isopen},
- {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_21__reduce__, METH_NOARGS, 0},
- {"sync", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23sync, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_22sync},
- {"_redef", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_25_redef, METH_NOARGS, 0},
- {"_enddef", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_27_enddef, METH_NOARGS, 0},
- {"set_fill_on", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_29set_fill_on, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_28set_fill_on},
- {"set_fill_off", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_31set_fill_off, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_30set_fill_off},
- {"createDimension", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_33createDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_32createDimension},
- {"renameDimension", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_35renameDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_34renameDimension},
- {"createCompoundType", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_37createCompoundType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_36createCompoundType},
- {"createVLType", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_39createVLType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_38createVLType},
- {"createEnumType", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_41createEnumType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_40createEnumType},
- {"createVariable", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_43createVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_42createVariable},
- {"renameVariable", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_45renameVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_44renameVariable},
- {"createGroup", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_47createGroup, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_46createGroup},
- {"ncattrs", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_49ncattrs, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_48ncattrs},
- {"setncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_51setncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_50setncattr},
- {"setncattr_string", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_53setncattr_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_52setncattr_string},
- {"setncatts", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_55setncatts, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_54setncatts},
- {"getncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_57getncattr, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_56getncattr},
- {"delncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_61delncattr, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_60delncattr},
- {"__getattr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_65__getattr__, METH_O|METH_COEXIST, 0},
- {"renameAttribute", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_67renameAttribute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_66renameAttribute},
- {"renameGroup", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_69renameGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_68renameGroup},
- {"set_auto_maskandscale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_71set_auto_maskandscale, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_70set_auto_maskandscale},
- {"set_auto_mask", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_73set_auto_mask, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_72set_auto_mask},
- {"set_auto_scale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_75set_auto_scale, METH_O, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_74set_auto_scale},
- {"get_variables_by_attributes", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7Dataset_77get_variables_by_attributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_7Dataset_76get_variables_by_attributes},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_Dataset[] = {
- {(char *)"_grpid", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset__grpid, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset__grpid, (char *)0, 0},
- {(char *)"_isopen", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset__isopen, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset__isopen, (char *)0, 0},
- {(char *)"groups", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_groups, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_groups, (char *)0, 0},
- {(char *)"dimensions", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_dimensions, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_dimensions, (char *)0, 0},
- {(char *)"variables", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_variables, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_variables, (char *)0, 0},
- {(char *)"disk_format", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_disk_format, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_disk_format, (char *)0, 0},
- {(char *)"path", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_path, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_path, (char *)0, 0},
- {(char *)"parent", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_parent, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_parent, (char *)0, 0},
- {(char *)"file_format", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_file_format, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_file_format, (char *)0, 0},
- {(char *)"data_model", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_data_model, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_data_model, (char *)0, 0},
- {(char *)"cmptypes", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_cmptypes, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_cmptypes, (char *)0, 0},
- {(char *)"vltypes", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_vltypes, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_vltypes, (char *)0, 0},
- {(char *)"enumtypes", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_enumtypes, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_enumtypes, (char *)0, 0},
- {(char *)"__orthogonal_indexing__", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset___orthogonal_indexing__, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset___orthogonal_indexing__, (char *)0, 0},
- {(char *)"keepweakref", __pyx_getprop_7netCDF4_8_netCDF4_7Dataset_keepweakref, __pyx_setprop_7netCDF4_8_netCDF4_7Dataset_keepweakref, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_Dataset = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_7netCDF4_8_netCDF4_Dataset, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_Dataset = {
- 0, /*mp_length*/
- __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7__getitem__, /*mp_subscript*/
- 0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_Dataset = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.Dataset", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_Dataset, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_Dataset, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_Dataset, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- __pyx_tp_getattro_7netCDF4_8_netCDF4_Dataset, /*tp_getattro*/
- __pyx_tp_setattro_7netCDF4_8_netCDF4_Dataset, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA netCDF `netCDF4.Dataset` is a collection of dimensions, groups, variables and\nattributes. Together they describe the meaning of data and relations among\ndata fields stored in a netCDF file. See `netCDF4.Dataset.__init__` for more\ndetails.\n\nA list of attribute names corresponding to global netCDF attributes\ndefined for the `netCDF4.Dataset` can be obtained with the\n`netCDF4.Dataset.ncattrs` method.\nThese attributes can be created by assigning to an attribute of the\n`netCDF [...]
- __pyx_tp_traverse_7netCDF4_8_netCDF4_Dataset, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_Dataset, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_Dataset, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_Dataset, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_7Dataset_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_Dataset, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Group(PyTypeObject *t, PyObject *a, PyObject *k) {
- PyObject *o = __pyx_tp_new_7netCDF4_8_netCDF4_Dataset(t, a, k);
- if (unlikely(!o)) return 0;
- return o;
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_5Group_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_5Group_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_5Group_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_5Group_4name_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_Group[] = {
- {"close", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_5Group_3close, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_5Group_2close},
- {"_getname", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_5Group_5_getname, METH_NOARGS, 0},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_Group[] = {
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_5Group_name, __pyx_setprop_7netCDF4_8_netCDF4_5Group_name, (char *)"string name of Group instance", 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_Group = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.Group", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_Group), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_Dataset, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nGroups define a hierarchical namespace within a netCDF file. They are\nanalogous to directories in a unix filesystem. Each `netCDF4.Group` behaves like\na `netCDF4.Dataset` within a Dataset, and can contain it's own variables,\ndimensions and attributes (and other Groups). See `netCDF4.Group.__init__`\nfor more details.\n\n`netCDF4.Group` inherits from `netCDF4.Dataset`, so all the \n`netCDF4.Dataset` class methods and variables are available\nto a `netCDF4.Group` instance (except t [...]
- __pyx_tp_traverse_7netCDF4_8_netCDF4_Dataset, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_Dataset, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_Group, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_Group, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_5Group_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_Group, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Dimension(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)o);
- p->_data_model = Py_None; Py_INCREF(Py_None);
- p->_name = Py_None; Py_INCREF(Py_None);
- p->_grp = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_Dimension(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->_data_model);
- Py_CLEAR(p->_name);
- Py_CLEAR(p->_grp);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_Dimension(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)o;
- if (p->_data_model) {
- e = (*v)(p->_data_model, a); if (e) return e;
- }
- if (p->_name) {
- e = (*v)(p->_name, a); if (e) return e;
- }
- if (p->_grp) {
- e = (*v)(p->_grp, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_Dimension(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)o;
- tmp = ((PyObject*)p->_data_model);
- p->_data_model = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_name);
- p->_name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_grp);
- p->_grp = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension__dimid(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__dimid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension__grpid(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__grpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension__data_model(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__data_model(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension__name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_9Dimension__grp(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__grp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_Dimension[] = {
- {"_getname", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9Dimension_3_getname, METH_NOARGS, 0},
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9Dimension_7__unicode__, METH_NOARGS, 0},
- {"group", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9Dimension_11group, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_9Dimension_10group},
- {"isunlimited", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9Dimension_13isunlimited, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_9Dimension_12isunlimited},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_Dimension[] = {
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension_name, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension_name, (char *)"string name of Dimension instance", 0},
- {(char *)"size", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension_size, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension_size, (char *)"current size of Dimension (calls `len` on Dimension instance)", 0},
- {(char *)"_dimid", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension__dimid, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__dimid, (char *)0, 0},
- {(char *)"_grpid", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension__grpid, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__grpid, (char *)0, 0},
- {(char *)"_data_model", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension__data_model, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__data_model, (char *)0, 0},
- {(char *)"_name", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension__name, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__name, (char *)0, 0},
- {(char *)"_grp", __pyx_getprop_7netCDF4_8_netCDF4_9Dimension__grp, __pyx_setprop_7netCDF4_8_netCDF4_9Dimension__grp, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_Dimension = {
- __pyx_pw_7netCDF4_8_netCDF4_9Dimension_9__len__, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- 0, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_Dimension = {
- __pyx_pw_7netCDF4_8_netCDF4_9Dimension_9__len__, /*mp_length*/
- 0, /*mp_subscript*/
- 0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_Dimension = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.Dimension", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_Dimension, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_Dimension, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_Dimension, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA netCDF `netCDF4.Dimension` is used to describe the coordinates of a `netCDF4.Variable`.\nSee `netCDF4.Dimension.__init__` for more details.\n\nThe current maximum size of a `netCDF4.Dimension` instance can be obtained by\ncalling the python `len` function on the `netCDF4.Dimension` instance. The\n`netCDF4.Dimension.isunlimited` method of a `netCDF4.Dimension` instance can be used to\ndetermine if the dimension is unlimited.\n\nRead-only class variables:\n\n**`name`**: String name, [...]
- __pyx_tp_traverse_7netCDF4_8_netCDF4_Dimension, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_Dimension, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_Dimension, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_Dimension, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_9Dimension_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_Dimension, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Variable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Variable *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)o);
- p->_name = Py_None; Py_INCREF(Py_None);
- p->ndim = Py_None; Py_INCREF(Py_None);
- p->dtype = Py_None; Py_INCREF(Py_None);
- p->mask = Py_None; Py_INCREF(Py_None);
- p->scale = Py_None; Py_INCREF(Py_None);
- p->_isprimitive = Py_None; Py_INCREF(Py_None);
- p->_iscompound = Py_None; Py_INCREF(Py_None);
- p->_isvlen = Py_None; Py_INCREF(Py_None);
- p->_isenum = Py_None; Py_INCREF(Py_None);
- p->_grp = Py_None; Py_INCREF(Py_None);
- p->_cmptype = Py_None; Py_INCREF(Py_None);
- p->_vltype = Py_None; Py_INCREF(Py_None);
- p->_enumtype = Py_None; Py_INCREF(Py_None);
- p->__orthogonal_indexing__ = Py_None; Py_INCREF(Py_None);
- p->_has_lsd = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_Variable(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_Variable *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->_name);
- Py_CLEAR(p->ndim);
- Py_CLEAR(p->dtype);
- Py_CLEAR(p->mask);
- Py_CLEAR(p->scale);
- Py_CLEAR(p->_isprimitive);
- Py_CLEAR(p->_iscompound);
- Py_CLEAR(p->_isvlen);
- Py_CLEAR(p->_isenum);
- Py_CLEAR(p->_grp);
- Py_CLEAR(p->_cmptype);
- Py_CLEAR(p->_vltype);
- Py_CLEAR(p->_enumtype);
- Py_CLEAR(p->__orthogonal_indexing__);
- Py_CLEAR(p->_has_lsd);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_Variable(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_Variable *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)o;
- if (p->_name) {
- e = (*v)(p->_name, a); if (e) return e;
- }
- if (p->ndim) {
- e = (*v)(p->ndim, a); if (e) return e;
- }
- if (p->dtype) {
- e = (*v)(p->dtype, a); if (e) return e;
- }
- if (p->mask) {
- e = (*v)(p->mask, a); if (e) return e;
- }
- if (p->scale) {
- e = (*v)(p->scale, a); if (e) return e;
- }
- if (p->_isprimitive) {
- e = (*v)(p->_isprimitive, a); if (e) return e;
- }
- if (p->_iscompound) {
- e = (*v)(p->_iscompound, a); if (e) return e;
- }
- if (p->_isvlen) {
- e = (*v)(p->_isvlen, a); if (e) return e;
- }
- if (p->_isenum) {
- e = (*v)(p->_isenum, a); if (e) return e;
- }
- if (p->_grp) {
- e = (*v)(p->_grp, a); if (e) return e;
- }
- if (p->_cmptype) {
- e = (*v)(p->_cmptype, a); if (e) return e;
- }
- if (p->_vltype) {
- e = (*v)(p->_vltype, a); if (e) return e;
- }
- if (p->_enumtype) {
- e = (*v)(p->_enumtype, a); if (e) return e;
- }
- if (p->__orthogonal_indexing__) {
- e = (*v)(p->__orthogonal_indexing__, a); if (e) return e;
- }
- if (p->_has_lsd) {
- e = (*v)(p->_has_lsd, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_Variable(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_Variable *p = (struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)o;
- tmp = ((PyObject*)p->_name);
- p->_name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->ndim);
- p->ndim = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->dtype);
- p->dtype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->mask);
- p->mask = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->scale);
- p->scale = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_isprimitive);
- p->_isprimitive = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_iscompound);
- p->_iscompound = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_isvlen);
- p->_isvlen = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_isenum);
- p->_isenum = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_grp);
- p->_grp = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_cmptype);
- p->_cmptype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_vltype);
- p->_vltype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_enumtype);
- p->_enumtype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__orthogonal_indexing__);
- p->__orthogonal_indexing__ = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_has_lsd);
- p->_has_lsd = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *__pyx_sq_item_7netCDF4_8_netCDF4_Variable(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static int __pyx_mp_ass_subscript_7netCDF4_8_netCDF4_Variable(PyObject *o, PyObject *i, PyObject *v) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_51__setitem__(o, i, v);
- }
- else {
- PyErr_Format(PyExc_NotImplementedError,
- "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
- return -1;
- }
-}
-
-static PyObject *__pyx_tp_getattro_7netCDF4_8_netCDF4_Variable(PyObject *o, PyObject *n) {
- PyObject *v = PyObject_GenericGetAttr(o, n);
- if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- v = __pyx_pw_7netCDF4_8_netCDF4_8Variable_41__getattr__(o, n);
- }
- return v;
-}
-
-static int __pyx_tp_setattro_7netCDF4_8_netCDF4_Variable(PyObject *o, PyObject *n, PyObject *v) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_39__setattr__(o, n, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_37__delattr__(o, n);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_datatype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8datatype_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4size_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_dimensions(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_dimensions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__varid(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__varid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__grpid(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__grpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__nunlimdim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__nunlimdim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_ndim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_dtype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_mask(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable_scale(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__isprimitive(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isprimitive(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__iscompound(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__iscompound(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__isvlen(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isvlen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__isenum(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isenum(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__grp(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__grp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__cmptype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__cmptype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__vltype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__vltype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__enumtype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__enumtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable___orthogonal_indexing__(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable___orthogonal_indexing__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8Variable__has_lsd(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8Variable__has_lsd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_has_lsd_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_Variable[] = {
- {"__array__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_3__array__, METH_NOARGS, 0},
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_7__unicode__, METH_NOARGS, 0},
- {"_getdims", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_9_getdims, METH_NOARGS, 0},
- {"_getname", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_11_getname, METH_NOARGS, 0},
- {"group", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_13group, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_12group},
- {"ncattrs", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_15ncattrs, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_14ncattrs},
- {"setncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_17setncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_16setncattr},
- {"setncattr_string", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_19setncattr_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_18setncattr_string},
- {"setncatts", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_21setncatts, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_20setncatts},
- {"getncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_23getncattr, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_22getncattr},
- {"delncattr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_25delncattr, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_24delncattr},
- {"filters", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_27filters, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_26filters},
- {"endian", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_29endian, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_28endian},
- {"chunking", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_31chunking, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_30chunking},
- {"get_var_chunk_cache", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_33get_var_chunk_cache, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_32get_var_chunk_cache},
- {"set_var_chunk_cache", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_35set_var_chunk_cache, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_34set_var_chunk_cache},
- {"__getattr__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_41__getattr__, METH_O|METH_COEXIST, 0},
- {"renameAttribute", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_43renameAttribute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_42renameAttribute},
- {"_toma", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_47_toma, METH_O, 0},
- {"_assign_vlen", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_49_assign_vlen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_48_assign_vlen},
- {"assignValue", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_55assignValue, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_54assignValue},
- {"getValue", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_57getValue, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_56getValue},
- {"set_auto_maskandscale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_59set_auto_maskandscale, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_58set_auto_maskandscale},
- {"set_auto_scale", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_61set_auto_scale, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_60set_auto_scale},
- {"set_auto_mask", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_63set_auto_mask, METH_O, __pyx_doc_7netCDF4_8_netCDF4_8Variable_62set_auto_mask},
- {"_put", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_65_put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_64_put},
- {"_get", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_67_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8Variable_66_get},
- {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8Variable_69__reduce__, METH_NOARGS, 0},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_Variable[] = {
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_name, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_name, (char *)"string name of Variable instance", 0},
- {(char *)"datatype", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_datatype, 0, (char *)"numpy data type (for primitive data types) or\n VLType/CompoundType/EnumType instance \n (for compound, vlen or enum data types)", 0},
- {(char *)"shape", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_shape, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_shape, (char *)"find current sizes of all variable dimensions", 0},
- {(char *)"size", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_size, 0, (char *)"Return the number of stored elements.", 0},
- {(char *)"dimensions", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_dimensions, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_dimensions, (char *)"get variables's dimension names", 0},
- {(char *)"_varid", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__varid, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__varid, (char *)0, 0},
- {(char *)"_grpid", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__grpid, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__grpid, (char *)0, 0},
- {(char *)"_nunlimdim", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__nunlimdim, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__nunlimdim, (char *)0, 0},
- {(char *)"_name", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__name, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__name, (char *)0, 0},
- {(char *)"ndim", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_ndim, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_ndim, (char *)0, 0},
- {(char *)"dtype", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_dtype, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_dtype, (char *)0, 0},
- {(char *)"mask", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_mask, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_mask, (char *)0, 0},
- {(char *)"scale", __pyx_getprop_7netCDF4_8_netCDF4_8Variable_scale, __pyx_setprop_7netCDF4_8_netCDF4_8Variable_scale, (char *)0, 0},
- {(char *)"_isprimitive", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__isprimitive, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isprimitive, (char *)0, 0},
- {(char *)"_iscompound", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__iscompound, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__iscompound, (char *)0, 0},
- {(char *)"_isvlen", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__isvlen, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isvlen, (char *)0, 0},
- {(char *)"_isenum", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__isenum, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__isenum, (char *)0, 0},
- {(char *)"_grp", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__grp, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__grp, (char *)0, 0},
- {(char *)"_cmptype", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__cmptype, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__cmptype, (char *)0, 0},
- {(char *)"_vltype", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__vltype, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__vltype, (char *)0, 0},
- {(char *)"_enumtype", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__enumtype, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__enumtype, (char *)0, 0},
- {(char *)"__orthogonal_indexing__", __pyx_getprop_7netCDF4_8_netCDF4_8Variable___orthogonal_indexing__, __pyx_setprop_7netCDF4_8_netCDF4_8Variable___orthogonal_indexing__, (char *)0, 0},
- {(char *)"_has_lsd", __pyx_getprop_7netCDF4_8_netCDF4_8Variable__has_lsd, __pyx_setprop_7netCDF4_8_netCDF4_8Variable__has_lsd, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_Variable = {
- __pyx_pw_7netCDF4_8_netCDF4_8Variable_53__len__, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_7netCDF4_8_netCDF4_Variable, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_Variable = {
- __pyx_pw_7netCDF4_8_netCDF4_8Variable_53__len__, /*mp_length*/
- __pyx_pw_7netCDF4_8_netCDF4_8Variable_45__getitem__, /*mp_subscript*/
- __pyx_mp_ass_subscript_7netCDF4_8_netCDF4_Variable, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_Variable = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.Variable", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_Variable), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_Variable, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_8Variable_5__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_Variable, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_Variable, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- __pyx_tp_getattro_7netCDF4_8_netCDF4_Variable, /*tp_getattro*/
- __pyx_tp_setattro_7netCDF4_8_netCDF4_Variable, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA netCDF `netCDF4.Variable` is used to read and write netCDF data. They are\nanalogous to numpy array objects. See `netCDF4.Variable.__init__` for more\ndetails.\n\nA list of attribute names corresponding to netCDF attributes defined for\nthe variable can be obtained with the `netCDF4.Variable.ncattrs` method. These\nattributes can be created by assigning to an attribute of the\n`netCDF4.Variable` instance. A dictionary containing all the netCDF attribute\nname/value pairs is provi [...]
- __pyx_tp_traverse_7netCDF4_8_netCDF4_Variable, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_Variable, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_Variable, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_Variable, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_8Variable_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_Variable, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_CompoundType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)o);
- p->dtype = Py_None; Py_INCREF(Py_None);
- p->name = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_CompoundType(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->dtype);
- Py_CLEAR(p->name);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_CompoundType(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)o;
- if (p->dtype) {
- e = (*v)(p->dtype, a); if (e) return e;
- }
- if (p->name) {
- e = (*v)(p->name, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_CompoundType(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)o;
- tmp = ((PyObject*)p->dtype);
- p->dtype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->name);
- p->name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_12CompoundType__nc_type(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType__nc_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_12CompoundType_dtype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_12CompoundType_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_CompoundType[] = {
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5__unicode__, METH_NOARGS, 0},
- {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_7__reduce__, METH_NOARGS, 0},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_CompoundType[] = {
- {(char *)"_nc_type", __pyx_getprop_7netCDF4_8_netCDF4_12CompoundType__nc_type, __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType__nc_type, (char *)0, 0},
- {(char *)"dtype", __pyx_getprop_7netCDF4_8_netCDF4_12CompoundType_dtype, __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType_dtype, (char *)0, 0},
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_12CompoundType_name, __pyx_setprop_7netCDF4_8_netCDF4_12CompoundType_name, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_CompoundType = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.CompoundType", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_CompoundType, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_3__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA `netCDF4.CompoundType` instance is used to describe a compound data\ntype, and can be passed to the the `netCDF4.Dataset.createVariable` method of\na `netCDF4.Dataset` or `netCDF4.Group` instance. \nCompound data types map to numpy structured arrays.\nSee `netCDF4.CompoundType.__init__` for more details.\n\nThe instance variables `dtype` and `name` should not be modified by\nthe user.\n ", /*tp_doc*/
- __pyx_tp_traverse_7netCDF4_8_netCDF4_CompoundType, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_CompoundType, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_CompoundType, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_CompoundType, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_CompoundType, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_VLType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_VLType *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)o);
- p->dtype = Py_None; Py_INCREF(Py_None);
- p->name = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_VLType(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_VLType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->dtype);
- Py_CLEAR(p->name);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_VLType(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_VLType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)o;
- if (p->dtype) {
- e = (*v)(p->dtype, a); if (e) return e;
- }
- if (p->name) {
- e = (*v)(p->name, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_VLType(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_VLType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)o;
- tmp = ((PyObject*)p->dtype);
- p->dtype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->name);
- p->name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_6VLType__nc_type(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_6VLType__nc_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_6VLType_dtype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_6VLType_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_6VLType_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_6VLType_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_VLType[] = {
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_6VLType_5__unicode__, METH_NOARGS, 0},
- {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_6VLType_7__reduce__, METH_NOARGS, 0},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_VLType[] = {
- {(char *)"_nc_type", __pyx_getprop_7netCDF4_8_netCDF4_6VLType__nc_type, __pyx_setprop_7netCDF4_8_netCDF4_6VLType__nc_type, (char *)0, 0},
- {(char *)"dtype", __pyx_getprop_7netCDF4_8_netCDF4_6VLType_dtype, __pyx_setprop_7netCDF4_8_netCDF4_6VLType_dtype, (char *)0, 0},
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_6VLType_name, __pyx_setprop_7netCDF4_8_netCDF4_6VLType_name, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_VLType = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.VLType", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_VLType), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_VLType, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_6VLType_3__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA `netCDF4.VLType` instance is used to describe a variable length (VLEN) data\ntype, and can be passed to the the `netCDF4.Dataset.createVariable` method of\na `netCDF4.Dataset` or `netCDF4.Group` instance. See \n`netCDF4.VLType.__init__` for more details.\n\nThe instance variables `dtype` and `name` should not be modified by\nthe user.\n ", /*tp_doc*/
- __pyx_tp_traverse_7netCDF4_8_netCDF4_VLType, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_VLType, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_VLType, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_VLType, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_6VLType_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_VLType, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_EnumType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)o);
- p->dtype = Py_None; Py_INCREF(Py_None);
- p->name = Py_None; Py_INCREF(Py_None);
- p->enum_dict = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4_EnumType(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->dtype);
- Py_CLEAR(p->name);
- Py_CLEAR(p->enum_dict);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4_EnumType(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)o;
- if (p->dtype) {
- e = (*v)(p->dtype, a); if (e) return e;
- }
- if (p->name) {
- e = (*v)(p->name, a); if (e) return e;
- }
- if (p->enum_dict) {
- e = (*v)(p->enum_dict, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4_EnumType(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *p = (struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)o;
- tmp = ((PyObject*)p->dtype);
- p->dtype = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->name);
- p->name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->enum_dict);
- p->enum_dict = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8EnumType__nc_type(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8EnumType__nc_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_3__set__(o, v);
- }
- else {
- PyErr_SetString(PyExc_NotImplementedError, "__del__");
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8EnumType_dtype(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8EnumType_name(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_7netCDF4_8_netCDF4_8EnumType_enum_dict(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_1__get__(o);
-}
-
-static int __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_enum_dict(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_3__set__(o, v);
- }
- else {
- return __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_5__del__(o);
- }
-}
-
-static PyMethodDef __pyx_methods_7netCDF4_8_netCDF4_EnumType[] = {
- {"__unicode__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8EnumType_5__unicode__, METH_NOARGS, 0},
- {"__reduce__", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_8EnumType_7__reduce__, METH_NOARGS, 0},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_7netCDF4_8_netCDF4_EnumType[] = {
- {(char *)"_nc_type", __pyx_getprop_7netCDF4_8_netCDF4_8EnumType__nc_type, __pyx_setprop_7netCDF4_8_netCDF4_8EnumType__nc_type, (char *)0, 0},
- {(char *)"dtype", __pyx_getprop_7netCDF4_8_netCDF4_8EnumType_dtype, __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_dtype, (char *)0, 0},
- {(char *)"name", __pyx_getprop_7netCDF4_8_netCDF4_8EnumType_name, __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_name, (char *)0, 0},
- {(char *)"enum_dict", __pyx_getprop_7netCDF4_8_netCDF4_8EnumType_enum_dict, __pyx_setprop_7netCDF4_8_netCDF4_8EnumType_enum_dict, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4_EnumType = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.EnumType", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4_EnumType, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_7netCDF4_8_netCDF4_8EnumType_3__repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "\nA `netCDF4.EnumType` instance is used to describe an Enum data\ntype, and can be passed to the the `netCDF4.Dataset.createVariable` method of\na `netCDF4.Dataset` or `netCDF4.Group` instance. See \n`netCDF4.EnumType.__init__` for more details.\n\nThe instance variables `dtype`, `name` and `enum_dict` should not be modified by\nthe user.\n ", /*tp_doc*/
- __pyx_tp_traverse_7netCDF4_8_netCDF4_EnumType, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4_EnumType, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_7netCDF4_8_netCDF4_EnumType, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_7netCDF4_8_netCDF4_EnumType, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_7netCDF4_8_netCDF4_8EnumType_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4_EnumType, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *__pyx_freelist_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr[8];
-static int __pyx_freecount_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr = 0;
-
-static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr)))) {
- o = (PyObject*)__pyx_freelist_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr[--__pyx_freecount_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(PyObject *o) {
- struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_k);
- Py_CLEAR(p->__pyx_v_v);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr)))) {
- __pyx_freelist_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr[__pyx_freecount_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)o;
- if (p->__pyx_v_k) {
- e = (*v)(p->__pyx_v_k, a); if (e) return e;
- }
- if (p->__pyx_v_v) {
- e = (*v)(p->__pyx_v_v, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)o;
- tmp = ((PyObject*)p->__pyx_v_k);
- p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_v);
- p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyTypeObject __pyx_type_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr = {
- PyVarObject_HEAD_INIT(0, 0)
- "netCDF4._netCDF4.__pyx_scope_struct__genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr, /*tp_traverse*/
- __pyx_tp_clear_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- #if PY_VERSION_HEX < 0x03020000
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
- #else
- PyModuleDef_HEAD_INIT,
- #endif
- "_netCDF4",
- __pyx_k_Version_1_2_7_Introduction_netc, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
- {&__pyx_kp_s_0m, __pyx_k_0m, sizeof(__pyx_k_0m), 0, 0, 1, 0},
- {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
- {&__pyx_kp_s_1_10, __pyx_k_1_10, sizeof(__pyx_k_1_10), 0, 0, 1, 0},
- {&__pyx_kp_s_1_2_7, __pyx_k_1_2_7, sizeof(__pyx_k_1_2_7), 0, 0, 1, 0},
- {&__pyx_kp_s_4_2_1, __pyx_k_4_2_1, sizeof(__pyx_k_4_2_1), 0, 0, 1, 0},
- {&__pyx_kp_s_4_4_0, __pyx_k_4_4_0, sizeof(__pyx_k_4_4_0), 0, 0, 1, 0},
- {&__pyx_kp_s_4_4_1, __pyx_k_4_4_1, sizeof(__pyx_k_4_4_1), 0, 0, 1, 0},
- {&__pyx_kp_s_4m, __pyx_k_4m, sizeof(__pyx_k_4m), 0, 0, 1, 0},
- {&__pyx_kp_s_A_numpy_dtype_object_describing, __pyx_k_A_numpy_dtype_object_describing, sizeof(__pyx_k_A_numpy_dtype_object_describing), 0, 0, 1, 0},
- {&__pyx_kp_s_A_numpy_dtype_object_describing_2, __pyx_k_A_numpy_dtype_object_describing_2, sizeof(__pyx_k_A_numpy_dtype_object_describing_2), 0, 0, 1, 0},
- {&__pyx_kp_s_A_numpy_dtype_object_describing_3, __pyx_k_A_numpy_dtype_object_describing_3, sizeof(__pyx_k_A_numpy_dtype_object_describing_3), 0, 0, 1, 0},
- {&__pyx_kp_s_A_numpy_integer_dtype_object_des, __pyx_k_A_numpy_integer_dtype_object_des, sizeof(__pyx_k_A_numpy_integer_dtype_object_des), 0, 0, 1, 0},
- {&__pyx_kp_s_A_python_dictionary_describing_t, __pyx_k_A_python_dictionary_describing_t, sizeof(__pyx_k_A_python_dictionary_describing_t), 0, 0, 1, 0},
- {&__pyx_kp_s_A_string_describing_the_name_of, __pyx_k_A_string_describing_the_name_of, sizeof(__pyx_k_A_string_describing_the_name_of), 0, 0, 1, 0},
- {&__pyx_kp_s_A_string_describing_the_name_of_2, __pyx_k_A_string_describing_the_name_of_2, sizeof(__pyx_k_A_string_describing_the_name_of_2), 0, 0, 1, 0},
- {&__pyx_kp_s_A_tuple_containing_the_names_of, __pyx_k_A_tuple_containing_the_names_of, sizeof(__pyx_k_A_tuple_containing_the_names_of), 0, 0, 1, 0},
- {&__pyx_kp_s_A_tuple_with_the_current_shape_l, __pyx_k_A_tuple_with_the_current_shape_l, sizeof(__pyx_k_A_tuple_with_the_current_shape_l), 0, 0, 1, 0},
- {&__pyx_kp_s_Always_True_Indicates_to_client, __pyx_k_Always_True_Indicates_to_client, sizeof(__pyx_k_Always_True_Indicates_to_client), 0, 0, 1, 0},
- {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
- {&__pyx_kp_s_Class_for_reading_multi_file_ne, __pyx_k_Class_for_reading_multi_file_ne, sizeof(__pyx_k_Class_for_reading_multi_file_ne), 0, 0, 1, 0},
- {&__pyx_kp_s_Class_providing_an_interface_to, __pyx_k_Class_providing_an_interface_to, sizeof(__pyx_k_Class_providing_an_interface_to), 0, 0, 1, 0},
- {&__pyx_kp_s_CompoundType_dtype, __pyx_k_CompoundType_dtype, sizeof(__pyx_k_CompoundType_dtype), 0, 0, 1, 0},
- {&__pyx_kp_s_CompoundType_is_not_picklable, __pyx_k_CompoundType_is_not_picklable, sizeof(__pyx_k_CompoundType_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_kp_s_CompoundType_name, __pyx_k_CompoundType_name, sizeof(__pyx_k_CompoundType_name), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_cmptypes, __pyx_k_Dataset_cmptypes, sizeof(__pyx_k_Dataset_cmptypes), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_data_model, __pyx_k_Dataset_data_model, sizeof(__pyx_k_Dataset_data_model), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_dimensions, __pyx_k_Dataset_dimensions, sizeof(__pyx_k_Dataset_dimensions), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_disk_format, __pyx_k_Dataset_disk_format, sizeof(__pyx_k_Dataset_disk_format), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_enumtypes, __pyx_k_Dataset_enumtypes, sizeof(__pyx_k_Dataset_enumtypes), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_file_format, __pyx_k_Dataset_file_format, sizeof(__pyx_k_Dataset_file_format), 0, 0, 1, 0},
- {&__pyx_kp_u_Dataset_get_variables_by_attribu, __pyx_k_Dataset_get_variables_by_attribu, sizeof(__pyx_k_Dataset_get_variables_by_attribu), 0, 1, 0, 0},
- {&__pyx_kp_s_Dataset_groups, __pyx_k_Dataset_groups, sizeof(__pyx_k_Dataset_groups), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_is_not_picklable, __pyx_k_Dataset_is_not_picklable, sizeof(__pyx_k_Dataset_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_keepweakref, __pyx_k_Dataset_keepweakref, sizeof(__pyx_k_Dataset_keepweakref), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_parent, __pyx_k_Dataset_parent, sizeof(__pyx_k_Dataset_parent), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_path, __pyx_k_Dataset_path, sizeof(__pyx_k_Dataset_path), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_variables, __pyx_k_Dataset_variables, sizeof(__pyx_k_Dataset_variables), 0, 0, 1, 0},
- {&__pyx_kp_s_Dataset_vltypes, __pyx_k_Dataset_vltypes, sizeof(__pyx_k_Dataset_vltypes), 0, 0, 1, 0},
- {&__pyx_kp_s_Describes_the_power_of_ten_of_th, __pyx_k_Describes_the_power_of_ten_of_th, sizeof(__pyx_k_Describes_the_power_of_ten_of_th), 0, 0, 1, 0},
- {&__pyx_n_s_Dimension, __pyx_k_Dimension, sizeof(__pyx_k_Dimension), 0, 0, 1, 1},
- {&__pyx_n_s_Dimension___init, __pyx_k_Dimension___init, sizeof(__pyx_k_Dimension___init), 0, 0, 1, 1},
- {&__pyx_n_s_Dimension___len, __pyx_k_Dimension___len, sizeof(__pyx_k_Dimension___len), 0, 0, 1, 1},
- {&__pyx_n_s_Dimension___repr, __pyx_k_Dimension___repr, sizeof(__pyx_k_Dimension___repr), 0, 0, 1, 1},
- {&__pyx_n_s_Dimension_isunlimited, __pyx_k_Dimension_isunlimited, sizeof(__pyx_k_Dimension_isunlimited), 0, 0, 1, 1},
- {&__pyx_kp_s_Dimension_name, __pyx_k_Dimension_name, sizeof(__pyx_k_Dimension_name), 0, 0, 1, 0},
- {&__pyx_kp_s_Dimension_object_no_longer_valid, __pyx_k_Dimension_object_no_longer_valid, sizeof(__pyx_k_Dimension_object_no_longer_valid), 0, 0, 1, 0},
- {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
- {&__pyx_kp_s_EnumType_dtype, __pyx_k_EnumType_dtype, sizeof(__pyx_k_EnumType_dtype), 0, 0, 1, 0},
- {&__pyx_kp_s_EnumType_enum_dict, __pyx_k_EnumType_enum_dict, sizeof(__pyx_k_EnumType_enum_dict), 0, 0, 1, 0},
- {&__pyx_kp_s_EnumType_is_not_picklable, __pyx_k_EnumType_is_not_picklable, sizeof(__pyx_k_EnumType_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_kp_s_EnumType_name, __pyx_k_EnumType_name, sizeof(__pyx_k_EnumType_name), 0, 0, 1, 0},
- {&__pyx_n_s_FillValue, __pyx_k_FillValue, sizeof(__pyx_k_FillValue), 0, 0, 1, 1},
- {&__pyx_kp_s_FillValue_attribute_must_be_set, __pyx_k_FillValue_attribute_must_be_set, sizeof(__pyx_k_FillValue_attribute_must_be_set), 0, 0, 1, 0},
- {&__pyx_kp_s_Group_name, __pyx_k_Group_name, sizeof(__pyx_k_Group_name), 0, 0, 1, 0},
- {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
- {&__pyx_kp_s_If_True_child_Dimension_and_Vari, __pyx_k_If_True_child_Dimension_and_Vari, sizeof(__pyx_k_If_True_child_Dimension_and_Vari), 0, 0, 1, 0},
- {&__pyx_kp_s_If_True_data_is_automatically_co, __pyx_k_If_True_data_is_automatically_co, sizeof(__pyx_k_If_True_data_is_automatically_co), 0, 0, 1, 0},
- {&__pyx_kp_s_Illegal_index, __pyx_k_Illegal_index, sizeof(__pyx_k_Illegal_index), 0, 0, 1, 0},
- {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
- {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
- {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset, __pyx_k_MFDataset, sizeof(__pyx_k_MFDataset), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset___getattribute, __pyx_k_MFDataset___getattribute, sizeof(__pyx_k_MFDataset___getattribute), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset___init, __pyx_k_MFDataset___init, sizeof(__pyx_k_MFDataset___init), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset___reduce, __pyx_k_MFDataset___reduce, sizeof(__pyx_k_MFDataset___reduce), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset___repr, __pyx_k_MFDataset___repr, sizeof(__pyx_k_MFDataset___repr), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset___setattr, __pyx_k_MFDataset___setattr, sizeof(__pyx_k_MFDataset___setattr), 0, 0, 1, 1},
- {&__pyx_n_s_MFDataset_close, __pyx_k_MFDataset_close, sizeof(__pyx_k_MFDataset_close), 0, 0, 1, 1},
- {&__pyx_kp_s_MFDataset_is_not_picklable, __pyx_k_MFDataset_is_not_picklable, sizeof(__pyx_k_MFDataset_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_n_s_MFDataset_ncattrs, __pyx_k_MFDataset_ncattrs, sizeof(__pyx_k_MFDataset_ncattrs), 0, 0, 1, 1},
- {&__pyx_kp_s_MFNetCDF4_only_works_with_NETCDF, __pyx_k_MFNetCDF4_only_works_with_NETCDF, sizeof(__pyx_k_MFNetCDF4_only_works_with_NETCDF), 0, 0, 1, 0},
- {&__pyx_n_s_MFTime, __pyx_k_MFTime, sizeof(__pyx_k_MFTime), 0, 0, 1, 1},
- {&__pyx_n_s_MFTime___getitem, __pyx_k_MFTime___getitem, sizeof(__pyx_k_MFTime___getitem), 0, 0, 1, 1},
- {&__pyx_n_s_MFTime___init, __pyx_k_MFTime___init, sizeof(__pyx_k_MFTime___init), 0, 0, 1, 1},
- {&__pyx_n_s_MFTime__delta, __pyx_k_MFTime__delta, sizeof(__pyx_k_MFTime__delta), 0, 0, 1, 1},
- {&__pyx_n_s_MFTime__time, __pyx_k_MFTime__time, sizeof(__pyx_k_MFTime__time), 0, 0, 1, 1},
- {&__pyx_kp_s_MFTime_requires_that_the_same_ti, __pyx_k_MFTime_requires_that_the_same_ti, sizeof(__pyx_k_MFTime_requires_that_the_same_ti), 0, 0, 1, 0},
- {&__pyx_kp_s_MFTime_requires_that_the_time_va, __pyx_k_MFTime_requires_that_the_time_va, sizeof(__pyx_k_MFTime_requires_that_the_time_va), 0, 0, 1, 0},
- {&__pyx_n_s_MINYEAR, __pyx_k_MINYEAR, sizeof(__pyx_k_MINYEAR), 0, 0, 1, 1},
- {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
- {&__pyx_n_s_NC_DISKLESS, __pyx_k_NC_DISKLESS, sizeof(__pyx_k_NC_DISKLESS), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF3, __pyx_k_NETCDF3, sizeof(__pyx_k_NETCDF3), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF3_64BIT, __pyx_k_NETCDF3_64BIT, sizeof(__pyx_k_NETCDF3_64BIT), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF3_64BIT_OFFSET, __pyx_k_NETCDF3_64BIT_OFFSET, sizeof(__pyx_k_NETCDF3_64BIT_OFFSET), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF3_CLASSIC, __pyx_k_NETCDF3_CLASSIC, sizeof(__pyx_k_NETCDF3_CLASSIC), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF4, __pyx_k_NETCDF4, sizeof(__pyx_k_NETCDF4), 0, 0, 1, 1},
- {&__pyx_n_s_NETCDF4_CLASSIC, __pyx_k_NETCDF4_CLASSIC, sizeof(__pyx_k_NETCDF4_CLASSIC), 0, 0, 1, 1},
- {&__pyx_n_s_NUMCHARS, __pyx_k_NUMCHARS, sizeof(__pyx_k_NUMCHARS), 0, 0, 1, 1},
- {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
- {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1},
- {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
- {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
- {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
- {&__pyx_n_s_S1, __pyx_k_S1, sizeof(__pyx_k_S1), 0, 0, 1, 1},
- {&__pyx_n_s_StartCountStride, __pyx_k_StartCountStride, sizeof(__pyx_k_StartCountStride), 0, 0, 1, 1},
- {&__pyx_kp_s_String_name, __pyx_k_String_name, sizeof(__pyx_k_String_name), 0, 0, 1, 0},
- {&__pyx_kp_s_The_cmptypes_dictionary_maps_the, __pyx_k_The_cmptypes_dictionary_maps_the, sizeof(__pyx_k_The_cmptypes_dictionary_maps_the), 0, 0, 1, 0},
- {&__pyx_kp_s_The_dimensions_dictionary_maps_t, __pyx_k_The_dimensions_dictionary_maps_t, sizeof(__pyx_k_The_dimensions_dictionary_maps_t), 0, 0, 1, 0},
- {&__pyx_kp_s_The_enumtypes_dictionary_maps_th, __pyx_k_The_enumtypes_dictionary_maps_th, sizeof(__pyx_k_The_enumtypes_dictionary_maps_th), 0, 0, 1, 0},
- {&__pyx_kp_s_The_groups_dictionary_maps_the_n, __pyx_k_The_groups_dictionary_maps_the_n, sizeof(__pyx_k_The_groups_dictionary_maps_the_n), 0, 0, 1, 0},
- {&__pyx_kp_s_The_number_of_stored_elements, __pyx_k_The_number_of_stored_elements, sizeof(__pyx_k_The_number_of_stored_elements), 0, 0, 1, 0},
- {&__pyx_kp_s_The_number_of_variable_dimension, __pyx_k_The_number_of_variable_dimension, sizeof(__pyx_k_The_number_of_variable_dimension), 0, 0, 1, 0},
- {&__pyx_kp_s_The_variables_dictionary_maps_th, __pyx_k_The_variables_dictionary_maps_th, sizeof(__pyx_k_The_variables_dictionary_maps_th), 0, 0, 1, 0},
- {&__pyx_kp_s_The_vltypes_dictionary_maps_the, __pyx_k_The_vltypes_dictionary_maps_the, sizeof(__pyx_k_The_vltypes_dictionary_maps_the), 0, 0, 1, 0},
- {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
- {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
- {&__pyx_n_s_UNDEFINED, __pyx_k_UNDEFINED, sizeof(__pyx_k_UNDEFINED), 0, 0, 1, 1},
- {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1},
- {&__pyx_n_s_UnicodeError, __pyx_k_UnicodeError, sizeof(__pyx_k_UnicodeError), 0, 0, 1, 1},
- {&__pyx_kp_s_Unsupported_compound_type_elemen, __pyx_k_Unsupported_compound_type_elemen, sizeof(__pyx_k_Unsupported_compound_type_elemen), 0, 0, 1, 0},
- {&__pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_k_Users_jswhit_python_netcdf4_pyt, sizeof(__pyx_k_Users_jswhit_python_netcdf4_pyt), 0, 0, 1, 0},
- {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1},
- {&__pyx_kp_s_VLType_dtype, __pyx_k_VLType_dtype, sizeof(__pyx_k_VLType_dtype), 0, 0, 1, 0},
- {&__pyx_kp_s_VLType_is_not_picklable, __pyx_k_VLType_is_not_picklable, sizeof(__pyx_k_VLType_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_kp_s_VLType_name, __pyx_k_VLType_name, sizeof(__pyx_k_VLType_name), 0, 0, 1, 0},
- {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
- {&__pyx_n_s_Variable, __pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 0, 1, 1},
- {&__pyx_n_s_Variable___getattr, __pyx_k_Variable___getattr, sizeof(__pyx_k_Variable___getattr), 0, 0, 1, 1},
- {&__pyx_n_s_Variable___getitem, __pyx_k_Variable___getitem, sizeof(__pyx_k_Variable___getitem), 0, 0, 1, 1},
- {&__pyx_n_s_Variable___init, __pyx_k_Variable___init, sizeof(__pyx_k_Variable___init), 0, 0, 1, 1},
- {&__pyx_n_s_Variable___len, __pyx_k_Variable___len, sizeof(__pyx_k_Variable___len), 0, 0, 1, 1},
- {&__pyx_kp_s_Variable___orthogonal_indexing, __pyx_k_Variable___orthogonal_indexing, sizeof(__pyx_k_Variable___orthogonal_indexing), 0, 0, 1, 0},
- {&__pyx_n_s_Variable___repr, __pyx_k_Variable___repr, sizeof(__pyx_k_Variable___repr), 0, 0, 1, 1},
- {&__pyx_n_s_Variable__shape, __pyx_k_Variable__shape, sizeof(__pyx_k_Variable__shape), 0, 0, 1, 1},
- {&__pyx_kp_s_Variable_datatype, __pyx_k_Variable_datatype, sizeof(__pyx_k_Variable_datatype), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_dimensions, __pyx_k_Variable_dimensions, sizeof(__pyx_k_Variable_dimensions), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_dtype, __pyx_k_Variable_dtype, sizeof(__pyx_k_Variable_dtype), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_is_not_picklable, __pyx_k_Variable_is_not_picklable, sizeof(__pyx_k_Variable_is_not_picklable), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_least_significant_digit, __pyx_k_Variable_least_significant_digit, sizeof(__pyx_k_Variable_least_significant_digit), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_length_strings_are_only, __pyx_k_Variable_length_strings_are_only, sizeof(__pyx_k_Variable_length_strings_are_only), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_mask, __pyx_k_Variable_mask, sizeof(__pyx_k_Variable_mask), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_name, __pyx_k_Variable_name, sizeof(__pyx_k_Variable_name), 0, 0, 1, 0},
- {&__pyx_n_s_Variable_ncattrs, __pyx_k_Variable_ncattrs, sizeof(__pyx_k_Variable_ncattrs), 0, 0, 1, 1},
- {&__pyx_kp_s_Variable_ndim, __pyx_k_Variable_ndim, sizeof(__pyx_k_Variable_ndim), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_object_no_longer_valid, __pyx_k_Variable_object_no_longer_valid, sizeof(__pyx_k_Variable_object_no_longer_valid), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_scale, __pyx_k_Variable_scale, sizeof(__pyx_k_Variable_scale), 0, 0, 1, 0},
- {&__pyx_n_s_Variable_set_auto_mask, __pyx_k_Variable_set_auto_mask, sizeof(__pyx_k_Variable_set_auto_mask), 0, 0, 1, 1},
- {&__pyx_n_s_Variable_set_auto_maskandscale, __pyx_k_Variable_set_auto_maskandscale, sizeof(__pyx_k_Variable_set_auto_maskandscale), 0, 0, 1, 1},
- {&__pyx_n_s_Variable_set_auto_scale, __pyx_k_Variable_set_auto_scale, sizeof(__pyx_k_Variable_set_auto_scale), 0, 0, 1, 1},
- {&__pyx_kp_s_Variable_shape, __pyx_k_Variable_shape, sizeof(__pyx_k_Variable_shape), 0, 0, 1, 0},
- {&__pyx_kp_s_Variable_size, __pyx_k_Variable_size, sizeof(__pyx_k_Variable_size), 0, 0, 1, 0},
- {&__pyx_n_s_Variable_typecode, __pyx_k_Variable_typecode, sizeof(__pyx_k_Variable_typecode), 0, 0, 1, 1},
- {&__pyx_kp_s_WARNING_Backwards_incompatible, __pyx_k_WARNING_Backwards_incompatible, sizeof(__pyx_k_WARNING_Backwards_incompatible), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_unsupported_Compound_typ, __pyx_k_WARNING_unsupported_Compound_typ, sizeof(__pyx_k_WARNING_unsupported_Compound_typ), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_unsupported_Enum_type_sk, __pyx_k_WARNING_unsupported_Enum_type_sk, sizeof(__pyx_k_WARNING_unsupported_Enum_type_sk), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_unsupported_VLEN_type_sk, __pyx_k_WARNING_unsupported_VLEN_type_sk, sizeof(__pyx_k_WARNING_unsupported_VLEN_type_sk), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_variable_s_has_unsupport, __pyx_k_WARNING_variable_s_has_unsupport, sizeof(__pyx_k_WARNING_variable_s_has_unsupport), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_variable_s_has_unsupport_2, __pyx_k_WARNING_variable_s_has_unsupport_2, sizeof(__pyx_k_WARNING_variable_s_has_unsupport_2), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_variable_s_has_unsupport_3, __pyx_k_WARNING_variable_s_has_unsupport_3, sizeof(__pyx_k_WARNING_variable_s_has_unsupport_3), 0, 0, 1, 0},
- {&__pyx_kp_s_WARNING_variable_s_has_unsupport_4, __pyx_k_WARNING_variable_s_has_unsupport_4, sizeof(__pyx_k_WARNING_variable_s_has_unsupport_4), 0, 0, 1, 0},
- {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
- {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
- {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
- {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0},
- {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
- {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0},
- {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
- {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
- {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0},
- {&__pyx_n_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 1},
- {&__pyx_kp_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 0},
- {&__pyx_kp_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 0},
- {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
- {&__pyx_n_s_add_offset, __pyx_k_add_offset, sizeof(__pyx_k_add_offset), 0, 0, 1, 1},
- {&__pyx_n_s_aggDimId, __pyx_k_aggDimId, sizeof(__pyx_k_aggDimId), 0, 0, 1, 1},
- {&__pyx_n_s_aggDimName, __pyx_k_aggDimName, sizeof(__pyx_k_aggDimName), 0, 0, 1, 1},
- {&__pyx_n_s_aggdim, __pyx_k_aggdim, sizeof(__pyx_k_aggdim), 0, 0, 1, 1},
- {&__pyx_kp_s_aggregation_variable_s_not_defin, __pyx_k_aggregation_variable_s_not_defin, sizeof(__pyx_k_aggregation_variable_s_not_defin), 0, 0, 1, 0},
- {&__pyx_n_s_align, __pyx_k_align, sizeof(__pyx_k_align), 0, 0, 1, 1},
- {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
- {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
- {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
- {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
- {&__pyx_n_s_around, __pyx_k_around, sizeof(__pyx_k_around), 0, 0, 1, 1},
- {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1},
- {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
- {&__pyx_n_s_as, __pyx_k_as, sizeof(__pyx_k_as), 0, 0, 1, 1},
- {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
- {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
- {&__pyx_n_s_assign_vlen, __pyx_k_assign_vlen, sizeof(__pyx_k_assign_vlen), 0, 0, 1, 1},
- {&__pyx_kp_s_assign_vlen_method_only_for_use, __pyx_k_assign_vlen_method_only_for_use, sizeof(__pyx_k_assign_vlen_method_only_for_use), 0, 0, 1, 0},
- {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
- {&__pyx_kp_s_attribute_s_has_unsupported_data, __pyx_k_attribute_s_has_unsupported_data, sizeof(__pyx_k_attribute_s_has_unsupported_data), 0, 0, 1, 0},
- {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
- {&__pyx_n_s_atype, __pyx_k_atype, sizeof(__pyx_k_atype), 0, 0, 1, 1},
- {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
- {&__pyx_n_s_basedate, __pyx_k_basedate, sizeof(__pyx_k_basedate), 0, 0, 1, 1},
- {&__pyx_n_s_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 0, 1, 1},
- {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
- {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
- {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
- {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1},
- {&__pyx_n_s_bytestr, __pyx_k_bytestr, sizeof(__pyx_k_bytestr), 0, 0, 1, 1},
- {&__pyx_n_s_byteswap, __pyx_k_byteswap, sizeof(__pyx_k_byteswap), 0, 0, 1, 1},
- {&__pyx_n_s_calendar, __pyx_k_calendar, sizeof(__pyx_k_calendar), 0, 0, 1, 1},
- {&__pyx_kp_s_cannot_assign_fill_value_for_mas, __pyx_k_cannot_assign_fill_value_for_mas, sizeof(__pyx_k_cannot_assign_fill_value_for_mas), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_close_a_netCDF4_Group_onl, __pyx_k_cannot_close_a_netCDF4_Group_onl, sizeof(__pyx_k_cannot_close_a_netCDF4_Group_onl), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_find_compound_type_in_thi, __pyx_k_cannot_find_compound_type_in_thi, sizeof(__pyx_k_cannot_find_compound_type_in_thi), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_set__FillValue_attribute, __pyx_k_cannot_set__FillValue_attribute, sizeof(__pyx_k_cannot_set__FillValue_attribute), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_specify_chunksizes_for_a, __pyx_k_cannot_specify_chunksizes_for_a, sizeof(__pyx_k_cannot_specify_chunksizes_for_a), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_use_utc_offset_for_refere, __pyx_k_cannot_use_utc_offset_for_refere, sizeof(__pyx_k_cannot_use_utc_offset_for_refere), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_using_file_globbing_for_r, __pyx_k_cannot_using_file_globbing_for_r, sizeof(__pyx_k_cannot_using_file_globbing_for_r), 0, 0, 1, 0},
- {&__pyx_n_s_cdf, __pyx_k_cdf, sizeof(__pyx_k_cdf), 0, 0, 1, 1},
- {&__pyx_n_s_cdfRecVar, __pyx_k_cdfRecVar, sizeof(__pyx_k_cdfRecVar), 0, 0, 1, 1},
- {&__pyx_n_s_cdfRecVar_2, __pyx_k_cdfRecVar_2, sizeof(__pyx_k_cdfRecVar_2), 0, 0, 1, 1},
- {&__pyx_n_s_cdfTLen, __pyx_k_cdfTLen, sizeof(__pyx_k_cdfTLen), 0, 0, 1, 1},
- {&__pyx_n_s_cdfVLen, __pyx_k_cdfVLen, sizeof(__pyx_k_cdfVLen), 0, 0, 1, 1},
- {&__pyx_n_s_cdfVLen_2, __pyx_k_cdfVLen_2, sizeof(__pyx_k_cdfVLen_2), 0, 0, 1, 1},
- {&__pyx_n_s_cdf_2, __pyx_k_cdf_2, sizeof(__pyx_k_cdf_2), 0, 0, 1, 1},
- {&__pyx_n_s_cdfm, __pyx_k_cdfm, sizeof(__pyx_k_cdfm), 0, 0, 1, 1},
- {&__pyx_n_s_cdftime, __pyx_k_cdftime, sizeof(__pyx_k_cdftime), 0, 0, 1, 1},
- {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
- {&__pyx_n_s_chartostring, __pyx_k_chartostring, sizeof(__pyx_k_chartostring), 0, 0, 1, 1},
- {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
- {&__pyx_n_s_chunk_cache, __pyx_k_chunk_cache, sizeof(__pyx_k_chunk_cache), 0, 0, 1, 1},
- {&__pyx_kp_s_chunksize_cannot_exceed_dimensio, __pyx_k_chunksize_cannot_exceed_dimensio, sizeof(__pyx_k_chunksize_cannot_exceed_dimensio), 0, 0, 1, 0},
- {&__pyx_n_s_chunksizes, __pyx_k_chunksizes, sizeof(__pyx_k_chunksizes), 0, 0, 1, 1},
- {&__pyx_kp_s_chunksizes_must_be_a_sequence_wi, __pyx_k_chunksizes_must_be_a_sequence_wi, sizeof(__pyx_k_chunksizes_must_be_a_sequence_wi), 0, 0, 1, 0},
- {&__pyx_n_s_clobber, __pyx_k_clobber, sizeof(__pyx_k_clobber), 0, 0, 1, 1},
- {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
- {&__pyx_n_s_cmptype, __pyx_k_cmptype, sizeof(__pyx_k_cmptype), 0, 0, 1, 1},
- {&__pyx_n_s_cmptypes, __pyx_k_cmptypes, sizeof(__pyx_k_cmptypes), 0, 0, 1, 1},
- {&__pyx_n_s_cnt, __pyx_k_cnt, sizeof(__pyx_k_cnt), 0, 0, 1, 1},
- {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
- {&__pyx_n_s_complevel, __pyx_k_complevel, sizeof(__pyx_k_complevel), 0, 0, 1, 1},
- {&__pyx_n_s_compound, __pyx_k_compound, sizeof(__pyx_k_compound), 0, 0, 1, 1},
- {&__pyx_kp_s_compound_data_type_s, __pyx_k_compound_data_type_s, sizeof(__pyx_k_compound_data_type_s), 0, 0, 1, 0},
- {&__pyx_kp_s_compound_field_of_an_unsupported, __pyx_k_compound_field_of_an_unsupported, sizeof(__pyx_k_compound_field_of_an_unsupported), 0, 0, 1, 0},
- {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1},
- {&__pyx_n_s_contiguous, __pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 0, 1, 1},
- {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
- {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
- {&__pyx_n_s_createGroup, __pyx_k_createGroup, sizeof(__pyx_k_createGroup), 0, 0, 1, 1},
- {&__pyx_kp_s_created_using_fill_value_keyword, __pyx_k_created_using_fill_value_keyword, sizeof(__pyx_k_created_using_fill_value_keyword), 0, 0, 1, 0},
- {&__pyx_kp_s_current_shape_s, __pyx_k_current_shape_s, sizeof(__pyx_k_current_shape_s), 0, 0, 1, 0},
- {&__pyx_kp_s_current_size_s, __pyx_k_current_size_s, sizeof(__pyx_k_current_size_s), 0, 0, 1, 0},
- {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
- {&__pyx_kp_s_d_d_d, __pyx_k_d_d_d, sizeof(__pyx_k_d_d_d), 0, 0, 1, 0},
- {&__pyx_kp_s_d_d_d_s, __pyx_k_d_d_d_s, sizeof(__pyx_k_d_d_d_s), 0, 0, 1, 0},
- {&__pyx_n_s_dat, __pyx_k_dat, sizeof(__pyx_k_dat), 0, 0, 1, 1},
- {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
- {&__pyx_kp_s_data_can_only_be_assigned_to_VLE, __pyx_k_data_can_only_be_assigned_to_VLE, sizeof(__pyx_k_data_can_only_be_assigned_to_VLE), 0, 0, 1, 0},
- {&__pyx_n_s_data_model, __pyx_k_data_model, sizeof(__pyx_k_data_model), 0, 0, 1, 1},
- {&__pyx_n_s_data_model_2, __pyx_k_data_model_2, sizeof(__pyx_k_data_model_2), 0, 0, 1, 1},
- {&__pyx_kp_s_data_model_describes_the_netCDF, __pyx_k_data_model_describes_the_netCDF, sizeof(__pyx_k_data_model_describes_the_netCDF), 0, 0, 1, 0},
- {&__pyx_kp_s_data_to_put_in_string_variable_m, __pyx_k_data_to_put_in_string_variable_m, sizeof(__pyx_k_data_to_put_in_string_variable_m), 0, 0, 1, 0},
- {&__pyx_n_s_datashape, __pyx_k_datashape, sizeof(__pyx_k_datashape), 0, 0, 1, 1},
- {&__pyx_n_s_datatype, __pyx_k_datatype, sizeof(__pyx_k_datatype), 0, 0, 1, 1},
- {&__pyx_n_s_datatype_name, __pyx_k_datatype_name, sizeof(__pyx_k_datatype_name), 0, 0, 1, 1},
- {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
- {&__pyx_n_s_date2index, __pyx_k_date2index, sizeof(__pyx_k_date2index), 0, 0, 1, 1},
- {&__pyx_n_s_date2num, __pyx_k_date2num, sizeof(__pyx_k_date2num), 0, 0, 1, 1},
- {&__pyx_n_s_dateparse, __pyx_k_dateparse, sizeof(__pyx_k_dateparse), 0, 0, 1, 1},
- {&__pyx_n_s_dates, __pyx_k_dates, sizeof(__pyx_k_dates), 0, 0, 1, 1},
- {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
- {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
- {&__pyx_n_s_day_units, __pyx_k_day_units, sizeof(__pyx_k_day_units), 0, 0, 1, 1},
- {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
- {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
- {&__pyx_n_s_default_encoding, __pyx_k_default_encoding, sizeof(__pyx_k_default_encoding), 0, 0, 1, 1},
- {&__pyx_n_s_default_fillvals, __pyx_k_default_fillvals, sizeof(__pyx_k_default_fillvals), 0, 0, 1, 1},
- {&__pyx_n_s_delncattr, __pyx_k_delncattr, sizeof(__pyx_k_delncattr), 0, 0, 1, 1},
- {&__pyx_kp_s_development, __pyx_k_development, sizeof(__pyx_k_development), 0, 0, 1, 0},
- {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
- {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
- {&__pyx_kp_s_dimension_s_not_defined_in_group, __pyx_k_dimension_s_not_defined_in_group, sizeof(__pyx_k_dimension_s_not_defined_in_group), 0, 0, 1, 0},
- {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1},
- {&__pyx_kp_s_dimensions_cannot_be_altered, __pyx_k_dimensions_cannot_be_altered, sizeof(__pyx_k_dimensions_cannot_be_altered), 0, 0, 1, 0},
- {&__pyx_kp_s_dimensions_s, __pyx_k_dimensions_s, sizeof(__pyx_k_dimensions_s), 0, 0, 1, 0},
- {&__pyx_kp_s_dimensions_sizes_s, __pyx_k_dimensions_sizes_s, sizeof(__pyx_k_dimensions_sizes_s), 0, 0, 1, 0},
- {&__pyx_n_s_dimid, __pyx_k_dimid, sizeof(__pyx_k_dimid), 0, 0, 1, 1},
- {&__pyx_n_s_dimlens, __pyx_k_dimlens, sizeof(__pyx_k_dimlens), 0, 0, 1, 1},
- {&__pyx_n_s_dimname, __pyx_k_dimname, sizeof(__pyx_k_dimname), 0, 0, 1, 1},
- {&__pyx_n_s_dimnames, __pyx_k_dimnames, sizeof(__pyx_k_dimnames), 0, 0, 1, 1},
- {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
- {&__pyx_n_s_dims_2, __pyx_k_dims_2, sizeof(__pyx_k_dims_2), 0, 0, 1, 1},
- {&__pyx_n_s_dimtotlen, __pyx_k_dimtotlen, sizeof(__pyx_k_dimtotlen), 0, 0, 1, 1},
- {&__pyx_n_s_disk_format, __pyx_k_disk_format, sizeof(__pyx_k_disk_format), 0, 0, 1, 1},
- {&__pyx_n_s_disk_format_2, __pyx_k_disk_format_2, sizeof(__pyx_k_disk_format_2), 0, 0, 1, 1},
- {&__pyx_kp_s_disk_format_describes_the_under, __pyx_k_disk_format_describes_the_under, sizeof(__pyx_k_disk_format_describes_the_under), 0, 0, 1, 0},
- {&__pyx_n_s_diskless, __pyx_k_diskless, sizeof(__pyx_k_diskless), 0, 0, 1, 1},
- {&__pyx_kp_s_diskless_mode_requires_netcdf_li, __pyx_k_diskless_mode_requires_netcdf_li, sizeof(__pyx_k_diskless_mode_requires_netcdf_li), 0, 0, 1, 0},
- {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
- {&__pyx_n_s_dset, __pyx_k_dset, sizeof(__pyx_k_dset), 0, 0, 1, 1},
- {&__pyx_n_s_dset_2, __pyx_k_dset_2, sizeof(__pyx_k_dset_2), 0, 0, 1, 1},
- {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
- {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
- {&__pyx_kp_s_dtype_must_string_or_unicode_S_o, __pyx_k_dtype_must_string_or_unicode_S_o, sizeof(__pyx_k_dtype_must_string_or_unicode_S_o), 0, 0, 1, 0},
- {&__pyx_n_s_dtype_name, __pyx_k_dtype_name, sizeof(__pyx_k_dtype_name), 0, 0, 1, 1},
- {&__pyx_n_s_elem, __pyx_k_elem, sizeof(__pyx_k_elem), 0, 0, 1, 1},
- {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
- {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
- {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
- {&__pyx_n_s_enddef, __pyx_k_enddef, sizeof(__pyx_k_enddef), 0, 0, 1, 1},
- {&__pyx_n_s_endian, __pyx_k_endian, sizeof(__pyx_k_endian), 0, 0, 1, 1},
- {&__pyx_kp_s_endian_keyword_argument_must_be, __pyx_k_endian_keyword_argument_must_be, sizeof(__pyx_k_endian_keyword_argument_must_be), 0, 0, 1, 0},
- {&__pyx_kp_s_endian_ness_of_dtype_and_endian, __pyx_k_endian_ness_of_dtype_and_endian, sizeof(__pyx_k_endian_ness_of_dtype_and_endian), 0, 0, 1, 0},
- {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
- {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
- {&__pyx_kp_s_enum_data_type_s, __pyx_k_enum_data_type_s, sizeof(__pyx_k_enum_data_type_s), 0, 0, 1, 0},
- {&__pyx_n_s_enum_dict, __pyx_k_enum_dict, sizeof(__pyx_k_enum_dict), 0, 0, 1, 1},
- {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
- {&__pyx_n_s_enumtype, __pyx_k_enumtype, sizeof(__pyx_k_enumtype), 0, 0, 1, 1},
- {&__pyx_n_s_enumtypes, __pyx_k_enumtypes, sizeof(__pyx_k_enumtypes), 0, 0, 1, 1},
- {&__pyx_n_s_exact, __pyx_k_exact, sizeof(__pyx_k_exact), 0, 0, 1, 1},
- {&__pyx_n_s_exclude, __pyx_k_exclude, sizeof(__pyx_k_exclude), 0, 0, 1, 1},
- {&__pyx_n_s_extDims, __pyx_k_extDims, sizeof(__pyx_k_extDims), 0, 0, 1, 1},
- {&__pyx_n_s_extShape, __pyx_k_extShape, sizeof(__pyx_k_extShape), 0, 0, 1, 1},
- {&__pyx_n_s_extType, __pyx_k_extType, sizeof(__pyx_k_extType), 0, 0, 1, 1},
- {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
- {&__pyx_n_s_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 0, 1, 1},
- {&__pyx_kp_s_f4_2, __pyx_k_f4_2, sizeof(__pyx_k_f4_2), 0, 0, 1, 0},
- {&__pyx_kp_s_f4_3, __pyx_k_f4_3, sizeof(__pyx_k_f4_3), 0, 0, 1, 0},
- {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1},
- {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
- {&__pyx_n_s_file_format, __pyx_k_file_format, sizeof(__pyx_k_file_format), 0, 0, 1, 1},
- {&__pyx_n_s_file_format_2, __pyx_k_file_format_2, sizeof(__pyx_k_file_format_2), 0, 0, 1, 1},
- {&__pyx_kp_s_file_format_does_not_support_NC, __pyx_k_file_format_does_not_support_NC, sizeof(__pyx_k_file_format_does_not_support_NC), 0, 0, 1, 0},
- {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
- {&__pyx_kp_s_filepath_method_not_enabled_To, __pyx_k_filepath_method_not_enabled_To, sizeof(__pyx_k_filepath_method_not_enabled_To), 0, 0, 1, 0},
- {&__pyx_n_s_files, __pyx_k_files, sizeof(__pyx_k_files), 0, 0, 1, 1},
- {&__pyx_n_s_files_2, __pyx_k_files_2, sizeof(__pyx_k_files_2), 0, 0, 1, 1},
- {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1},
- {&__pyx_n_s_filled, __pyx_k_filled, sizeof(__pyx_k_filled), 0, 0, 1, 1},
- {&__pyx_kp_s_filling_off, __pyx_k_filling_off, sizeof(__pyx_k_filling_off), 0, 0, 1, 0},
- {&__pyx_kp_s_filling_on, __pyx_k_filling_on, sizeof(__pyx_k_filling_on), 0, 0, 1, 0},
- {&__pyx_kp_s_filling_on_default__FillValue_of, __pyx_k_filling_on_default__FillValue_of, sizeof(__pyx_k_filling_on_default__FillValue_of), 0, 0, 1, 0},
- {&__pyx_kp_s_filling_on_default__FillValue_of_2, __pyx_k_filling_on_default__FillValue_of_2, sizeof(__pyx_k_filling_on_default__FillValue_of_2), 0, 0, 1, 0},
- {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
- {&__pyx_n_s_find_dim, __pyx_k_find_dim, sizeof(__pyx_k_find_dim), 0, 0, 1, 1},
- {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
- {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
- {&__pyx_n_s_fletcher32, __pyx_k_fletcher32, sizeof(__pyx_k_fletcher32), 0, 0, 1, 1},
- {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
- {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
- {&__pyx_n_s_format_dict, __pyx_k_format_dict, sizeof(__pyx_k_format_dict), 0, 0, 1, 1},
- {&__pyx_kp_s_format_not_supported_by_python_i, __pyx_k_format_not_supported_by_python_i, sizeof(__pyx_k_format_not_supported_by_python_i), 0, 0, 1, 0},
- {&__pyx_n_s_formats, __pyx_k_formats, sizeof(__pyx_k_formats), 0, 0, 1, 1},
- {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
- {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
- {&__pyx_n_s_get_var_chunk_cache, __pyx_k_get_var_chunk_cache, sizeof(__pyx_k_get_var_chunk_cache), 0, 0, 1, 1},
- {&__pyx_kp_u_get_variables_by_attribute_self, __pyx_k_get_variables_by_attribute_self, sizeof(__pyx_k_get_variables_by_attribute_self), 0, 1, 0, 0},
- {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
- {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1},
- {&__pyx_n_s_getdims, __pyx_k_getdims, sizeof(__pyx_k_getdims), 0, 0, 1, 1},
- {&__pyx_n_s_gethdf5libversion, __pyx_k_gethdf5libversion, sizeof(__pyx_k_gethdf5libversion), 0, 0, 1, 1},
- {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
- {&__pyx_n_s_getlibversion, __pyx_k_getlibversion, sizeof(__pyx_k_getlibversion), 0, 0, 1, 1},
- {&__pyx_n_s_getname, __pyx_k_getname, sizeof(__pyx_k_getname), 0, 0, 1, 1},
- {&__pyx_n_s_getncattr, __pyx_k_getncattr, sizeof(__pyx_k_getncattr), 0, 0, 1, 1},
- {&__pyx_n_s_glob, __pyx_k_glob, sizeof(__pyx_k_glob), 0, 0, 1, 1},
- {&__pyx_n_s_gregorian, __pyx_k_gregorian, sizeof(__pyx_k_gregorian), 0, 0, 1, 1},
- {&__pyx_kp_s_group_s, __pyx_k_group_s, sizeof(__pyx_k_group_s), 0, 0, 1, 0},
- {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
- {&__pyx_kp_s_groups_s, __pyx_k_groups_s, sizeof(__pyx_k_groups_s), 0, 0, 1, 0},
- {&__pyx_kp_s_groups_s_2, __pyx_k_groups_s_2, sizeof(__pyx_k_groups_s_2), 0, 0, 1, 0},
- {&__pyx_n_s_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 0, 1, 1},
- {&__pyx_n_s_grp_2, __pyx_k_grp_2, sizeof(__pyx_k_grp_2), 0, 0, 1, 1},
- {&__pyx_n_s_grpid, __pyx_k_grpid, sizeof(__pyx_k_grpid), 0, 0, 1, 1},
- {&__pyx_n_s_grpnames, __pyx_k_grpnames, sizeof(__pyx_k_grpnames), 0, 0, 1, 1},
- {&__pyx_n_s_grps, __pyx_k_grps, sizeof(__pyx_k_grps), 0, 0, 1, 1},
- {&__pyx_n_s_has_cdf5, __pyx_k_has_cdf5, sizeof(__pyx_k_has_cdf5), 0, 0, 1, 1},
- {&__pyx_n_s_has_lsd, __pyx_k_has_lsd, sizeof(__pyx_k_has_lsd), 0, 0, 1, 1},
- {&__pyx_n_s_has_nc_inq_format_extended, __pyx_k_has_nc_inq_format_extended, sizeof(__pyx_k_has_nc_inq_format_extended), 0, 0, 1, 1},
- {&__pyx_n_s_has_nc_inq_path, __pyx_k_has_nc_inq_path, sizeof(__pyx_k_has_nc_inq_path), 0, 0, 1, 1},
- {&__pyx_n_s_has_rename_grp, __pyx_k_has_rename_grp, sizeof(__pyx_k_has_rename_grp), 0, 0, 1, 1},
- {&__pyx_n_s_hdf5libversion, __pyx_k_hdf5libversion, sizeof(__pyx_k_hdf5libversion), 0, 0, 1, 1},
- {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
- {&__pyx_n_s_hr_units, __pyx_k_hr_units, sizeof(__pyx_k_hr_units), 0, 0, 1, 1},
- {&__pyx_n_s_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 0, 1, 1},
- {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
- {&__pyx_n_s_i0, __pyx_k_i0, sizeof(__pyx_k_i0), 0, 0, 1, 1},
- {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
- {&__pyx_n_s_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 0, 1, 1},
- {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1},
- {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1},
- {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
- {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
- {&__pyx_kp_s_if_True_scale_factor_and_add_off, __pyx_k_if_True_scale_factor_and_add_off, sizeof(__pyx_k_if_True_scale_factor_and_add_off), 0, 0, 1, 0},
- {&__pyx_kp_s_illegal_data_type_for_attribute, __pyx_k_illegal_data_type_for_attribute, sizeof(__pyx_k_illegal_data_type_for_attribute), 0, 0, 1, 0},
- {&__pyx_kp_s_illegal_primitive_data_type_must, __pyx_k_illegal_primitive_data_type_must, sizeof(__pyx_k_illegal_primitive_data_type_must), 0, 0, 1, 0},
- {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
- {&__pyx_n_s_in1d, __pyx_k_in1d, sizeof(__pyx_k_in1d), 0, 0, 1, 1},
- {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
- {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
- {&__pyx_n_s_intnptonctype, __pyx_k_intnptonctype, sizeof(__pyx_k_intnptonctype), 0, 0, 1, 1},
- {&__pyx_kp_s_invalid_scale_factor_or_add_offs, __pyx_k_invalid_scale_factor_or_add_offs, sizeof(__pyx_k_invalid_scale_factor_or_add_offs), 0, 0, 1, 0},
- {&__pyx_n_s_isMA, __pyx_k_isMA, sizeof(__pyx_k_isMA), 0, 0, 1, 1},
- {&__pyx_n_s_is_native_big, __pyx_k_is_native_big, sizeof(__pyx_k_is_native_big), 0, 0, 1, 1},
- {&__pyx_n_s_is_native_little, __pyx_k_is_native_little, sizeof(__pyx_k_is_native_little), 0, 0, 1, 1},
- {&__pyx_n_s_iscompound, __pyx_k_iscompound, sizeof(__pyx_k_iscompound), 0, 0, 1, 1},
- {&__pyx_n_s_isenum, __pyx_k_isenum, sizeof(__pyx_k_isenum), 0, 0, 1, 1},
- {&__pyx_n_s_ismasked, __pyx_k_ismasked, sizeof(__pyx_k_ismasked), 0, 0, 1, 1},
- {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1},
- {&__pyx_n_s_isnative, __pyx_k_isnative, sizeof(__pyx_k_isnative), 0, 0, 1, 1},
- {&__pyx_n_s_isostring, __pyx_k_isostring, sizeof(__pyx_k_isostring), 0, 0, 1, 1},
- {&__pyx_n_s_isprimitive, __pyx_k_isprimitive, sizeof(__pyx_k_isprimitive), 0, 0, 1, 1},
- {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
- {&__pyx_n_s_isunlimited, __pyx_k_isunlimited, sizeof(__pyx_k_isunlimited), 0, 0, 1, 1},
- {&__pyx_n_s_isvlen, __pyx_k_isvlen, sizeof(__pyx_k_isvlen), 0, 0, 1, 1},
- {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
- {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
- {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
- {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
- {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
- {&__pyx_n_s_iu, __pyx_k_iu, sizeof(__pyx_k_iu), 0, 0, 1, 1},
- {&__pyx_n_s_izip, __pyx_k_izip, sizeof(__pyx_k_izip), 0, 0, 1, 1},
- {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
- {&__pyx_n_s_julian, __pyx_k_julian, sizeof(__pyx_k_julian), 0, 0, 1, 1},
- {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
- {&__pyx_n_s_keepweakref, __pyx_k_keepweakref, sizeof(__pyx_k_keepweakref), 0, 0, 1, 1},
- {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
- {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
- {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
- {&__pyx_n_s_least_significant_digit, __pyx_k_least_significant_digit, sizeof(__pyx_k_least_significant_digit), 0, 0, 1, 1},
- {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
- {&__pyx_kp_s_len_of_unsized_object, __pyx_k_len_of_unsized_object, sizeof(__pyx_k_len_of_unsized_object), 0, 0, 1, 0},
- {&__pyx_n_s_little, __pyx_k_little, sizeof(__pyx_k_little), 0, 0, 1, 1},
- {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
- {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1},
- {&__pyx_n_s_lstArr, __pyx_k_lstArr, sizeof(__pyx_k_lstArr), 0, 0, 1, 1},
- {&__pyx_n_s_ma, __pyx_k_ma, sizeof(__pyx_k_ma), 0, 0, 1, 1},
- {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
- {&__pyx_n_s_majorvers, __pyx_k_majorvers, sizeof(__pyx_k_majorvers), 0, 0, 1, 1},
- {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
- {&__pyx_n_s_masked_array, __pyx_k_masked_array, sizeof(__pyx_k_masked_array), 0, 0, 1, 1},
- {&__pyx_kp_s_masked_arrays_cannot_be_assigned, __pyx_k_masked_arrays_cannot_be_assigned, sizeof(__pyx_k_masked_arrays_cannot_be_assigned), 0, 0, 1, 0},
- {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1},
- {&__pyx_n_s_masterDims, __pyx_k_masterDims, sizeof(__pyx_k_masterDims), 0, 0, 1, 1},
- {&__pyx_n_s_masterRecVar, __pyx_k_masterRecVar, sizeof(__pyx_k_masterRecVar), 0, 0, 1, 1},
- {&__pyx_n_s_masterShape, __pyx_k_masterShape, sizeof(__pyx_k_masterShape), 0, 0, 1, 1},
- {&__pyx_n_s_masterType, __pyx_k_masterType, sizeof(__pyx_k_masterType), 0, 0, 1, 1},
- {&__pyx_kp_s_master_dataset_s_does_not_have_a, __pyx_k_master_dataset_s_does_not_have_a, sizeof(__pyx_k_master_dataset_s_does_not_have_a), 0, 0, 1, 0},
- {&__pyx_kp_s_master_dataset_s_does_not_have_a_2, __pyx_k_master_dataset_s_does_not_have_a_2, sizeof(__pyx_k_master_dataset_s_does_not_have_a_2), 0, 0, 1, 0},
- {&__pyx_n_s_mastervar, __pyx_k_mastervar, sizeof(__pyx_k_mastervar), 0, 0, 1, 1},
- {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
- {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
- {&__pyx_n_s_microsec_units, __pyx_k_microsec_units, sizeof(__pyx_k_microsec_units), 0, 0, 1, 1},
- {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
- {&__pyx_n_s_millisec_units, __pyx_k_millisec_units, sizeof(__pyx_k_millisec_units), 0, 0, 1, 1},
- {&__pyx_n_s_min_units, __pyx_k_min_units, sizeof(__pyx_k_min_units), 0, 0, 1, 1},
- {&__pyx_n_s_minorvers, __pyx_k_minorvers, sizeof(__pyx_k_minorvers), 0, 0, 1, 1},
- {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
- {&__pyx_n_s_missing_value, __pyx_k_missing_value, sizeof(__pyx_k_missing_value), 0, 0, 1, 1},
- {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
- {&__pyx_kp_s_mode_must_be_w_r_a_or_r_got_s, __pyx_k_mode_must_be_w_r_a_or_r_got_s, sizeof(__pyx_k_mode_must_be_w_r_a_or_r_got_s), 0, 0, 1, 0},
- {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
- {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
- {&__pyx_n_s_msecs, __pyx_k_msecs, sizeof(__pyx_k_msecs), 0, 0, 1, 1},
- {&__pyx_n_s_msecsd, __pyx_k_msecsd, sizeof(__pyx_k_msecsd), 0, 0, 1, 1},
- {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
- {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
- {&__pyx_n_s_n1, __pyx_k_n1, sizeof(__pyx_k_n1), 0, 0, 1, 1},
- {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
- {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
- {&__pyx_kp_s_name_cannot_be_altered, __pyx_k_name_cannot_be_altered, sizeof(__pyx_k_name_cannot_be_altered), 0, 0, 1, 0},
- {&__pyx_kp_s_name_s_numpy_dtype_s, __pyx_k_name_s_numpy_dtype_s, sizeof(__pyx_k_name_s_numpy_dtype_s), 0, 0, 1, 0},
- {&__pyx_kp_s_name_s_numpy_dtype_s_fields_val, __pyx_k_name_s_numpy_dtype_s_fields_val, sizeof(__pyx_k_name_s_numpy_dtype_s_fields_val), 0, 0, 1, 0},
- {&__pyx_kp_s_name_s_size_s, __pyx_k_name_s_size_s, sizeof(__pyx_k_name_s_size_s), 0, 0, 1, 0},
- {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
- {&__pyx_n_s_native, __pyx_k_native, sizeof(__pyx_k_native), 0, 0, 1, 1},
- {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
- {&__pyx_n_s_nc_type, __pyx_k_nc_type, sizeof(__pyx_k_nc_type), 0, 0, 1, 1},
- {&__pyx_n_s_ncattrs, __pyx_k_ncattrs, sizeof(__pyx_k_ncattrs), 0, 0, 1, 1},
- {&__pyx_n_s_ncdump, __pyx_k_ncdump, sizeof(__pyx_k_ncdump), 0, 0, 1, 1},
- {&__pyx_n_s_ncdump_var, __pyx_k_ncdump_var, sizeof(__pyx_k_ncdump_var), 0, 0, 1, 1},
- {&__pyx_n_s_nctime, __pyx_k_nctime, sizeof(__pyx_k_nctime), 0, 0, 1, 1},
- {&__pyx_n_s_nctonptype, __pyx_k_nctonptype, sizeof(__pyx_k_nctonptype), 0, 0, 1, 1},
- {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
- {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
- {&__pyx_n_s_needsworkaround_issue485, __pyx_k_needsworkaround_issue485, sizeof(__pyx_k_needsworkaround_issue485), 0, 0, 1, 1},
- {&__pyx_kp_s_negative_reference_year_in_time, __pyx_k_negative_reference_year_in_time, sizeof(__pyx_k_negative_reference_year_in_time), 0, 0, 1, 0},
- {&__pyx_kp_s_negative_strides_not_allowed_whe, __pyx_k_negative_strides_not_allowed_whe, sizeof(__pyx_k_negative_strides_not_allowed_whe), 0, 0, 1, 0},
- {&__pyx_n_s_nelems, __pyx_k_nelems, sizeof(__pyx_k_nelems), 0, 0, 1, 1},
- {&__pyx_n_s_netCDF4__netCDF4, __pyx_k_netCDF4__netCDF4, sizeof(__pyx_k_netCDF4__netCDF4), 0, 0, 1, 1},
- {&__pyx_n_s_netcdf4libversion, __pyx_k_netcdf4libversion, sizeof(__pyx_k_netcdf4libversion), 0, 0, 1, 1},
- {&__pyx_kp_s_netcdf_time_variable_is_missing, __pyx_k_netcdf_time_variable_is_missing, sizeof(__pyx_k_netcdf_time_variable_is_missing), 0, 0, 1, 0},
- {&__pyx_n_s_netcdftime, __pyx_k_netcdftime, sizeof(__pyx_k_netcdftime), 0, 0, 1, 1},
- {&__pyx_n_s_newSlice, __pyx_k_newSlice, sizeof(__pyx_k_newSlice), 0, 0, 1, 1},
- {&__pyx_n_s_newname, __pyx_k_newname, sizeof(__pyx_k_newname), 0, 0, 1, 1},
- {&__pyx_kp_s_no_since_in_unit_string, __pyx_k_no_since_in_unit_string, sizeof(__pyx_k_no_since_in_unit_string), 0, 0, 1, 0},
- {&__pyx_n_s_normpath, __pyx_k_normpath, sizeof(__pyx_k_normpath), 0, 0, 1, 1},
- {&__pyx_n_s_nptonctype, __pyx_k_nptonctype, sizeof(__pyx_k_nptonctype), 0, 0, 1, 1},
- {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
- {&__pyx_n_s_num2date, __pyx_k_num2date, sizeof(__pyx_k_num2date), 0, 0, 1, 1},
- {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
- {&__pyx_kp_s_numpy_data_type_for_primitive_da, __pyx_k_numpy_data_type_for_primitive_da, sizeof(__pyx_k_numpy_data_type_for_primitive_da), 0, 0, 1, 0},
- {&__pyx_n_s_numv, __pyx_k_numv, sizeof(__pyx_k_numv), 0, 0, 1, 1},
- {&__pyx_n_s_nunlimdim, __pyx_k_nunlimdim, sizeof(__pyx_k_nunlimdim), 0, 0, 1, 1},
- {&__pyx_n_s_nv, __pyx_k_nv, sizeof(__pyx_k_nv), 0, 0, 1, 1},
- {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
- {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1},
- {&__pyx_n_s_oldname, __pyx_k_oldname, sizeof(__pyx_k_oldname), 0, 0, 1, 1},
- {&__pyx_kp_s_only_endian_native_allowed_for_N, __pyx_k_only_endian_native_allowed_for_N, sizeof(__pyx_k_only_endian_native_allowed_for_N), 0, 0, 1, 0},
- {&__pyx_kp_s_only_numpy_string_unicode_or_obj, __pyx_k_only_numpy_string_unicode_or_obj, sizeof(__pyx_k_only_numpy_string_unicode_or_obj), 0, 0, 1, 0},
- {&__pyx_n_s_ordereddict, __pyx_k_ordereddict, sizeof(__pyx_k_ordereddict), 0, 0, 1, 1},
- {&__pyx_n_s_orthogoral_indexing, __pyx_k_orthogoral_indexing, sizeof(__pyx_k_orthogoral_indexing), 0, 0, 1, 1},
- {&__pyx_n_s_out_array_shape, __pyx_k_out_array_shape, sizeof(__pyx_k_out_array_shape), 0, 0, 1, 1},
- {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
- {&__pyx_kp_s_parent_is_a_reference_to_the_pa, __pyx_k_parent_is_a_reference_to_the_pa, sizeof(__pyx_k_parent_is_a_reference_to_the_pa), 0, 0, 1, 0},
- {&__pyx_n_s_parse_date, __pyx_k_parse_date, sizeof(__pyx_k_parse_date), 0, 0, 1, 1},
- {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1},
- {&__pyx_n_s_patchstring, __pyx_k_patchstring, sizeof(__pyx_k_patchstring), 0, 0, 1, 1},
- {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
- {&__pyx_n_s_path_2, __pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 0, 1, 1},
- {&__pyx_kp_s_path_s, __pyx_k_path_s, sizeof(__pyx_k_path_s), 0, 0, 1, 0},
- {&__pyx_kp_s_path_shows_the_location_of_the, __pyx_k_path_shows_the_location_of_the, sizeof(__pyx_k_path_shows_the_location_of_the), 0, 0, 1, 0},
- {&__pyx_n_s_pdoc, __pyx_k_pdoc, sizeof(__pyx_k_pdoc), 0, 0, 1, 1},
- {&__pyx_n_s_persist, __pyx_k_persist, sizeof(__pyx_k_persist), 0, 0, 1, 1},
- {&__pyx_kp_s_please_install_ordereddict_https, __pyx_k_please_install_ordereddict_https, sizeof(__pyx_k_please_install_ordereddict_https), 0, 0, 1, 0},
- {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
- {&__pyx_n_s_posixpath, __pyx_k_posixpath, sizeof(__pyx_k_posixpath), 0, 0, 1, 1},
- {&__pyx_n_s_preemption, __pyx_k_preemption, sizeof(__pyx_k_preemption), 0, 0, 1, 1},
- {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
- {&__pyx_n_s_private_atts, __pyx_k_private_atts, sizeof(__pyx_k_private_atts), 0, 0, 1, 1},
- {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1},
- {&__pyx_n_s_proleptic_gregorian, __pyx_k_proleptic_gregorian, sizeof(__pyx_k_proleptic_gregorian), 0, 0, 1, 1},
- {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1},
- {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
- {&__pyx_n_s_put_2, __pyx_k_put_2, sizeof(__pyx_k_put_2), 0, 0, 1, 1},
- {&__pyx_n_s_put_ind, __pyx_k_put_ind, sizeof(__pyx_k_put_ind), 0, 0, 1, 1},
- {&__pyx_n_s_python3, __pyx_k_python3, sizeof(__pyx_k_python3), 0, 0, 1, 1},
- {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
- {&__pyx_n_s_quantize, __pyx_k_quantize, sizeof(__pyx_k_quantize), 0, 0, 1, 1},
- {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
- {&__pyx_kp_s_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 1, 0},
- {&__pyx_kp_s_r_3, __pyx_k_r_3, sizeof(__pyx_k_r_3), 0, 0, 1, 0},
- {&__pyx_kp_s_r_s, __pyx_k_r_s, sizeof(__pyx_k_r_s), 0, 0, 1, 0},
- {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
- {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
- {&__pyx_n_s_recLen, __pyx_k_recLen, sizeof(__pyx_k_recLen), 0, 0, 1, 1},
- {&__pyx_n_s_recVar, __pyx_k_recVar, sizeof(__pyx_k_recVar), 0, 0, 1, 1},
- {&__pyx_n_s_recdimlen, __pyx_k_recdimlen, sizeof(__pyx_k_recdimlen), 0, 0, 1, 1},
- {&__pyx_n_s_recdimname, __pyx_k_recdimname, sizeof(__pyx_k_recdimname), 0, 0, 1, 1},
- {&__pyx_n_s_recdimname_2, __pyx_k_recdimname_2, sizeof(__pyx_k_recdimname_2), 0, 0, 1, 1},
- {&__pyx_n_s_redef, __pyx_k_redef, sizeof(__pyx_k_redef), 0, 0, 1, 1},
- {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
- {&__pyx_n_s_ref_date, __pyx_k_ref_date, sizeof(__pyx_k_ref_date), 0, 0, 1, 1},
- {&__pyx_n_s_ref_num, __pyx_k_ref_num, sizeof(__pyx_k_ref_num), 0, 0, 1, 1},
- {&__pyx_n_s_releasevers, __pyx_k_releasevers, sizeof(__pyx_k_releasevers), 0, 0, 1, 1},
- {&__pyx_kp_s_renameGroup_method_not_enabled, __pyx_k_renameGroup_method_not_enabled, sizeof(__pyx_k_renameGroup_method_not_enabled), 0, 0, 1, 0},
- {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
- {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
- {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
- {&__pyx_n_s_reverse_format_dict, __pyx_k_reverse_format_dict, sizeof(__pyx_k_reverse_format_dict), 0, 0, 1, 1},
- {&__pyx_kp_s_root_group_s_data_model_file_for, __pyx_k_root_group_s_data_model_file_for, sizeof(__pyx_k_root_group_s_data_model_file_for), 0, 0, 1, 0},
- {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
- {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
- {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1},
- {&__pyx_kp_s_s_is_one_of_the_reserved_attrib, __pyx_k_s_is_one_of_the_reserved_attrib, sizeof(__pyx_k_s_is_one_of_the_reserved_attrib), 0, 0, 1, 0},
- {&__pyx_kp_s_s_is_one_of_the_reserved_attrib_2, __pyx_k_s_is_one_of_the_reserved_attrib_2, sizeof(__pyx_k_s_is_one_of_the_reserved_attrib_2), 0, 0, 1, 0},
- {&__pyx_kp_s_s_not_a_valid_dimension_name, __pyx_k_s_not_a_valid_dimension_name, sizeof(__pyx_k_s_not_a_valid_dimension_name), 0, 0, 1, 0},
- {&__pyx_kp_s_s_not_a_valid_variable_name, __pyx_k_s_not_a_valid_variable_name, sizeof(__pyx_k_s_not_a_valid_variable_name), 0, 0, 1, 0},
- {&__pyx_kp_s_s_not_found_in_s, __pyx_k_s_not_found_in_s, sizeof(__pyx_k_s_not_found_in_s), 0, 0, 1, 0},
- {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
- {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0},
- {&__pyx_kp_s_s_s_s_2, __pyx_k_s_s_s_2, sizeof(__pyx_k_s_s_s_2), 0, 0, 1, 0},
- {&__pyx_kp_s_same_as_data_model_retained_for, __pyx_k_same_as_data_model_retained_for, sizeof(__pyx_k_same_as_data_model_retained_for), 0, 0, 1, 0},
- {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
- {&__pyx_n_s_scale_factor, __pyx_k_scale_factor, sizeof(__pyx_k_scale_factor), 0, 0, 1, 1},
- {&__pyx_n_s_sec_units, __pyx_k_sec_units, sizeof(__pyx_k_sec_units), 0, 0, 1, 1},
- {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
- {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1},
- {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1},
- {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
- {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
- {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
- {&__pyx_n_s_set_auto_mask, __pyx_k_set_auto_mask, sizeof(__pyx_k_set_auto_mask), 0, 0, 1, 1},
- {&__pyx_n_s_set_auto_maskandscale, __pyx_k_set_auto_maskandscale, sizeof(__pyx_k_set_auto_maskandscale), 0, 0, 1, 1},
- {&__pyx_n_s_set_auto_scale, __pyx_k_set_auto_scale, sizeof(__pyx_k_set_auto_scale), 0, 0, 1, 1},
- {&__pyx_n_s_set_default_format, __pyx_k_set_default_format, sizeof(__pyx_k_set_default_format), 0, 0, 1, 1},
- {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
- {&__pyx_n_s_setncattr, __pyx_k_setncattr, sizeof(__pyx_k_setncattr), 0, 0, 1, 1},
- {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
- {&__pyx_n_s_shape_2, __pyx_k_shape_2, sizeof(__pyx_k_shape_2), 0, 0, 1, 1},
- {&__pyx_kp_s_shape_cannot_be_altered, __pyx_k_shape_cannot_be_altered, sizeof(__pyx_k_shape_cannot_be_altered), 0, 0, 1, 0},
- {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1},
- {&__pyx_n_s_since, __pyx_k_since, sizeof(__pyx_k_since), 0, 0, 1, 1},
- {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
- {&__pyx_kp_s_size_cannot_be_altered, __pyx_k_size_cannot_be_altered, sizeof(__pyx_k_size_cannot_be_altered), 0, 0, 1, 0},
- {&__pyx_kp_s_size_of_data_array_does_not_conf, __pyx_k_size_of_data_array_does_not_conf, sizeof(__pyx_k_size_of_data_array_does_not_conf), 0, 0, 1, 0},
- {&__pyx_n_s_slen, __pyx_k_slen, sizeof(__pyx_k_slen), 0, 0, 1, 1},
- {&__pyx_n_s_sortbylist, __pyx_k_sortbylist, sizeof(__pyx_k_sortbylist), 0, 0, 1, 1},
- {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
- {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1},
- {&__pyx_n_s_sta, __pyx_k_sta, sizeof(__pyx_k_sta), 0, 0, 1, 1},
- {&__pyx_n_s_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 0, 1, 1},
- {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
- {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
- {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
- {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
- {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
- {&__pyx_n_s_strd, __pyx_k_strd, sizeof(__pyx_k_strd), 0, 0, 1, 1},
- {&__pyx_n_s_stride, __pyx_k_stride, sizeof(__pyx_k_stride), 0, 0, 1, 1},
- {&__pyx_kp_s_strides_must_all_be_1_for_string, __pyx_k_strides_must_all_be_1_for_string, sizeof(__pyx_k_strides_must_all_be_1_for_string), 0, 0, 1, 0},
- {&__pyx_kp_s_strides_must_all_be_1_for_vlen_v, __pyx_k_strides_must_all_be_1_for_vlen_v, sizeof(__pyx_k_strides_must_all_be_1_for_vlen_v), 0, 0, 1, 0},
- {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
- {&__pyx_kp_s_string_type, __pyx_k_string_type, sizeof(__pyx_k_string_type), 0, 0, 1, 0},
- {&__pyx_n_s_stringtoarr, __pyx_k_stringtoarr, sizeof(__pyx_k_stringtoarr), 0, 0, 1, 1},
- {&__pyx_n_s_stringtochar, __pyx_k_stringtochar, sizeof(__pyx_k_stringtochar), 0, 0, 1, 1},
- {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
- {&__pyx_n_s_strt, __pyx_k_strt, sizeof(__pyx_k_strt), 0, 0, 1, 1},
- {&__pyx_n_s_subdtype, __pyx_k_subdtype, sizeof(__pyx_k_subdtype), 0, 0, 1, 1},
- {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
- {&__pyx_n_s_supportedtypes, __pyx_k_supportedtypes, sizeof(__pyx_k_supportedtypes), 0, 0, 1, 1},
- {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
- {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
- {&__pyx_n_s_td, __pyx_k_td, sizeof(__pyx_k_td), 0, 0, 1, 1},
- {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
- {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
- {&__pyx_n_s_tile, __pyx_k_tile, sizeof(__pyx_k_tile), 0, 0, 1, 1},
- {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
- {&__pyx_n_s_time2index, __pyx_k_time2index, sizeof(__pyx_k_time2index), 0, 0, 1, 1},
- {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
- {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1},
- {&__pyx_n_s_timestr, __pyx_k_timestr, sizeof(__pyx_k_timestr), 0, 0, 1, 1},
- {&__pyx_n_s_timestr_split, __pyx_k_timestr_split, sizeof(__pyx_k_timestr_split), 0, 0, 1, 1},
- {&__pyx_n_s_to_ascii, __pyx_k_to_ascii, sizeof(__pyx_k_to_ascii), 0, 0, 1, 1},
- {&__pyx_kp_s_to_assign_values_to_a_non_scalar, __pyx_k_to_assign_values_to_a_non_scalar, sizeof(__pyx_k_to_assign_values_to_a_non_scalar), 0, 0, 1, 0},
- {&__pyx_kp_s_to_retrieve_values_from_a_non_sc, __pyx_k_to_retrieve_values_from_a_non_sc, sizeof(__pyx_k_to_retrieve_values_from_a_non_sc), 0, 0, 1, 0},
- {&__pyx_n_s_tolist, __pyx_k_tolist, sizeof(__pyx_k_tolist), 0, 0, 1, 1},
- {&__pyx_n_s_toma, __pyx_k_toma, sizeof(__pyx_k_toma), 0, 0, 1, 1},
- {&__pyx_n_s_tostr, __pyx_k_tostr, sizeof(__pyx_k_tostr), 0, 0, 1, 1},
- {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
- {&__pyx_n_s_totaltime, __pyx_k_totaltime, sizeof(__pyx_k_totaltime), 0, 0, 1, 1},
- {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
- {&__pyx_kp_s_trying_to_assign_illegal_value_t, __pyx_k_trying_to_assign_illegal_value_t, sizeof(__pyx_k_trying_to_assign_illegal_value_t), 0, 0, 1, 0},
- {&__pyx_n_s_tsecs, __pyx_k_tsecs, sizeof(__pyx_k_tsecs), 0, 0, 1, 1},
- {&__pyx_kp_s_type_must_string_or_unicode_S_or, __pyx_k_type_must_string_or_unicode_S_or, sizeof(__pyx_k_type_must_string_or_unicode_S_or), 0, 0, 1, 0},
- {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
- {&__pyx_n_s_typeid, __pyx_k_typeid, sizeof(__pyx_k_typeid), 0, 0, 1, 1},
- {&__pyx_kp_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 0},
- {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1},
- {&__pyx_n_s_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 0, 1, 1},
- {&__pyx_n_s_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 0, 1, 1},
- {&__pyx_n_s_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 0, 1, 1},
- {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
- {&__pyx_n_s_unicode_error, __pyx_k_unicode_error, sizeof(__pyx_k_unicode_error), 0, 0, 1, 1},
- {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1},
- {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
- {&__pyx_n_s_unlimdims, __pyx_k_unlimdims, sizeof(__pyx_k_unlimdims), 0, 0, 1, 1},
- {&__pyx_kp_s_unlimited_dimensions_s, __pyx_k_unlimited_dimensions_s, sizeof(__pyx_k_unlimited_dimensions_s), 0, 0, 1, 0},
- {&__pyx_kp_s_unlimited_dimensions_s_2, __pyx_k_unlimited_dimensions_s_2, sizeof(__pyx_k_unlimited_dimensions_s_2), 0, 0, 1, 0},
- {&__pyx_kp_s_unlimited_name_s_size_s, __pyx_k_unlimited_name_s_size_s, sizeof(__pyx_k_unlimited_name_s_size_s), 0, 0, 1, 0},
- {&__pyx_kp_s_unrecognized_format_requested, __pyx_k_unrecognized_format_requested, sizeof(__pyx_k_unrecognized_format_requested), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_component_type_for_V, __pyx_k_unsupported_component_type_for_V, sizeof(__pyx_k_unsupported_component_type_for_V), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_datatype_specified_f, __pyx_k_unsupported_datatype_specified_f, sizeof(__pyx_k_unsupported_datatype_specified_f), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_datatype_specified_f_2, __pyx_k_unsupported_datatype_specified_f_2, sizeof(__pyx_k_unsupported_datatype_specified_f_2), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_time_units, __pyx_k_unsupported_time_units, sizeof(__pyx_k_unsupported_time_units), 0, 0, 1, 0},
- {&__pyx_n_s_utc_offset, __pyx_k_utc_offset, sizeof(__pyx_k_utc_offset), 0, 0, 1, 1},
- {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
- {&__pyx_n_s_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 0, 0, 1, 1},
- {&__pyx_n_s_utime, __pyx_k_utime, sizeof(__pyx_k_utime), 0, 0, 1, 1},
- {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
- {&__pyx_n_s_vInst, __pyx_k_vInst, sizeof(__pyx_k_vInst), 0, 0, 1, 1},
- {&__pyx_n_s_vName, __pyx_k_vName, sizeof(__pyx_k_vName), 0, 0, 1, 1},
- {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
- {&__pyx_n_s_valid_max, __pyx_k_valid_max, sizeof(__pyx_k_valid_max), 0, 0, 1, 1},
- {&__pyx_n_s_valid_min, __pyx_k_valid_min, sizeof(__pyx_k_valid_min), 0, 0, 1, 1},
- {&__pyx_n_s_valid_range, __pyx_k_valid_range, sizeof(__pyx_k_valid_range), 0, 0, 1, 1},
- {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
- {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1},
- {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
- {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
- {&__pyx_n_s_varInfo, __pyx_k_varInfo, sizeof(__pyx_k_varInfo), 0, 0, 1, 1},
- {&__pyx_kp_s_variable_s_data_type_mismatch_be, __pyx_k_variable_s_data_type_mismatch_be, sizeof(__pyx_k_variable_s_data_type_mismatch_be), 0, 0, 1, 0},
- {&__pyx_kp_s_variable_s_dimensions_mismatch_b, __pyx_k_variable_s_dimensions_mismatch_b, sizeof(__pyx_k_variable_s_dimensions_mismatch_b), 0, 0, 1, 0},
- {&__pyx_kp_s_variable_s_rank_mismatch_between, __pyx_k_variable_s_rank_mismatch_between, sizeof(__pyx_k_variable_s_rank_mismatch_between), 0, 0, 1, 0},
- {&__pyx_kp_s_variable_s_shape_mismatch_betwee, __pyx_k_variable_s_shape_mismatch_betwee, sizeof(__pyx_k_variable_s_shape_mismatch_betwee), 0, 0, 1, 0},
- {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1},
- {&__pyx_kp_s_variables_dimensions_s, __pyx_k_variables_dimensions_s, sizeof(__pyx_k_variables_dimensions_s), 0, 0, 1, 0},
- {&__pyx_kp_s_variables_s, __pyx_k_variables_s, sizeof(__pyx_k_variables_s), 0, 0, 1, 0},
- {&__pyx_n_s_varid, __pyx_k_varid, sizeof(__pyx_k_varid), 0, 0, 1, 1},
- {&__pyx_n_s_varname, __pyx_k_varname, sizeof(__pyx_k_varname), 0, 0, 1, 1},
- {&__pyx_n_s_varnames, __pyx_k_varnames, sizeof(__pyx_k_varnames), 0, 0, 1, 1},
- {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1},
- {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
- {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
- {&__pyx_n_s_vid, __pyx_k_vid, sizeof(__pyx_k_vid), 0, 0, 1, 1},
- {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
- {&__pyx_n_s_vlen, __pyx_k_vlen, sizeof(__pyx_k_vlen), 0, 0, 1, 1},
- {&__pyx_kp_s_vlen_data_type_s, __pyx_k_vlen_data_type_s, sizeof(__pyx_k_vlen_data_type_s), 0, 0, 1, 0},
- {&__pyx_n_s_vltype, __pyx_k_vltype, sizeof(__pyx_k_vltype), 0, 0, 1, 1},
- {&__pyx_n_s_vltypes, __pyx_k_vltypes, sizeof(__pyx_k_vltypes), 0, 0, 1, 1},
- {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
- {&__pyx_n_s_walk_grps, __pyx_k_walk_grps, sizeof(__pyx_k_walk_grps), 0, 0, 1, 1},
- {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
- {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
- {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
- {&__pyx_kp_s_wrong_data_type_in_object_array, __pyx_k_wrong_data_type_in_object_array, sizeof(__pyx_k_wrong_data_type_in_object_array), 0, 0, 1, 0},
- {&__pyx_kp_s_wrong_data_type_should_be_s_got, __pyx_k_wrong_data_type_should_be_s_got, sizeof(__pyx_k_wrong_data_type_should_be_s_got), 0, 0, 1, 0},
- {&__pyx_n_s_ws, __pyx_k_ws, sizeof(__pyx_k_ws), 0, 0, 1, 1},
- {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
- {&__pyx_kp_s_zero_not_allowed_as_a_reference, __pyx_k_zero_not_allowed_as_a_reference, sizeof(__pyx_k_zero_not_allowed_as_a_reference), 0, 0, 1, 0},
- {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
- {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
- {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 928, __pyx_L1_error)
- __pyx_builtin_memoryview = __Pyx_GetBuiltinName(__pyx_n_s_memoryview); if (!__pyx_builtin_memoryview) __PYX_ERR(0, 1069, __pyx_L1_error)
- __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5685, __pyx_L1_error)
- __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 1091, __pyx_L1_error)
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 1133, __pyx_L1_error)
- __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1141, __pyx_L1_error)
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 1158, __pyx_L1_error)
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 1186, __pyx_L1_error)
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1195, __pyx_L1_error)
- __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1295, __pyx_L1_error)
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 1310, __pyx_L1_error)
- __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 1848, __pyx_L1_error)
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 1899, __pyx_L1_error)
- __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 1992, __pyx_L1_error)
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 3741, __pyx_L1_error)
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 4018, __pyx_L1_error)
- __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 4347, __pyx_L1_error)
- __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 5071, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "netCDF4/_netCDF4.pyx":1128
- * else:
- * pstring =\
- * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<<
- * return pstring
- * elif att_type == NC_STRING:
- */
- __pyx_tuple__3 = PyTuple_Pack(2, __pyx_kp_s_, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__3);
- __Pyx_GIVEREF(__pyx_tuple__3);
-
- /* "netCDF4/_netCDF4.pyx":1140
- * raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * try:
- * result = [values[j].decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<<
- * for j in range(att_len)]
- * finally:
- */
- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_s_, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1140, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__4);
- __Pyx_GIVEREF(__pyx_tuple__4);
-
- /* "netCDF4/_netCDF4.pyx":1186
- * # 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_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unrecognized_format_requested); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__5);
- __Pyx_GIVEREF(__pyx_tuple__5);
-
- /* "netCDF4/_netCDF4.pyx":1197
- * raise RuntimeError((<char *>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_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_format_not_supported_by_python_i); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1197, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
-
- /* "netCDF4/_netCDF4.pyx":1257
- * # 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_tuple__7 = PyTuple_Pack(1, __pyx_n_s_NETCDF3); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
-
- /* "netCDF4/_netCDF4.pyx":1258
- * 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_slice__8 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 1258, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__8);
- __Pyx_GIVEREF(__pyx_slice__8);
-
- /* "netCDF4/_netCDF4.pyx":1260
- * 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_tuple__9 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1260, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
-
- /* "netCDF4/_netCDF4.pyx":1309
- * 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_slice__10 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 1309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__10);
- __Pyx_GIVEREF(__pyx_slice__10);
-
- /* "netCDF4/_netCDF4.pyx":1310
- * 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_slice__11 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 1310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__11);
- __Pyx_GIVEREF(__pyx_slice__11);
-
- /* "netCDF4/_netCDF4.pyx":1312
- * 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_slice__12 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 1312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__12);
- __Pyx_GIVEREF(__pyx_slice__12);
-
- /* "netCDF4/_netCDF4.pyx":1888
- * # 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_tuple__16 = PyTuple_Pack(1, __pyx_kp_s__15); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
-
- /* "netCDF4/_netCDF4.pyx":1946
- * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+
- * (((_tostr(self.variables[varname].dimensions)
- * .replace("u'",""))\ # <<<<<<<<<<<<<<
- * .replace("'",""))\
- * .replace(", ",","))\
- */
- __pyx_tuple__17 = PyTuple_Pack(2, __pyx_kp_s_u, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
-
- /* "netCDF4/_netCDF4.pyx":1947
- * (((_tostr(self.variables[varname].dimensions)
- * .replace("u'",""))\
- * .replace("'",""))\ # <<<<<<<<<<<<<<
- * .replace(", ",","))\
- * .replace(",)",")") for varname in self.variables.keys()])
- */
- __pyx_tuple__19 = PyTuple_Pack(2, __pyx_kp_s__18, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1947, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
-
- /* "netCDF4/_netCDF4.pyx":1948
- * .replace("u'",""))\
- * .replace("'",""))\
- * .replace(", ",","))\ # <<<<<<<<<<<<<<
- * .replace(",)",")") for varname in self.variables.keys()])
- * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()])
- */
- __pyx_tuple__22 = PyTuple_Pack(2, __pyx_kp_s__20, __pyx_kp_s__21); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
-
- /* "netCDF4/_netCDF4.pyx":1949
- * .replace("'",""))\
- * .replace(", ",","))\
- * .replace(",)",")") for varname in self.variables.keys()]) # <<<<<<<<<<<<<<
- * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()])
- * if self.path == '/':
- */
- __pyx_tuple__25 = PyTuple_Pack(2, __pyx_kp_s__23, __pyx_kp_s__24); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
-
- /* "netCDF4/_netCDF4.pyx":1992
- * def __reduce__(self):
- * # raise error is user tries to pickle a Dataset object.
- * raise NotImplementedError('Dataset is not picklable') # <<<<<<<<<<<<<<
- *
- * def sync(self):
- */
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Dataset_is_not_picklable); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1992, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
-
- /* "netCDF4/_netCDF4.pyx":2309
- * # 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_tuple__27 = PyTuple_Pack(1, __pyx_kp_s__15); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
-
- /* "netCDF4/_netCDF4.pyx":2407
- * if name not in _private_atts:
- * self.setncattr(name, value)
- * elif not name.endswith('__'): # <<<<<<<<<<<<<<
- * if hasattr(self,name):
- * raise AttributeError(
- */
- __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2407, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
-
- /* "netCDF4/_netCDF4.pyx":2417
- * # 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_tuple__30 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2417, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2417, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
-
- /* "netCDF4/_netCDF4.pyx":2679
- * 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_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_cannot_close_a_netCDF4_Group_onl); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
-
- /* "netCDF4/_netCDF4.pyx":2696
- * return self._getname()
- * def __set__(self,value):
- * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_name_cannot_be_altered); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
-
- /* "netCDF4/_netCDF4.pyx":2783
- * return self._getname()
- * def __set__(self,value):
- * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<<
- *
- * property size:
- */
- __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_name_cannot_be_altered); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2783, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
-
- /* "netCDF4/_netCDF4.pyx":2790
- * return len(self)
- * def __set__(self,value):
- * raise AttributeError("size cannot be altered") # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_size_cannot_be_altered); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2790, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
-
- /* "netCDF4/_netCDF4.pyx":3118
- * 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_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Variable_length_strings_are_only); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3118, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__38);
- __Pyx_GIVEREF(__pyx_tuple__38);
-
- /* "netCDF4/_netCDF4.pyx":3128
- * # 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_slice__39 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 3128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__39);
- __Pyx_GIVEREF(__pyx_slice__39);
-
- /* "netCDF4/_netCDF4.pyx":3132
- * # 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_slice__40 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(0, 3132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__40);
- __Pyx_GIVEREF(__pyx_slice__40);
-
- /* "netCDF4/_netCDF4.pyx":3172
- * # 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_tuple__41 = PyTuple_Pack(1, __pyx_n_s_NETCDF4); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3172, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
-
- /* "netCDF4/_netCDF4.pyx":3214
- * icontiguous = NC_CONTIGUOUS
- * if chunksizes is not None:
- * raise ValueError('cannot specify chunksizes for a contiguous dataset') # <<<<<<<<<<<<<<
- * else:
- * icontiguous = NC_CHUNKED
- */
- __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_cannot_specify_chunksizes_for_a); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3214, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__42);
- __Pyx_GIVEREF(__pyx_tuple__42);
-
- /* "netCDF4/_netCDF4.pyx":3222
- * 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 = <size_t *>malloc(sizeof(size_t) * ndims)
- * for n from 0 <= n < ndims:
- */
- __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_chunksizes_must_be_a_sequence_wi); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 3222, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
-
- /* "netCDF4/_netCDF4.pyx":3273
- * if self._isprimitive or self._isenum:
- * fillval = numpy.array(fill_value, self.dtype)
- * if not fillval.dtype.isnative: fillval.byteswap(True) # <<<<<<<<<<<<<<
- * _set_att(self._grp, self._varid, '_FillValue',\
- * fillval, xtype=xtype)
- */
- __pyx_tuple__44 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__44);
- __Pyx_GIVEREF(__pyx_tuple__44);
-
- /* "netCDF4/_netCDF4.pyx":3277
- * 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
- */
- __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_cannot_set__FillValue_attribute); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3277, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
-
- /* "netCDF4/_netCDF4.pyx":3359
- * 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_slice__46 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) __PYX_ERR(0, 3359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__46);
- __Pyx_GIVEREF(__pyx_slice__46);
-
- /* "netCDF4/_netCDF4.pyx":3360
- * 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_slice__47 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(0, 3360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__47);
- __Pyx_GIVEREF(__pyx_slice__47);
-
- /* "netCDF4/_netCDF4.pyx":3415
- * return self._getname()
- * def __set__(self,value):
- * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<<
- *
- * property datatype:
- */
- __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_name_cannot_be_altered); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__48);
- __Pyx_GIVEREF(__pyx_tuple__48);
-
- /* "netCDF4/_netCDF4.pyx":3441
- * return shape
- * def __set__(self,value):
- * raise AttributeError("shape cannot be altered") # <<<<<<<<<<<<<<
- *
- * property size:
- */
- __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_shape_cannot_be_altered); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3441, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
-
- /* "netCDF4/_netCDF4.pyx":3453
- * return self._getdims()
- * def __set__(self,value):
- * raise AttributeError("dimensions cannot be altered") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_dimensions_cannot_be_altered); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__50);
- __Pyx_GIVEREF(__pyx_tuple__50);
-
- /* "netCDF4/_netCDF4.pyx":3680
- * # (the same as the data)
- * value = numpy.array(value, self.dtype)
- * if not value.dtype.isnative: value.byteswap(True) # <<<<<<<<<<<<<<
- * self.setncattr(name, value)
- * elif not name.endswith('__'):
- */
- __pyx_tuple__51 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 3680, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__51);
- __Pyx_GIVEREF(__pyx_tuple__51);
-
- /* "netCDF4/_netCDF4.pyx":3682
- * if not value.dtype.isnative: value.byteswap(True)
- * self.setncattr(name, value)
- * elif not name.endswith('__'): # <<<<<<<<<<<<<<
- * if hasattr(self,name):
- * raise AttributeError(
- */
- __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3682, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__52);
- __Pyx_GIVEREF(__pyx_tuple__52);
-
- /* "netCDF4/_netCDF4.pyx":3692
- * # 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_tuple__53 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
- __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s__28); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__54);
- __Pyx_GIVEREF(__pyx_tuple__54);
-
- /* "netCDF4/_netCDF4.pyx":3740
- * # 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_slice__55 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__55)) __PYX_ERR(0, 3740, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__55);
- __Pyx_GIVEREF(__pyx_slice__55);
-
- /* "netCDF4/_netCDF4.pyx":3741
- * # 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_slice__56 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(0, 3741, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__56);
- __Pyx_GIVEREF(__pyx_slice__56);
-
- /* "netCDF4/_netCDF4.pyx":3837
- * # If the _FillValue is positive then it defines a valid maximum,
- * # otherwise it defines a valid minimum."
- * byte_type = self.dtype.str[1:] in ['u1','i1'] # <<<<<<<<<<<<<<
- * if hasattr(self, '_FillValue'):
- * fval = numpy.array(self._FillValue, self.dtype)
- */
- __pyx_slice__57 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__57)) __PYX_ERR(0, 3837, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__57);
- __Pyx_GIVEREF(__pyx_slice__57);
-
- /* "netCDF4/_netCDF4.pyx":3841
- * fval = numpy.array(self._FillValue, self.dtype)
- * else:
- * fval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype) # <<<<<<<<<<<<<<
- * if byte_type: fval = None
- * if validmin is None and (fval is not None and fval <= 0):
- */
- __pyx_slice__58 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__58)) __PYX_ERR(0, 3841, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__58);
- __Pyx_GIVEREF(__pyx_slice__58);
-
- /* "netCDF4/_netCDF4.pyx":3906
- * # 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)
- * has_fillval = data == fillval
- */
- __pyx_slice__59 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) __PYX_ERR(0, 3906, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__59);
- __Pyx_GIVEREF(__pyx_slice__59);
-
- /* "netCDF4/_netCDF4.pyx":3907
- * # 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) # <<<<<<<<<<<<<<
- * has_fillval = data == fillval
- * # if data is an array scalar, has_fillval will be a boolean.
- */
- __pyx_slice__60 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__60)) __PYX_ERR(0, 3907, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__60);
- __Pyx_GIVEREF(__pyx_slice__60);
-
- /* "netCDF4/_netCDF4.pyx":3938
- * cdef ndarray data2
- * if not self._isvlen:
- * raise TypeError('_assign_vlen method only for use with VLEN variables') # <<<<<<<<<<<<<<
- * ndims = self.ndim
- * msg="data can only be assigned to VLEN variables using integer indices"
- */
- __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_assign_vlen_method_only_for_use); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 3938, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__61);
- __Pyx_GIVEREF(__pyx_tuple__61);
-
- /* "netCDF4/_netCDF4.pyx":3950
- * elem = self.shape[0]+elem
- * else:
- * raise IndexError("Illegal index") # <<<<<<<<<<<<<<
- * elif isinstance(elem, tuple):
- * if len(elem) != ndims:
- */
- __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Illegal_index); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 3950, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__62);
- __Pyx_GIVEREF(__pyx_tuple__62);
-
- /* "netCDF4/_netCDF4.pyx":3953
- * elif isinstance(elem, tuple):
- * if len(elem) != ndims:
- * raise IndexError("Illegal index") # <<<<<<<<<<<<<<
- * elemnew = []
- * for n,e in enumerate(elem):
- */
- __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Illegal_index); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 3953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__63);
- __Pyx_GIVEREF(__pyx_tuple__63);
-
- /* "netCDF4/_netCDF4.pyx":3961
- * enew = self.shape[n]+e
- * if enew < 0:
- * raise IndexError("Illegal index") # <<<<<<<<<<<<<<
- * else:
- * elemnew.append(self.shape[n]+e)
- */
- __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Illegal_index); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 3961, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__64);
- __Pyx_GIVEREF(__pyx_tuple__64);
-
- /* "netCDF4/_netCDF4.pyx":4133
- * fillval = self._FillValue
- * else:
- * fillval = default_fillvals[self.dtype.str[1:]] # <<<<<<<<<<<<<<
- * data = data.filled(fill_value=fillval)
- *
- */
- __pyx_slice__65 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__65)) __PYX_ERR(0, 4133, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__65);
- __Pyx_GIVEREF(__pyx_slice__65);
-
- /* "netCDF4/_netCDF4.pyx":4151
- * def __len__(self):
- * if not self.shape:
- * raise TypeError('len() of unsized object') # <<<<<<<<<<<<<<
- * else:
- * return self.shape[0]
- */
- __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_len_of_unsized_object); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 4151, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__66);
- __Pyx_GIVEREF(__pyx_tuple__66);
-
- /* "netCDF4/_netCDF4.pyx":4163
- * 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_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_to_assign_values_to_a_non_scalar); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 4163, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__67);
- __Pyx_GIVEREF(__pyx_tuple__67);
-
- /* "netCDF4/_netCDF4.pyx":4164
- * if len(self.dimensions):
- * raise IndexError('to assign values to a non-scalar variable, use a slice')
- * self[:]=val # <<<<<<<<<<<<<<
- *
- * def getValue(self):
- */
- __pyx_slice__68 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__68)) __PYX_ERR(0, 4164, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__68);
- __Pyx_GIVEREF(__pyx_slice__68);
-
- /* "netCDF4/_netCDF4.pyx":4173
- * 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_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_to_retrieve_values_from_a_non_sc); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__69);
- __Pyx_GIVEREF(__pyx_tuple__69);
-
- /* "netCDF4/_netCDF4.pyx":4174
- * 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_slice__70 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__70)) __PYX_ERR(0, 4174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__70);
- __Pyx_GIVEREF(__pyx_slice__70);
-
- /* "netCDF4/_netCDF4.pyx":4321
- * 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_slice__71 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__71)) __PYX_ERR(0, 4321, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__71);
- __Pyx_GIVEREF(__pyx_slice__71);
-
- /* "netCDF4/_netCDF4.pyx":4325
- * 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_slice__72 = PySlice_New(Py_None, Py_None, __pyx_int_1); if (unlikely(!__pyx_slice__72)) __PYX_ERR(0, 4325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__72);
- __Pyx_GIVEREF(__pyx_slice__72);
-
- /* "netCDF4/_netCDF4.pyx":4331
- * 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_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_size_of_data_array_does_not_conf); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 4331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__73);
- __Pyx_GIVEREF(__pyx_tuple__73);
-
- /* "netCDF4/_netCDF4.pyx":4357
- * 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_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_data_to_put_in_string_variable_m); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 4357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__74);
- __Pyx_GIVEREF(__pyx_tuple__74);
-
- /* "netCDF4/_netCDF4.pyx":4376
- * 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)
- */
- __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_strides_must_all_be_1_for_string); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 4376, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__75);
- __Pyx_GIVEREF(__pyx_tuple__75);
-
- /* "netCDF4/_netCDF4.pyx":4392
- * elptr = (<void**>databuff)[0]
- * dataarr = <ndarray>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_slice__76 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(0, 4392, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__76);
- __Pyx_GIVEREF(__pyx_slice__76);
-
- /* "netCDF4/_netCDF4.pyx":4404
- * 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)
- */
- __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_strides_must_all_be_1_for_vlen_v); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 4404, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__77);
- __Pyx_GIVEREF(__pyx_tuple__77);
-
- /* "netCDF4/_netCDF4.pyx":4432
- * for lendim in count:
- * if lendim == -1:
- * shapeout = shapeout + (1,) # <<<<<<<<<<<<<<
- * squeeze_out = True
- * else:
- */
- __pyx_tuple__78 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 4432, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__78);
- __Pyx_GIVEREF(__pyx_tuple__78);
-
- /* "netCDF4/_netCDF4.pyx":4453
- * 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_slice__79 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__79)) __PYX_ERR(0, 4453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__79);
- __Pyx_GIVEREF(__pyx_slice__79);
-
- /* "netCDF4/_netCDF4.pyx":4457
- * 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_slice__80 = PySlice_New(Py_None, Py_None, __pyx_int_1); if (unlikely(!__pyx_slice__80)) __PYX_ERR(0, 4457, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__80);
- __Pyx_GIVEREF(__pyx_slice__80);
-
- /* "netCDF4/_netCDF4.pyx":4490
- * 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)
- */
- __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_strides_must_all_be_1_for_string); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 4490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__81);
- __Pyx_GIVEREF(__pyx_tuple__81);
-
- /* "netCDF4/_netCDF4.pyx":4520
- * 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)
- */
- __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_strides_must_all_be_1_for_vlen_v); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 4520, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__82);
- __Pyx_GIVEREF(__pyx_tuple__82);
-
- /* "netCDF4/_netCDF4.pyx":4553
- * # (pull request #555, issue #554).
- * if not data.dtype.isnative:
- * data.byteswap(True) # in-place byteswap # <<<<<<<<<<<<<<
- * if not self.dimensions:
- * return data[0] # a scalar
- */
- __pyx_tuple__83 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 4553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__83);
- __Pyx_GIVEREF(__pyx_tuple__83);
-
- /* "netCDF4/_netCDF4.pyx":4563
- * def __reduce__(self):
- * # raise error is user tries to pickle a Variable object.
- * raise NotImplementedError('Variable is not picklable') # <<<<<<<<<<<<<<
- *
- * # Compound datatype support.
- */
- __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Variable_is_not_picklable); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 4563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__84);
- __Pyx_GIVEREF(__pyx_tuple__84);
-
- /* "netCDF4/_netCDF4.pyx":4630
- * def __reduce__(self):
- * # raise error is user tries to pickle a CompoundType object.
- * raise NotImplementedError('CompoundType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_compound(grp, object dt, object dtype_name):
- */
- __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_CompoundType_is_not_picklable); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 4630, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__85);
- __Pyx_GIVEREF(__pyx_tuple__85);
-
- /* "netCDF4/_netCDF4.pyx":4660
- * if format.kind != 'V': # scalar primitive type
- * try:
- * xtype_tmp = _nptonctype[format.str[1:]] # <<<<<<<<<<<<<<
- * except KeyError:
- * raise ValueError('Unsupported compound type element')
- */
- __pyx_slice__86 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__86)) __PYX_ERR(0, 4660, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__86);
- __Pyx_GIVEREF(__pyx_slice__86);
-
- /* "netCDF4/_netCDF4.pyx":4662
- * 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_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_compound_type_elemen); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 4662, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__87);
- __Pyx_GIVEREF(__pyx_tuple__87);
-
- /* "netCDF4/_netCDF4.pyx":4685
- * 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_slice__88 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__88)) __PYX_ERR(0, 4685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__88);
- __Pyx_GIVEREF(__pyx_slice__88);
-
- /* "netCDF4/_netCDF4.pyx":4687
- * 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_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_compound_type_elemen); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 4687, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__89);
- __Pyx_GIVEREF(__pyx_tuple__89);
-
- /* "netCDF4/_netCDF4.pyx":4725
- * 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_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_cannot_find_compound_type_in_thi); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 4725, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__90);
- __Pyx_GIVEREF(__pyx_tuple__90);
-
- /* "netCDF4/_netCDF4.pyx":4727
- * 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_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_cannot_find_compound_type_in_thi); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 4727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__91);
- __Pyx_GIVEREF(__pyx_tuple__91);
-
- /* "netCDF4/_netCDF4.pyx":4801
- * 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))
- */
- __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_compound_field_of_an_unsupported); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 4801, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__92);
- __Pyx_GIVEREF(__pyx_tuple__92);
-
- /* "netCDF4/_netCDF4.pyx":4877
- * def __reduce__(self):
- * # raise error is user tries to pickle a VLType object.
- * raise NotImplementedError('VLType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_vlen(grp, object dt, object dtype_name):
- */
- __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_VLType_is_not_picklable); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 4877, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__93);
- __Pyx_GIVEREF(__pyx_tuple__93);
-
- /* "netCDF4/_netCDF4.pyx":4894
- * 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_slice__94 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__94)) __PYX_ERR(0, 4894, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__94);
- __Pyx_GIVEREF(__pyx_slice__94);
-
- /* "netCDF4/_netCDF4.pyx":4897
- * # 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_slice__95 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__95)) __PYX_ERR(0, 4897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__95);
- __Pyx_GIVEREF(__pyx_slice__95);
-
- /* "netCDF4/_netCDF4.pyx":4902
- * raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- * else:
- * raise KeyError("unsupported datatype specified for VLEN") # <<<<<<<<<<<<<<
- * return xtype, dt
- *
- */
- __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_unsupported_datatype_specified_f); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 4902, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__96);
- __Pyx_GIVEREF(__pyx_tuple__96);
-
- /* "netCDF4/_netCDF4.pyx":4929
- * 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_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_unsupported_component_type_for_V); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 4929, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__97);
- __Pyx_GIVEREF(__pyx_tuple__97);
-
- /* "netCDF4/_netCDF4.pyx":4996
- * def __reduce__(self):
- * # raise error is user tries to pickle a EnumType object.
- * raise NotImplementedError('EnumType is not picklable') # <<<<<<<<<<<<<<
- *
- * cdef _def_enum(grp, object dt, object dtype_name, object enum_dict):
- */
- __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_EnumType_is_not_picklable); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 4996, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__98);
- __Pyx_GIVEREF(__pyx_tuple__98);
-
- /* "netCDF4/_netCDF4.pyx":5008
- * 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_slice__99 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__99)) __PYX_ERR(0, 5008, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__99);
- __Pyx_GIVEREF(__pyx_slice__99);
-
- /* "netCDF4/_netCDF4.pyx":5011
- * # 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_slice__100 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__100)) __PYX_ERR(0, 5011, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__100);
- __Pyx_GIVEREF(__pyx_slice__100);
-
- /* "netCDF4/_netCDF4.pyx":5051
- * 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_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_unsupported_component_type_for_V); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 5051, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__101);
- __Pyx_GIVEREF(__pyx_tuple__101);
-
- /* "netCDF4/_netCDF4.pyx":5079
- * return str(bytestr,encoding='ascii')
- * else:
- * return bytestr.encode('ascii') # <<<<<<<<<<<<<<
- *
- * #----------------------------------------
- */
- __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 5079, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__102);
- __Pyx_GIVEREF(__pyx_tuple__102);
-
- /* "netCDF4/_netCDF4.pyx":5099
- * 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_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_no_since_in_unit_string); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 5099, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__103);
- __Pyx_GIVEREF(__pyx_tuple__103);
-
- /* "netCDF4/_netCDF4.pyx":5101
- * 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_tuple__104 = PyTuple_Pack(1, __pyx_n_s_since); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 5101, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__104);
- __Pyx_GIVEREF(__pyx_tuple__104);
-
- /* "netCDF4/_netCDF4.pyx":5113
- * basedate = netcdftime.datetime(year, month, day, hour, minute, second)
- * else:
- * raise ValueError('cannot use utc_offset for reference years <= 0') # <<<<<<<<<<<<<<
- * return basedate
- *
- */
- __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_cannot_use_utc_offset_for_refere); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 5113, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__105);
- __Pyx_GIVEREF(__pyx_tuple__105);
-
- /* "netCDF4/_netCDF4.pyx":5134
- * (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_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_dtype_must_string_or_unicode_S_o); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 5134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__106);
- __Pyx_GIVEREF(__pyx_tuple__106);
-
- /* "netCDF4/_netCDF4.pyx":5153
- * 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_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_type_must_string_or_unicode_S_or); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 5153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__107);
- __Pyx_GIVEREF(__pyx_tuple__107);
-
- /* "netCDF4/_netCDF4.pyx":5172
- * 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_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_type_must_string_or_unicode_S_or); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 5172, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__108);
- __Pyx_GIVEREF(__pyx_tuple__108);
-
- /* "netCDF4/_netCDF4.pyx":5176
- * 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_slice__109 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__109)) __PYX_ERR(0, 5176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__109);
- __Pyx_GIVEREF(__pyx_slice__109);
-
- /* "netCDF4/_netCDF4.pyx":5258
- * times.append(totaltime/1.e6/3600./24.)
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * if isscalar:
- * return times[0]
- */
- __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_unsupported_time_units); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 5258, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__110);
- __Pyx_GIVEREF(__pyx_tuple__110);
-
- /* "netCDF4/_netCDF4.pyx":5352
- * tsecs = time*86400.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * # compute time delta.
- * days = tsecs // 86400.
- */
- __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_unsupported_time_units); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 5352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__111);
- __Pyx_GIVEREF(__pyx_tuple__111);
-
- /* "netCDF4/_netCDF4.pyx":5404
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard')
- */
- __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_netcdf_time_variable_is_missing); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 5404, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__112);
- __Pyx_GIVEREF(__pyx_tuple__112);
-
- /* "netCDF4/_netCDF4.pyx":5490
- * # can be used like a CDF instance.
- * if isinstance(files, str):
- * if files.startswith('http'): # <<<<<<<<<<<<<<
- * msg='cannot using file globbing for remote (OPeNDAP) datasets'
- * raise ValueError(msg)
- */
- __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_http); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 5490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__113);
- __Pyx_GIVEREF(__pyx_tuple__113);
-
- /* "netCDF4/_netCDF4.pyx":5552
- * # Make sure each file defines the same aggregation variables as the master
- * # and that the variables are defined in the same way (name, shape and type)
- * for f in files[1:]: # <<<<<<<<<<<<<<
- * part = Dataset(f)
- * varInfo = part.variables
- */
- __pyx_slice__114 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__114)) __PYX_ERR(0, 5552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__114);
- __Pyx_GIVEREF(__pyx_slice__114);
-
- /* "netCDF4/_netCDF4.pyx":5563
- * #if not vInst.dimensions[0] != aggDimName:
- *
- * masterDims, masterShape, masterType = masterRecVar[v][:3] # <<<<<<<<<<<<<<
- * extDims = varInfo[v].dimensions
- * extShape = varInfo[v].shape
- */
- __pyx_slice__115 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__115)) __PYX_ERR(0, 5563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__115);
- __Pyx_GIVEREF(__pyx_slice__115);
-
- /* "netCDF4/_netCDF4.pyx":5580
- * "master %s (%s) and extension %s (%s)" %
- * (v, master, len(masterShape), f, len(extShape)))
- * if masterShape[1:] != extShape[1:]: # <<<<<<<<<<<<<<
- * raise IOError("variable %s : shape mismatch between "
- * "master %s (%s) and extension %s (%s)" %
- */
- __pyx_slice__116 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__116)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__116);
- __Pyx_GIVEREF(__pyx_slice__116);
- __pyx_slice__117 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__117)) __PYX_ERR(0, 5580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__117);
- __Pyx_GIVEREF(__pyx_slice__117);
-
- /* "netCDF4/_netCDF4.pyx":5623
- * for dset in self._cdf:
- * if dset.file_format == 'NETCDF4' or dset.data_model == 'NETCDF4':
- * raise ValueError('MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4') # <<<<<<<<<<<<<<
- * self._file_format.append(dset.file_format)
- * self._data_model.append(dset.data_model)
- */
- __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_MFNetCDF4_only_works_with_NETCDF); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 5623, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__118);
- __Pyx_GIVEREF(__pyx_tuple__118);
-
- /* "netCDF4/_netCDF4.pyx":5683
- * def __reduce__(self):
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable') # <<<<<<<<<<<<<<
- *
- * class _Dimension(object):
- */
- __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_MFDataset_is_not_picklable); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 5683, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__119);
- __Pyx_GIVEREF(__pyx_tuple__119);
-
- /* "netCDF4/_netCDF4.pyx":5743
- * def __len__(self):
- * if not self._shape:
- * raise TypeError('len() of unsized object') # <<<<<<<<<<<<<<
- * else:
- * return self._shape()[0]
- */
- __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_len_of_unsized_object); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 5743, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__120);
- __Pyx_GIVEREF(__pyx_tuple__120);
-
- /* "netCDF4/_netCDF4.pyx":5748
- * def _shape(self):
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:] # <<<<<<<<<<<<<<
- * def set_auto_maskandscale(self,val):
- * for v in self._recVar:
- */
- __pyx_slice__121 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__121)) __PYX_ERR(0, 5748, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__121);
- __Pyx_GIVEREF(__pyx_slice__121);
-
- /* "netCDF4/_netCDF4.pyx":5775
- * # 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_slice__122 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__122)) __PYX_ERR(0, 5775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__122);
- __Pyx_GIVEREF(__pyx_slice__122);
-
- /* "netCDF4/_netCDF4.pyx":5776
- * # 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_slice__123 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__123)) __PYX_ERR(0, 5776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__123);
- __Pyx_GIVEREF(__pyx_slice__123);
-
- /* "netCDF4/_netCDF4.pyx":5793
- * count = [abs(cnt) for cnt in count]
- * if (numpy.array(stride) < 0).any():
- * raise IndexError('negative strides not allowed when slicing MFVariable Variable instance') # <<<<<<<<<<<<<<
- * # Start, stop and step along 1st dimension, eg the unlimited
- * # dimension.
- */
- __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_negative_strides_not_allowed_whe); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 5793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__124);
- __Pyx_GIVEREF(__pyx_tuple__124);
-
- /* "netCDF4/_netCDF4.pyx":5817
- *
- * # Rebuild the slicing expression for dimensions 1 and ssq.
- * newSlice = [slice(None, None, None)] # <<<<<<<<<<<<<<
- * for n in range(1, len(start)): # skip dimension 0
- * s = slice(start[n],start[n] + count[n] * stride[n], stride[n])
- */
- __pyx_slice__125 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__125)) __PYX_ERR(0, 5817, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__125);
- __Pyx_GIVEREF(__pyx_slice__125);
-
- /* "netCDF4/_netCDF4.pyx":5919
- * for t in self._recVar:
- * if not hasattr(t,'calendar'):
- * raise ValueError('MFTime requires that the time variable in all files have a calendar attribute') # <<<<<<<<<<<<<<
- *
- * # Check that calendar is the same in all files.
- */
- __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_MFTime_requires_that_the_time_va); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 5919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__126);
- __Pyx_GIVEREF(__pyx_tuple__126);
-
- /* "netCDF4/_netCDF4.pyx":5923
- * # Check that calendar is the same in all files.
- * if len(set([t.calendar for t in self._recVar])) > 1:
- * raise ValueError('MFTime requires that the same time calendar is used by all files.') # <<<<<<<<<<<<<<
- *
- * # Override units if units is specified.
- */
- __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_MFTime_requires_that_the_same_ti); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 5923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__127);
- __Pyx_GIVEREF(__pyx_tuple__127);
-
- /* "netCDF4/_netCDF4.pyx":5929
- *
- * # Reference date to compute the difference between different time units.
- * ref_date = datetime.datetime(1900,1,1) # <<<<<<<<<<<<<<
- * ref_num = date2num(ref_date, self.units, self.calendar)
- *
- */
- __pyx_tuple__128 = PyTuple_Pack(3, __pyx_int_1900, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 5929, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__128);
- __Pyx_GIVEREF(__pyx_tuple__128);
-
- /* "netCDF4/_netCDF4.pyx":932
- * from ordereddict import OrderedDict
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)') # <<<<<<<<<<<<<<
- * try:
- * from itertools import izip as zip
- */
- __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_please_install_ordereddict_https); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 932, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__129);
- __Pyx_GIVEREF(__pyx_tuple__129);
-
- /* "netCDF4/_netCDF4.pyx":958
- * # check for required version of netcdf-4 and hdf5.
- *
- * def _gethdf5libversion(): # <<<<<<<<<<<<<<
- * majorvers = H5_VERS_MAJOR
- * minorvers = H5_VERS_MINOR
- */
- __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_majorvers, __pyx_n_s_minorvers, __pyx_n_s_releasevers, __pyx_n_s_patchstring); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 958, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__130);
- __Pyx_GIVEREF(__pyx_tuple__130);
- __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_gethdf5libversion, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 958, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":968
- * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring)
- *
- * def getlibversion(): # <<<<<<<<<<<<<<
- * """
- * **`getlibversion()`**
- */
- __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_getlibversion, 968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 968, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":984
- * __has_cdf5__ = HAS_CDF5_FORMAT
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
- * (__netcdf4libversion__.startswith("4.4.0") and \ # <<<<<<<<<<<<<<
- * "-development" in __netcdf4libversion__)
- *
- */
- __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_4_4_0); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__133);
- __Pyx_GIVEREF(__pyx_tuple__133);
-
- /* "netCDF4/_netCDF4.pyx":988
- *
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\ # <<<<<<<<<<<<<<
- * __hdf5libversion__.startswith("1.10"):
- * msg = """
- */
- __pyx_slice__134 = PySlice_New(__pyx_int_0, __pyx_int_5, Py_None); if (unlikely(!__pyx_slice__134)) __PYX_ERR(0, 988, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__134);
- __Pyx_GIVEREF(__pyx_slice__134);
-
- /* "netCDF4/_netCDF4.pyx":989
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\
- * __hdf5libversion__.startswith("1.10"): # <<<<<<<<<<<<<<
- * msg = """
- * WARNING: Backwards incompatible files will be created with HDF5 1.10.x
- */
- __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_1_10); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__135);
- __Pyx_GIVEREF(__pyx_tuple__135);
-
- /* "netCDF4/_netCDF4.pyx":1054
- *
- * # logical for native endian type.
- * is_native_little = numpy.dtype('<f4').byteorder == '=' # <<<<<<<<<<<<<<
- * is_native_big = numpy.dtype('>f4').byteorder == '='
- *
- */
- __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_f4_2); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__136);
- __Pyx_GIVEREF(__pyx_tuple__136);
-
- /* "netCDF4/_netCDF4.pyx":1055
- * # logical for native endian type.
- * is_native_little = numpy.dtype('<f4').byteorder == '='
- * is_native_big = numpy.dtype('>f4').byteorder == '=' # <<<<<<<<<<<<<<
- *
- * # hard code this here, instead of importing from netcdf.h
- */
- __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_f4_3); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__137);
- __Pyx_GIVEREF(__pyx_tuple__137);
-
- /* "netCDF4/_netCDF4.pyx":1183
- * return value_arr
- *
- * def _set_default_format(object format='NETCDF4'): # <<<<<<<<<<<<<<
- * # Private function to set the netCDF file format
- * if format not in _format_dict:
- */
- __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_format); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1183, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__138);
- __Pyx_GIVEREF(__pyx_tuple__138);
- __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_set_default_format, 1183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 1183, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5074
- * return pystr # already bytes or unicode?
- *
- * def _to_ascii(bytestr): # <<<<<<<<<<<<<<
- * # encode a byte string to an ascii encoded string.
- * if python3:
- */
- __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_s_bytestr); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 5074, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__140);
- __Pyx_GIVEREF(__pyx_tuple__140);
- __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_to_ascii, 5074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 5074, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5089
- *
- * # start of the gregorian calendar
- * gregorian = datetime(1582,10,15) # <<<<<<<<<<<<<<
- *
- * def _dateparse(timestr):
- */
- __pyx_tuple__142 = PyTuple_Pack(3, __pyx_int_1582, __pyx_int_10, __pyx_int_15); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 5089, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__142);
- __Pyx_GIVEREF(__pyx_tuple__142);
-
- /* "netCDF4/_netCDF4.pyx":5091
- * 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"""
- */
- __pyx_tuple__143 = PyTuple_Pack(13, __pyx_n_s_timestr, __pyx_n_s_timestr_split, __pyx_n_s_units, __pyx_n_s_n, __pyx_n_s_isostring, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_utc_offset, __pyx_n_s_basedate); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 5091, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__143);
- __Pyx_GIVEREF(__pyx_tuple__143);
- __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_dateparse, 5091, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 5091, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5116
- * return basedate
- *
- * def stringtoarr(string,NUMCHARS,dtype='S'): # <<<<<<<<<<<<<<
- * """
- * **`stringtoarr(a, NUMCHARS,dtype='S')`**
- */
- __pyx_tuple__145 = PyTuple_Pack(4, __pyx_n_s_string, __pyx_n_s_NUMCHARS, __pyx_n_s_dtype, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 5116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__145);
- __Pyx_GIVEREF(__pyx_tuple__145);
- __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_stringtoarr, 5116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 5116, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5139
- * return arr
- *
- * def stringtochar(a): # <<<<<<<<<<<<<<
- * """
- * **`stringtochar(a)`**
- */
- __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_dtype, __pyx_n_s_b); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 5139, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__147);
- __Pyx_GIVEREF(__pyx_tuple__147);
- __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_stringtochar, 5139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 5139, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5158
- * return b
- *
- * def chartostring(b): # <<<<<<<<<<<<<<
- * """
- * **`chartostring(b)`**
- */
- __pyx_tuple__149 = PyTuple_Pack(6, __pyx_n_s_b, __pyx_n_s_dtype, __pyx_n_s_bs, __pyx_n_s_slen, __pyx_n_s_a, __pyx_n_s_n1); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 5158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__149);
- __Pyx_GIVEREF(__pyx_tuple__149);
- __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_chartostring, 5158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 5158, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5179
- * return a
- *
- * def date2num(dates,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`date2num(dates,units,calendar='standard')`**
- */
- __pyx_tuple__151 = PyTuple_Pack(15, __pyx_n_s_dates, __pyx_n_s_units, __pyx_n_s_calendar, __pyx_n_s_basedate, __pyx_n_s_unit, __pyx_n_s_msg, __pyx_n_s_isscalar, __pyx_n_s_shape, __pyx_n_s_ismasked, __pyx_n_s_mask, __pyx_n_s_times, __pyx_n_s_date, __pyx_n_s_td, __pyx_n_s_totaltime, __pyx_n_s_cdftime); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 5179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__151);
- __Pyx_GIVEREF(__pyx_tuple__151);
- __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_date2num, 5179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 5179, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5267
- * return cdftime.date2num(dates)
- *
- * def num2date(times,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`num2date(times,units,calendar='standard')`**
- */
- __pyx_tuple__153 = PyTuple_Pack(20, __pyx_n_s_times, __pyx_n_s_units, __pyx_n_s_calendar, __pyx_n_s_basedate, __pyx_n_s_unit, __pyx_n_s_msg, __pyx_n_s_isscalar, __pyx_n_s_shape, __pyx_n_s_ismasked, __pyx_n_s_mask, __pyx_n_s_dates, __pyx_n_s_time, __pyx_n_s_tsecs, __pyx_n_s_days, __pyx_n_s_msecsd, __pyx_n_s_secs, __pyx_n_s_msecs, __pyx_n_s_td, __pyx_n_s_date, __pyx_n_s_cdftime); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 5267, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__153);
- __Pyx_GIVEREF(__pyx_tuple__153);
- __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_num2date, 5267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 5267, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5370
- * return cdftime.num2date(times)
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * **`date2index(dates, nctime, calendar=None, select='exact')`**
- */
- __pyx_tuple__155 = PyTuple_Pack(7, __pyx_n_s_dates, __pyx_n_s_nctime, __pyx_n_s_calendar, __pyx_n_s_select, __pyx_n_s_basedate, __pyx_n_s_msg, __pyx_n_s_times); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 5370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__155);
- __Pyx_GIVEREF(__pyx_tuple__155);
- __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_date2index, 5370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 5370, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5456
- * """
- *
- * def __init__(self, files, check=False, aggdim=None, exclude=[]): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, files, check=False, aggdim=None, exclude=[])`**
- */
- __pyx_tuple__157 = PyTuple_Pack(36, __pyx_n_s_self, __pyx_n_s_files, __pyx_n_s_check, __pyx_n_s_aggdim, __pyx_n_s_exclude, __pyx_n_s_msg, __pyx_n_s_master, __pyx_n_s_cdfm, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_aggDimId, __pyx_n_s_dimname, __pyx_n_s_dim, __pyx_n_s_aggDimName, __pyx_n_s_masterRecVar, __pyx_n_s_vName, __pyx_n_s_v, __pyx_n_s_dims_2, __pyx_n_s_shape, __pyx_n_s_dtype, __pyx_n_s_cdf_2, __pyx_n_s_cdfVLen_2, __pyx_n_s_cdfRecVar_2, __pyx_n_s_f, __pyx_n_s_part, __pyx_n_s_var [...]
- __Pyx_GOTREF(__pyx_tuple__157);
- __Pyx_GIVEREF(__pyx_tuple__157);
- __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(5, 0, 36, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_init, 5456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 5456, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5629
- * self._path = '/'
- *
- * def __setattr__(self, name, value): # <<<<<<<<<<<<<<
- * """override base class attribute creation"""
- * self.__dict__[name] = value
- */
- __pyx_tuple__159 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 5629, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__159);
- __Pyx_GIVEREF(__pyx_tuple__159);
- __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_setattr, 5629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 5629, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5633
- * self.__dict__[name] = value
- *
- * def __getattribute__(self, name): # <<<<<<<<<<<<<<
- * if name in ['variables','dimensions','file_format','groups',\
- * 'data_model','disk_format','path']:
- */
- __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 5633, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__161);
- __Pyx_GIVEREF(__pyx_tuple__161);
- __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_getattribute, 5633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 5633, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5646
- * return Dataset.__getattribute__(self, name)
- *
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * """
- * **`ncattrs(self)`**
- */
- __pyx_tuple__163 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 5646, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__163);
- __Pyx_GIVEREF(__pyx_tuple__163);
- __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_ncattrs, 5646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 5646, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5654
- * return self._cdf[0].__dict__.keys()
- *
- * def close(self): # <<<<<<<<<<<<<<
- * """
- * **`close(self)`**
- */
- __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dset); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 5654, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__165);
- __Pyx_GIVEREF(__pyx_tuple__165);
- __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_close, 5654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 5654, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5663
- * dset.close()
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- */
- __pyx_tuple__167 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_ncdump, __pyx_n_s_dimnames, __pyx_n_s_varnames, __pyx_n_s_grpnames, __pyx_n_s_attrs, __pyx_n_s_dimname, __pyx_n_s_varname, __pyx_n_s_name); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 5663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__167);
- __Pyx_GIVEREF(__pyx_tuple__167);
- __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_repr, 5663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 5663, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5681
- * return ''.join(ncdump)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable')
- */
- __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 5681, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__169);
- __Pyx_GIVEREF(__pyx_tuple__169);
- __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_reduce, 5681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 5681, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5686
- *
- * class _Dimension(object):
- * def __init__(self, dimname, dim, dimlens, dimtotlen): # <<<<<<<<<<<<<<
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen
- */
- __pyx_tuple__171 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_dimname, __pyx_n_s_dim, __pyx_n_s_dimlens, __pyx_n_s_dimtotlen); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 5686, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__171);
- __Pyx_GIVEREF(__pyx_tuple__171);
- __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_init, 5686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 5686, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5690
- * self.dimtotlen = dimtotlen
- * self._name = dimname
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self.dimtotlen
- * def isunlimited(self):
- */
- __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 5690, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__173);
- __Pyx_GIVEREF(__pyx_tuple__173);
- __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_len, 5690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 5690, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5692
- * def __len__(self):
- * return self.dimtotlen
- * def isunlimited(self): # <<<<<<<<<<<<<<
- * return True
- * def __repr__(self):
- */
- __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 5692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__175);
- __Pyx_GIVEREF(__pyx_tuple__175);
- __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_isunlimited, 5692, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 5692, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5694
- * def isunlimited(self):
- * return True
- * def __repr__(self): # <<<<<<<<<<<<<<
- * if self.isunlimited():
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- */
- __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 5694, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__177);
- __Pyx_GIVEREF(__pyx_tuple__177);
- __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_repr, 5694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 5694, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5701
- *
- * class _Variable(object):
- * def __init__(self, dset, varname, var, recdimname): # <<<<<<<<<<<<<<
- * self.dimensions = var.dimensions
- * self._dset = dset
- */
- __pyx_tuple__179 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_dset, __pyx_n_s_varname, __pyx_n_s_var, __pyx_n_s_recdimname, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 5701, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__179);
- __Pyx_GIVEREF(__pyx_tuple__179);
- __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_init, 5701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 5701, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5714
- * for name, value in var.__dict__.items():
- * self.__dict__[name] = value
- * def typecode(self): # <<<<<<<<<<<<<<
- * return self.dtype
- * def ncattrs(self):
- */
- __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 5714, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__181);
- __Pyx_GIVEREF(__pyx_tuple__181);
- __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_typecode, 5714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 5714, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5716
- * def typecode(self):
- * return self.dtype
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name):
- */
- __pyx_tuple__183 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 5716, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__183);
- __Pyx_GIVEREF(__pyx_tuple__183);
- __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_ncattrs, 5716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 5716, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5718
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name): # <<<<<<<<<<<<<<
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- */
- __pyx_tuple__185 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 5718, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__185);
- __Pyx_GIVEREF(__pyx_tuple__185);
- __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_getattr, 5718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 5718, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5725
- * except:
- * raise AttributeError(name)
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- */
- __pyx_tuple__187 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_ncdump_var, __pyx_n_s_dimnames, __pyx_n_s_attrs, __pyx_n_s_unlimdims, __pyx_n_s_dimname, __pyx_n_s_dim, __pyx_n_s_name); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 5725, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__187);
- __Pyx_GIVEREF(__pyx_tuple__187);
- __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_repr, 5725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 5725, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5741
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var)
- * def __len__(self): # <<<<<<<<<<<<<<
- * if not self._shape:
- * raise TypeError('len() of unsized object')
- */
- __pyx_tuple__189 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 5741, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__189);
- __Pyx_GIVEREF(__pyx_tuple__189);
- __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_len, 5741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 5741, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5746
- * else:
- * return self._shape()[0]
- * def _shape(self): # <<<<<<<<<<<<<<
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- */
- __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_recdimlen); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 5746, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__191);
- __Pyx_GIVEREF(__pyx_tuple__191);
- __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_shape_2, 5746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 5746, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5749
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- */
- __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_val, __pyx_n_s_v); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 5749, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__193);
- __Pyx_GIVEREF(__pyx_tuple__193);
- __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_set_auto_maskandscale, 5749, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 5749, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5752
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_mask(val)
- */
- __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_val, __pyx_n_s_v); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 5752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__195);
- __Pyx_GIVEREF(__pyx_tuple__195);
- __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_set_auto_mask, 5752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 5752, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5755
- * for v in self._recVar:
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_scale(val)
- */
- __pyx_tuple__197 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_val, __pyx_n_s_v); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 5755, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__197);
- __Pyx_GIVEREF(__pyx_tuple__197);
- __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_set_auto_scale, 5755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 5755, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5758
- * for v in self._recVar:
- * v.set_auto_scale(val)
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * """Get records from a concatenated set of variables."""
- *
- */
- __pyx_tuple__199 = PyTuple_Pack(30, __pyx_n_s_self, __pyx_n_s_elem, __pyx_n_s_start, __pyx_n_s_count, __pyx_n_s_stride, __pyx_n_s_put_ind, __pyx_n_s_datashape, __pyx_n_s_data, __pyx_n_s_squeeze, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_strt, __pyx_n_s_cnt, __pyx_n_s_strd, __pyx_n_s_nv, __pyx_n_s_ind, __pyx_n_s_sta, __pyx_n_s_step, __pyx_n_s_stop, __pyx_n_s_idx, __pyx_n_s_vid, __pyx_n_s_k, __pyx_n_s_lst, __pyx_n_s_newSlice, __pyx_n_s_s_2, __pyx_n_s_lstArr, __pyx_n_s_ismasked, __pyx_n_s_dat, [...]
- __Pyx_GOTREF(__pyx_tuple__199);
- __Pyx_GIVEREF(__pyx_tuple__199);
- __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_getitem, 5758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 5758, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":5897
- * """
- *
- * def __init__(self, time, units=None): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, time, units=None)`**
- */
- __pyx_tuple__201 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_time, __pyx_n_s_units, __pyx_n_s_datetime, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_t, __pyx_n_s_ref_date, __pyx_n_s_ref_num, __pyx_n_s_i0, __pyx_n_s_i1, __pyx_n_s_i, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_num); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 5897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__201);
- __Pyx_GIVEREF(__pyx_tuple__201);
- __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_init, 5897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 5897, __pyx_L1_error)
- __pyx_tuple__203 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 5897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__203);
- __Pyx_GIVEREF(__pyx_tuple__203);
-
- /* "netCDF4/_netCDF4.pyx":5945
- *
- *
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * return self.__time[elem] + self.__delta[elem]
- */
- __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 5945, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__204);
- __Pyx_GIVEREF(__pyx_tuple__204);
- __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jswhit_python_netcdf4_pyt, __pyx_n_s_getitem, 5945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 5945, __pyx_L1_error)
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
- __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
- __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_24_ = PyFloat_FromDouble(24.); if (unlikely(!__pyx_float_24_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_60_ = PyFloat_FromDouble(60.); if (unlikely(!__pyx_float_60_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_e3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_float_1_e3)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_e6 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_float_1_e6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1440_ = PyFloat_FromDouble(1440.); if (unlikely(!__pyx_float_1440_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_3600_ = PyFloat_FromDouble(3600.); if (unlikely(!__pyx_float_3600_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_86400_ = PyFloat_FromDouble(86400.); if (unlikely(!__pyx_float_86400_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1582 = PyInt_FromLong(1582); if (unlikely(!__pyx_int_1582)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1900 = PyInt_FromLong(1900); if (unlikely(!__pyx_int_1900)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC init_netCDF4(void); /*proto*/
-PyMODINIT_FUNC init_netCDF4(void)
-#else
-PyMODINIT_FUNC PyInit__netCDF4(void); /*proto*/
-PyMODINIT_FUNC PyInit__netCDF4(void)
-#endif
-{
- 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_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- PyObject *__pyx_t_13 = NULL;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_t_15;
- int __pyx_t_16;
- Py_ssize_t __pyx_t_17;
- PyObject *(*__pyx_t_18)(PyObject *);
- PyObject *(*__pyx_t_19)(PyObject *);
- __Pyx_RefNannyDeclarations
- #if CYTHON_REFNANNY
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- #endif
- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__netCDF4(void)", 0);
- if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
- #ifdef __Pyx_CyFunction_USED
- if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_StopAsyncIteration_USED
- if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4("_netCDF4", __pyx_methods, __pyx_k_Version_1_2_7_Introduction_netc, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
- Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
- #if CYTHON_COMPILING_IN_PYPY
- Py_INCREF(__pyx_b);
- #endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
- /*--- Initialize various global constants etc. ---*/
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- if (__pyx_module_is_main_netCDF4___netCDF4) {
- if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
- if (!PyDict_GetItemString(modules, "netCDF4._netCDF4")) {
- if (unlikely(PyDict_SetItemString(modules, "netCDF4._netCDF4", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- }
- #endif
- /*--- Builtin init code ---*/
- if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Constants init code ---*/
- if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Global init code ---*/
- /*--- Variable export code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- __pyx_ptype_7netCDF4_8_netCDF4_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_7netCDF4_8_netCDF4_ndarray)) __PYX_ERR(1, 723, __pyx_L1_error)
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_Dataset) < 0) __PYX_ERR(0, 1591, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_Dataset.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Dataset, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1591, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_7Dataset___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_7Dataset___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_7Dataset___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_7Dataset___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "Dataset", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Dataset) < 0) __PYX_ERR(0, 1591, __pyx_L1_error)
- if (__pyx_type_7netCDF4_8_netCDF4_Dataset.tp_weaklistoffset == 0) __pyx_type_7netCDF4_8_netCDF4_Dataset.tp_weaklistoffset = offsetof(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset, __weakref__);
- __pyx_ptype_7netCDF4_8_netCDF4_Dataset = &__pyx_type_7netCDF4_8_netCDF4_Dataset;
- __pyx_type_7netCDF4_8_netCDF4_Group.tp_base = __pyx_ptype_7netCDF4_8_netCDF4_Dataset;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_Group) < 0) __PYX_ERR(0, 2604, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_Group.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Group, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2604, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_5Group___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_5Group___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_5Group___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_5Group___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "Group", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Group) < 0) __PYX_ERR(0, 2604, __pyx_L1_error)
- if (__pyx_type_7netCDF4_8_netCDF4_Group.tp_weaklistoffset == 0) __pyx_type_7netCDF4_8_netCDF4_Group.tp_weaklistoffset = offsetof(struct __pyx_obj_7netCDF4_8_netCDF4_Group, __pyx_base.__weakref__);
- __pyx_ptype_7netCDF4_8_netCDF4_Group = &__pyx_type_7netCDF4_8_netCDF4_Group;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_Dimension) < 0) __PYX_ERR(0, 2699, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_Dimension.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Dimension, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2699, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_9Dimension___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_9Dimension___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_9Dimension___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_9Dimension___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "Dimension", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Dimension) < 0) __PYX_ERR(0, 2699, __pyx_L1_error)
- __pyx_ptype_7netCDF4_8_netCDF4_Dimension = &__pyx_type_7netCDF4_8_netCDF4_Dimension;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_Variable) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_Variable.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Variable, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2860, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_8Variable___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_8Variable___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_8Variable___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_8Variable___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "Variable", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_Variable) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
- __pyx_ptype_7netCDF4_8_netCDF4_Variable = &__pyx_type_7netCDF4_8_netCDF4_Variable;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_CompoundType) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_CompoundType.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_CompoundType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4567, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_12CompoundType___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_12CompoundType___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_12CompoundType___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_12CompoundType___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "CompoundType", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_CompoundType) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
- __pyx_ptype_7netCDF4_8_netCDF4_CompoundType = &__pyx_type_7netCDF4_8_netCDF4_CompoundType;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_VLType) < 0) __PYX_ERR(0, 4816, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_VLType.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_VLType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4816, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_6VLType___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_6VLType___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_6VLType___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_6VLType___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "VLType", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_VLType) < 0) __PYX_ERR(0, 4816, __pyx_L1_error)
- __pyx_ptype_7netCDF4_8_netCDF4_VLType = &__pyx_type_7netCDF4_8_netCDF4_VLType;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4_EnumType) < 0) __PYX_ERR(0, 4934, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4_EnumType.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7netCDF4_8_netCDF4_EnumType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4934, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_7netCDF4_8_netCDF4_8EnumType___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_7netCDF4_8_netCDF4_8EnumType___init__.doc = __pyx_doc_7netCDF4_8_netCDF4_8EnumType___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7netCDF4_8_netCDF4_8EnumType___init__;
- }
- }
- #endif
- if (PyObject_SetAttrString(__pyx_m, "EnumType", (PyObject *)&__pyx_type_7netCDF4_8_netCDF4_EnumType) < 0) __PYX_ERR(0, 4934, __pyx_L1_error)
- __pyx_ptype_7netCDF4_8_netCDF4_EnumType = &__pyx_type_7netCDF4_8_netCDF4_EnumType;
- if (PyType_Ready(&__pyx_type_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
- __pyx_type_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr.tp_print = 0;
- __pyx_ptype_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr = &__pyx_type_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr;
- /*--- Type import code ---*/
- /*--- Variable import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
- #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
-
- /* "netCDF4/_netCDF4.pyx":923
- *
- * # pure python utilities
- * from .utils import (_StartCountStride, _quantize, _find_dim, _walk_grps, # <<<<<<<<<<<<<<
- * _out_array_shape, _sortbylist, _tostr)
- * # try to use built-in ordered dict in python >= 2.7
- */
- __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_n_s_StartCountStride);
- __Pyx_GIVEREF(__pyx_n_s_StartCountStride);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StartCountStride);
- __Pyx_INCREF(__pyx_n_s_quantize);
- __Pyx_GIVEREF(__pyx_n_s_quantize);
- PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_quantize);
- __Pyx_INCREF(__pyx_n_s_find_dim);
- __Pyx_GIVEREF(__pyx_n_s_find_dim);
- PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_find_dim);
- __Pyx_INCREF(__pyx_n_s_walk_grps);
- __Pyx_GIVEREF(__pyx_n_s_walk_grps);
- PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_walk_grps);
- __Pyx_INCREF(__pyx_n_s_out_array_shape);
- __Pyx_GIVEREF(__pyx_n_s_out_array_shape);
- PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_out_array_shape);
- __Pyx_INCREF(__pyx_n_s_sortbylist);
- __Pyx_GIVEREF(__pyx_n_s_sortbylist);
- PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_sortbylist);
- __Pyx_INCREF(__pyx_n_s_tostr);
- __Pyx_GIVEREF(__pyx_n_s_tostr);
- PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_tostr);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StartCountStride); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_StartCountStride, __pyx_t_1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_quantize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_quantize, __pyx_t_1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_find_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_dim, __pyx_t_1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_walk_grps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_walk_grps, __pyx_t_1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_out_array_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_out_array_shape, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sortbylist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sortbylist, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tostr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_tostr, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":926
- * _out_array_shape, _sortbylist, _tostr)
- * # try to use built-in ordered dict in python >= 2.7
- * try: # <<<<<<<<<<<<<<
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_5);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":927
- * # try to use built-in ordered dict in python >= 2.7
- * try:
- * from collections import OrderedDict # <<<<<<<<<<<<<<
- * except ImportError: # or else use drop-in substitute
- * try:
- */
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_OrderedDict);
- __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_OrderedDict);
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_2) < 0) __PYX_ERR(0, 927, __pyx_L2_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":926
- * _out_array_shape, _sortbylist, _tostr)
- * # try to use built-in ordered dict in python >= 2.7
- * try: # <<<<<<<<<<<<<<
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- */
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L9_try_end;
- __pyx_L2_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":928
- * try:
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute # <<<<<<<<<<<<<<
- * try:
- * from ordereddict import OrderedDict
- */
- __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_6) {
- __Pyx_AddTraceback("netCDF4._netCDF4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 928, __pyx_L4_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netCDF4/_netCDF4.pyx":929
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- * try: # <<<<<<<<<<<<<<
- * from ordereddict import OrderedDict
- * except ImportError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
- __Pyx_XGOTREF(__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_10);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":930
- * except ImportError: # or else use drop-in substitute
- * try:
- * from ordereddict import OrderedDict # <<<<<<<<<<<<<<
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- */
- __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 930, __pyx_L12_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_n_s_OrderedDict);
- __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_OrderedDict);
- __pyx_t_12 = __Pyx_Import(__pyx_n_s_ordereddict, __pyx_t_11, -1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 930, __pyx_L12_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 930, __pyx_L12_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_11) < 0) __PYX_ERR(0, 930, __pyx_L12_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":929
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- * try: # <<<<<<<<<<<<<<
- * from ordereddict import OrderedDict
- * except ImportError:
- */
- }
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L19_try_end;
- __pyx_L12_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-
- /* "netCDF4/_netCDF4.pyx":931
- * try:
- * from ordereddict import OrderedDict
- * except ImportError: # <<<<<<<<<<<<<<
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- * try:
- */
- __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_6) {
- __Pyx_AddTraceback("netCDF4._netCDF4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_13) < 0) __PYX_ERR(0, 931, __pyx_L14_except_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GOTREF(__pyx_t_13);
-
- /* "netCDF4/_netCDF4.pyx":932
- * from ordereddict import OrderedDict
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)') # <<<<<<<<<<<<<<
- * try:
- * from itertools import izip as zip
- */
- __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 932, __pyx_L14_except_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_Raise(__pyx_t_14, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __PYX_ERR(0, 932, __pyx_L14_except_error)
- }
- goto __pyx_L14_except_error;
- __pyx_L14_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":929
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- * try: # <<<<<<<<<<<<<<
- * from ordereddict import OrderedDict
- * except ImportError:
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
- goto __pyx_L4_except_error;
- __pyx_L19_try_end:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L3_exception_handled;
- }
- goto __pyx_L4_except_error;
- __pyx_L4_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":926
- * _out_array_shape, _sortbylist, _tostr)
- * # try to use built-in ordered dict in python >= 2.7
- * try: # <<<<<<<<<<<<<<
- * from collections import OrderedDict
- * except ImportError: # or else use drop-in substitute
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L1_error;
- __pyx_L3_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- __pyx_L9_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":933
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_3);
- /*try:*/ {
-
- /* "netCDF4/_netCDF4.pyx":934
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- * try:
- * from itertools import izip as zip # <<<<<<<<<<<<<<
- * except ImportError:
- * # python3: zip is already python2's itertools.izip
- */
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 934, __pyx_L22_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_n_s_izip);
- __Pyx_GIVEREF(__pyx_n_s_izip);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_izip);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_7, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 934, __pyx_L22_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_izip); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 934, __pyx_L22_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip, __pyx_t_7) < 0) __PYX_ERR(0, 934, __pyx_L22_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":933
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError:
- */
- }
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L29_try_end;
- __pyx_L22_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __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_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":935
- * try:
- * from itertools import izip as zip
- * except ImportError: # <<<<<<<<<<<<<<
- * # python3: zip is already python2's itertools.izip
- * pass
- */
- __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_6) {
- __Pyx_ErrRestore(0,0,0);
- goto __pyx_L23_exception_handled;
- }
- goto __pyx_L24_except_error;
- __pyx_L24_except_error:;
-
- /* "netCDF4/_netCDF4.pyx":933
- * except ImportError:
- * raise ImportError('please install ordereddict (https://pypi.python.org/pypi/ordereddict)')
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError:
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
- goto __pyx_L1_error;
- __pyx_L23_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
- __pyx_L29_try_end:;
- }
-
- /* "netCDF4/_netCDF4.pyx":939
- * pass
- *
- * __version__ = "1.2.7" # <<<<<<<<<<<<<<
- *
- * # Initialize numpy
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_1_2_7) < 0) __PYX_ERR(0, 939, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":942
- *
- * # Initialize numpy
- * import posixpath # <<<<<<<<<<<<<<
- * import netcdftime
- * import numpy
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_posixpath, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_posixpath, __pyx_t_2) < 0) __PYX_ERR(0, 942, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":943
- * # Initialize numpy
- * import posixpath
- * import netcdftime # <<<<<<<<<<<<<<
- * import numpy
- * import weakref
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_netcdftime, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_netcdftime, __pyx_t_2) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":944
- * import posixpath
- * import netcdftime
- * import numpy # <<<<<<<<<<<<<<
- * import weakref
- * import sys
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_2) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":945
- * import netcdftime
- * import numpy
- * import weakref # <<<<<<<<<<<<<<
- * import sys
- * import warnings
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_2) < 0) __PYX_ERR(0, 945, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":946
- * import numpy
- * import weakref
- * import sys # <<<<<<<<<<<<<<
- * import warnings
- * from glob import glob
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 946, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":947
- * import weakref
- * import sys
- * import warnings # <<<<<<<<<<<<<<
- * from glob import glob
- * from numpy import ma
- */
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 947, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":948
- * import sys
- * import warnings
- * from glob import glob # <<<<<<<<<<<<<<
- * from numpy import ma
- * from libc.string cimport memcpy
- */
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_glob);
- __Pyx_GIVEREF(__pyx_n_s_glob);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_glob);
- __pyx_t_7 = __Pyx_Import(__pyx_n_s_glob, __pyx_t_2, -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_glob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_glob, __pyx_t_2) < 0) __PYX_ERR(0, 948, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":949
- * import warnings
- * from glob import glob
- * from numpy import ma # <<<<<<<<<<<<<<
- * from libc.string cimport memcpy
- * from libc.stdlib cimport malloc, free
- */
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_n_s_ma);
- __Pyx_GIVEREF(__pyx_n_s_ma);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_ma);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_7, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ma); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ma, __pyx_t_7) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":952
- * from libc.string cimport memcpy
- * from libc.stdlib cimport malloc, free
- * import_array() # <<<<<<<<<<<<<<
- * include "netCDF4.pxi"
- * include "constants.pyx"
- */
- import_array();
-
- /* "netCDF4/_netCDF4.pyx":958
- * # check for required version of netcdf-4 and hdf5.
- *
- * def _gethdf5libversion(): # <<<<<<<<<<<<<<
- * majorvers = H5_VERS_MAJOR
- * minorvers = H5_VERS_MINOR
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_1_gethdf5libversion, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_gethdf5libversion, __pyx_t_2) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":968
- * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring)
- *
- * def getlibversion(): # <<<<<<<<<<<<<<
- * """
- * **`getlibversion()`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_3getlibversion, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_getlibversion, __pyx_t_2) < 0) __PYX_ERR(0, 968, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":977
- * return (<char *>nc_inq_libvers()).decode('ascii')
- *
- * __netcdf4libversion__ = getlibversion().split()[0] # <<<<<<<<<<<<<<
- * __hdf5libversion__ = _gethdf5libversion()
- * __has_rename_grp__ = HAS_RENAME_GRP
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlibversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_13 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- }
- }
- if (__pyx_t_13) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- } else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
- }
- }
- if (__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_netcdf4libversion, __pyx_t_1) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":978
- *
- * __netcdf4libversion__ = getlibversion().split()[0]
- * __hdf5libversion__ = _gethdf5libversion() # <<<<<<<<<<<<<<
- * __has_rename_grp__ = HAS_RENAME_GRP
- * __has_nc_inq_path__ = HAS_NC_INQ_PATH
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gethdf5libversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __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_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_hdf5libversion, __pyx_t_1) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":979
- * __netcdf4libversion__ = getlibversion().split()[0]
- * __hdf5libversion__ = _gethdf5libversion()
- * __has_rename_grp__ = HAS_RENAME_GRP # <<<<<<<<<<<<<<
- * __has_nc_inq_path__ = HAS_NC_INQ_PATH
- * __has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_rename_grp, __pyx_int_0) < 0) __PYX_ERR(0, 979, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":980
- * __hdf5libversion__ = _gethdf5libversion()
- * __has_rename_grp__ = HAS_RENAME_GRP
- * __has_nc_inq_path__ = HAS_NC_INQ_PATH # <<<<<<<<<<<<<<
- * __has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED
- * __has_cdf5__ = HAS_CDF5_FORMAT
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_nc_inq_path, __pyx_int_0) < 0) __PYX_ERR(0, 980, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":981
- * __has_rename_grp__ = HAS_RENAME_GRP
- * __has_nc_inq_path__ = HAS_NC_INQ_PATH
- * __has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED # <<<<<<<<<<<<<<
- * __has_cdf5__ = HAS_CDF5_FORMAT
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_nc_inq_format_extended, __pyx_int_0) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":982
- * __has_nc_inq_path__ = HAS_NC_INQ_PATH
- * __has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED
- * __has_cdf5__ = HAS_CDF5_FORMAT # <<<<<<<<<<<<<<
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
- * (__netcdf4libversion__.startswith("4.4.0") and \
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_cdf5, __pyx_int_0) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":983
- * __has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED
- * __has_cdf5__ = HAS_CDF5_FORMAT
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \ # <<<<<<<<<<<<<<
- * (__netcdf4libversion__.startswith("4.4.0") and \
- * "-development" in __netcdf4libversion__)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_4_4_0, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 983, __pyx_L1_error)
- if (!__pyx_t_15) {
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_7);
- __pyx_t_1 = __pyx_t_7;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L30_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":984
- * __has_cdf5__ = HAS_CDF5_FORMAT
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
- * (__netcdf4libversion__.startswith("4.4.0") and \ # <<<<<<<<<<<<<<
- * "-development" in __netcdf4libversion__)
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
- if (__pyx_t_15) {
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_7);
- __pyx_t_1 = __pyx_t_7;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L30_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":985
- * _needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
- * (__netcdf4libversion__.startswith("4.4.0") and \
- * "-development" in __netcdf4libversion__) # <<<<<<<<<<<<<<
- *
- * # issue warning for hdf5 1.10 (issue #549)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_15 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_development, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_L30_bool_binop_done:;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_needsworkaround_issue485, __pyx_t_1) < 0) __PYX_ERR(0, 983, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":988
- *
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\ # <<<<<<<<<<<<<<
- * __hdf5libversion__.startswith("1.10"):
- * msg = """
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 5, NULL, NULL, &__pyx_slice__134, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 988, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_kp_s_4_4_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 988, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_16) {
- } else {
- __pyx_t_15 = __pyx_t_16;
- goto __pyx_L34_bool_binop_done;
- }
-
- /* "netCDF4/_netCDF4.pyx":989
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\
- * __hdf5libversion__.startswith("1.10"): # <<<<<<<<<<<<<<
- * msg = """
- * WARNING: Backwards incompatible files will be created with HDF5 1.10.x
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hdf5libversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_startswith); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_15 = __pyx_t_16;
- __pyx_L34_bool_binop_done:;
-
- /* "netCDF4/_netCDF4.pyx":988
- *
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\ # <<<<<<<<<<<<<<
- * __hdf5libversion__.startswith("1.10"):
- * msg = """
- */
- if (__pyx_t_15) {
-
- /* "netCDF4/_netCDF4.pyx":990
- * if __netcdf4libversion__[0:5] < "4.4.1" and\
- * __hdf5libversion__.startswith("1.10"):
- * msg = """ # <<<<<<<<<<<<<<
- * WARNING: Backwards incompatible files will be created with HDF5 1.10.x
- * and netCDF < 4.4.1. Upgrading to netCDF4 >= 4.4.1 or downgrading to
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_msg, __pyx_kp_s_WARNING_Backwards_incompatible) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":995
- * to HDF5 version 1.8.x is highly recommended
- * (see https://github.com/Unidata/netcdf-c/issues/250)."""
- * warnings.warn(msg) # <<<<<<<<<<<<<<
- *
- * # numpy data type <--> netCDF 4 data type mapping.
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_msg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- if (!__pyx_t_13) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); __pyx_t_13 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":988
- *
- * # issue warning for hdf5 1.10 (issue #549)
- * if __netcdf4libversion__[0:5] < "4.4.1" and\ # <<<<<<<<<<<<<<
- * __hdf5libversion__.startswith("1.10"):
- * msg = """
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":998
- *
- * # numpy data type <--> netCDF 4 data type mapping.
- * _nptonctype = {'S1' : NC_CHAR, # <<<<<<<<<<<<<<
- * 'i1' : NC_BYTE,
- * 'u1' : NC_UBYTE,
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_CHAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_S1, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":999
- * # numpy data type <--> netCDF 4 data type mapping.
- * _nptonctype = {'S1' : NC_CHAR,
- * 'i1' : NC_BYTE, # <<<<<<<<<<<<<<
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_BYTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i1, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1000
- * _nptonctype = {'S1' : NC_CHAR,
- * 'i1' : NC_BYTE,
- * 'u1' : NC_UBYTE, # <<<<<<<<<<<<<<
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UBYTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u1, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1001
- * 'i1' : NC_BYTE,
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT, # <<<<<<<<<<<<<<
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_SHORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i2, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1002
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT, # <<<<<<<<<<<<<<
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_USHORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u2, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1003
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT, # <<<<<<<<<<<<<<
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_INT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i4, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1004
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT, # <<<<<<<<<<<<<<
- * 'i8' : NC_INT64,
- * 'u8' : NC_UINT64,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UINT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u4, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1005
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64, # <<<<<<<<<<<<<<
- * 'u8' : NC_UINT64,
- * 'f4' : NC_FLOAT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_INT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i8, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1006
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64,
- * 'u8' : NC_UINT64, # <<<<<<<<<<<<<<
- * 'f4' : NC_FLOAT,
- * 'f8' : NC_DOUBLE}
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UINT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u8, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1007
- * 'i8' : NC_INT64,
- * 'u8' : NC_UINT64,
- * 'f4' : NC_FLOAT, # <<<<<<<<<<<<<<
- * 'f8' : NC_DOUBLE}
- *
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f4, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1008
- * 'u8' : NC_UINT64,
- * 'f4' : NC_FLOAT,
- * 'f8' : NC_DOUBLE} # <<<<<<<<<<<<<<
- *
- * # just integer types.
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f8, __pyx_t_2) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_nptonctype, __pyx_t_1) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1011
- *
- * # just integer types.
- * _intnptonctype = {'i1' : NC_BYTE, # <<<<<<<<<<<<<<
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT,
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_BYTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i1, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1012
- * # just integer types.
- * _intnptonctype = {'i1' : NC_BYTE,
- * 'u1' : NC_UBYTE, # <<<<<<<<<<<<<<
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UBYTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u1, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1013
- * _intnptonctype = {'i1' : NC_BYTE,
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT, # <<<<<<<<<<<<<<
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_SHORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i2, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1014
- * 'u1' : NC_UBYTE,
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT, # <<<<<<<<<<<<<<
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_USHORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u2, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1015
- * 'i2' : NC_SHORT,
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT, # <<<<<<<<<<<<<<
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_INT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i4, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1016
- * 'u2' : NC_USHORT,
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT, # <<<<<<<<<<<<<<
- * 'i8' : NC_INT64,
- * 'u8' : NC_UINT64}
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UINT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u4, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1017
- * 'i4' : NC_INT,
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64, # <<<<<<<<<<<<<<
- * 'u8' : NC_UINT64}
- *
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_INT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i8, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1018
- * 'u4' : NC_UINT,
- * 'i8' : NC_INT64,
- * 'u8' : NC_UINT64} # <<<<<<<<<<<<<<
- *
- * # create dictionary mapping string identifiers to netcdf format codes
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_UINT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u8, __pyx_t_2) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_intnptonctype, __pyx_t_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1021
- *
- * # create dictionary mapping string identifiers to netcdf format codes
- * _format_dict = {'NETCDF3_CLASSIC' : NC_FORMAT_CLASSIC, # <<<<<<<<<<<<<<
- * 'NETCDF4_CLASSIC' : NC_FORMAT_NETCDF4_CLASSIC,
- * 'NETCDF4' : NC_FORMAT_NETCDF4}
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_FORMAT_CLASSIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_NETCDF3_CLASSIC, __pyx_t_2) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1022
- * # create dictionary mapping string identifiers to netcdf format codes
- * _format_dict = {'NETCDF3_CLASSIC' : NC_FORMAT_CLASSIC,
- * 'NETCDF4_CLASSIC' : NC_FORMAT_NETCDF4_CLASSIC, # <<<<<<<<<<<<<<
- * 'NETCDF4' : NC_FORMAT_NETCDF4}
- * IF HAS_CDF5_FORMAT:
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_FORMAT_NETCDF4_CLASSIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_NETCDF4_CLASSIC, __pyx_t_2) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1023
- * _format_dict = {'NETCDF3_CLASSIC' : NC_FORMAT_CLASSIC,
- * 'NETCDF4_CLASSIC' : NC_FORMAT_NETCDF4_CLASSIC,
- * 'NETCDF4' : NC_FORMAT_NETCDF4} # <<<<<<<<<<<<<<
- * IF HAS_CDF5_FORMAT:
- * # NETCDF3_64BIT deprecated, saved for compatibility.
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_FORMAT_NETCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_NETCDF4, __pyx_t_2) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_dict, __pyx_t_1) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1030
- * _format_dict['NETCDF3_64BIT_DATA'] = NC_FORMAT_64BIT_DATA
- * ELSE:
- * _format_dict['NETCDF3_64BIT'] = NC_FORMAT_64BIT # <<<<<<<<<<<<<<
- * # invert dictionary mapping
- * _reverse_format_dict = dict((v, k) for k, v in _format_dict.iteritems())
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(NC_FORMAT_64BIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_NETCDF3_64BIT, __pyx_t_1) < 0)) __PYX_ERR(0, 1030, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1032
- * _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:
- */
- __pyx_t_1 = __pyx_pf_7netCDF4_8_netCDF4_22genexpr(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_reverse_format_dict, __pyx_t_2) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1037
- * _format_dict['NETCDF3_64BIT'] = NC_FORMAT_64BIT_OFFSET
- * ELSE:
- * _format_dict['NETCDF3_64BIT_OFFSET'] = NC_FORMAT_64BIT # <<<<<<<<<<<<<<
- *
- * # default fill_value to numpy datatype mapping.
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(NC_FORMAT_64BIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_NETCDF3_64BIT_OFFSET, __pyx_t_2) < 0)) __PYX_ERR(0, 1037, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1041
- * # default fill_value to numpy datatype mapping.
- * default_fillvals = {#'S1':NC_FILL_CHAR,
- * 'S1':'\0', # <<<<<<<<<<<<<<
- * 'i1':NC_FILL_BYTE,
- * 'u1':NC_FILL_UBYTE,
- */
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_S1, __pyx_kp_s_) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1042
- * default_fillvals = {#'S1':NC_FILL_CHAR,
- * 'S1':'\0',
- * 'i1':NC_FILL_BYTE, # <<<<<<<<<<<<<<
- * 'u1':NC_FILL_UBYTE,
- * 'i2':NC_FILL_SHORT,
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(NC_FILL_BYTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i1, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1043
- * 'S1':'\0',
- * 'i1':NC_FILL_BYTE,
- * 'u1':NC_FILL_UBYTE, # <<<<<<<<<<<<<<
- * 'i2':NC_FILL_SHORT,
- * 'u2':NC_FILL_USHORT,
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(NC_FILL_UBYTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u1, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1044
- * 'i1':NC_FILL_BYTE,
- * 'u1':NC_FILL_UBYTE,
- * 'i2':NC_FILL_SHORT, # <<<<<<<<<<<<<<
- * 'u2':NC_FILL_USHORT,
- * 'i4':NC_FILL_INT,
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(NC_FILL_SHORT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i2, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1045
- * 'u1':NC_FILL_UBYTE,
- * 'i2':NC_FILL_SHORT,
- * 'u2':NC_FILL_USHORT, # <<<<<<<<<<<<<<
- * 'i4':NC_FILL_INT,
- * 'u4':NC_FILL_UINT,
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(NC_FILL_USHORT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u2, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1046
- * 'i2':NC_FILL_SHORT,
- * 'u2':NC_FILL_USHORT,
- * 'i4':NC_FILL_INT, # <<<<<<<<<<<<<<
- * 'u4':NC_FILL_UINT,
- * 'i8':NC_FILL_INT64,
- */
- __pyx_t_1 = __Pyx_PyInt_From_long(NC_FILL_INT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i4, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1047
- * 'u2':NC_FILL_USHORT,
- * 'i4':NC_FILL_INT,
- * 'u4':NC_FILL_UINT, # <<<<<<<<<<<<<<
- * 'i8':NC_FILL_INT64,
- * 'u8':NC_FILL_UINT64,
- */
- __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(NC_FILL_UINT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u4, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1048
- * 'i4':NC_FILL_INT,
- * 'u4':NC_FILL_UINT,
- * 'i8':NC_FILL_INT64, # <<<<<<<<<<<<<<
- * 'u8':NC_FILL_UINT64,
- * 'f4':NC_FILL_FLOAT,
- */
- __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(NC_FILL_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i8, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1049
- * 'u4':NC_FILL_UINT,
- * 'i8':NC_FILL_INT64,
- * 'u8':NC_FILL_UINT64, # <<<<<<<<<<<<<<
- * 'f4':NC_FILL_FLOAT,
- * 'f8':NC_FILL_DOUBLE}
- */
- __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(NC_FILL_UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u8, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1050
- * 'i8':NC_FILL_INT64,
- * 'u8':NC_FILL_UINT64,
- * 'f4':NC_FILL_FLOAT, # <<<<<<<<<<<<<<
- * 'f8':NC_FILL_DOUBLE}
- *
- */
- __pyx_t_1 = PyFloat_FromDouble(NC_FILL_FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f4, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1051
- * 'u8':NC_FILL_UINT64,
- * 'f4':NC_FILL_FLOAT,
- * 'f8':NC_FILL_DOUBLE} # <<<<<<<<<<<<<<
- *
- * # logical for native endian type.
- */
- __pyx_t_1 = PyFloat_FromDouble(NC_FILL_DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f8, __pyx_t_1) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_fillvals, __pyx_t_2) < 0) __PYX_ERR(0, 1040, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1054
- *
- * # logical for native endian type.
- * is_native_little = numpy.dtype('<f4').byteorder == '=' # <<<<<<<<<<<<<<
- * is_native_big = numpy.dtype('>f4').byteorder == '='
- *
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __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_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_s__36, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_native_little, __pyx_t_2) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1055
- * # logical for native endian type.
- * is_native_little = numpy.dtype('<f4').byteorder == '='
- * is_native_big = numpy.dtype('>f4').byteorder == '=' # <<<<<<<<<<<<<<
- *
- * # hard code this here, instead of importing from netcdf.h
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __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_byteorder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_s__36, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_native_big, __pyx_t_2) < 0) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1059
- * # hard code this here, instead of importing from netcdf.h
- * # so it will compile with versions <= 4.2.
- * NC_DISKLESS = 0x0008 # <<<<<<<<<<<<<<
- * # encoding used to convert strings to bytes when writing text data
- * # to the netcdf file, and for converting bytes to strings when reading
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_NC_DISKLESS, __pyx_int_8) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1063
- * # to the netcdf file, and for converting bytes to strings when reading
- * # from the netcdf file.
- * default_encoding = 'utf-8' # <<<<<<<<<<<<<<
- * # unicode decode/encode error handling. Replace bad chars with "?"
- * # can be set to 'strict' or 'ignore'.
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_encoding, __pyx_kp_s_utf_8) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1066
- * # unicode decode/encode error handling. Replace bad chars with "?"
- * # can be set to 'strict' or 'ignore'.
- * unicode_error = 'replace' # <<<<<<<<<<<<<<
- * python3 = sys.version_info[0] > 2
- * if python3:
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode_error, __pyx_n_s_replace) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1067
- * # can be set to 'strict' or 'ignore'.
- * unicode_error = 'replace'
- * python3 = sys.version_info[0] > 2 # <<<<<<<<<<<<<<
- * if python3:
- * buffer = memoryview
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_python3, __pyx_t_1) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1068
- * unicode_error = 'replace'
- * python3 = sys.version_info[0] > 2
- * if python3: # <<<<<<<<<<<<<<
- * buffer = memoryview
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1068, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_15) {
-
- /* "netCDF4/_netCDF4.pyx":1069
- * python3 = sys.version_info[0] > 2
- * if python3:
- * buffer = memoryview # <<<<<<<<<<<<<<
- *
- * _nctonptype = {}
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_buffer, __pyx_builtin_memoryview) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
-
- /* "netCDF4/_netCDF4.pyx":1068
- * unicode_error = 'replace'
- * python3 = sys.version_info[0] > 2
- * if python3: # <<<<<<<<<<<<<<
- * buffer = memoryview
- *
- */
- }
-
- /* "netCDF4/_netCDF4.pyx":1071
- * buffer = memoryview
- *
- * _nctonptype = {} # <<<<<<<<<<<<<<
- * for _key,_value in _nptonctype.items():
- * _nctonptype[_value] = _key
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_nctonptype, __pyx_t_1) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1072
- *
- * _nctonptype = {}
- * for _key,_value in _nptonctype.items(): # <<<<<<<<<<<<<<
- * _nctonptype[_value] = _key
- * _supportedtypes = _nptonctype.keys()
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_2)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_17 = 0;
- __pyx_t_18 = NULL;
- } else {
- __pyx_t_17 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_18 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1072, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_18)) {
- if (likely(PyList_CheckExact(__pyx_t_11))) {
- if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 1072, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_17); __Pyx_INCREF(__pyx_t_1); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 1072, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_18(__pyx_t_11);
- 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_ERR(0, 1072, __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_ERR(0, 1072, __pyx_L1_error)
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1072, __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_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_19 = Py_TYPE(__pyx_t_13)->tp_iternext;
- index = 0; __pyx_t_2 = __pyx_t_19(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L39_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_2);
- index = 1; __pyx_t_7 = __pyx_t_19(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L39_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_13), 2) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
- __pyx_t_19 = NULL;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- goto __pyx_L40_unpacking_done;
- __pyx_L39_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_19 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 1072, __pyx_L1_error)
- __pyx_L40_unpacking_done:;
- }
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_value_2, __pyx_t_7) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1073
- * _nctonptype = {}
- * for _key,_value in _nptonctype.items():
- * _nctonptype[_value] = _key # <<<<<<<<<<<<<<
- * _supportedtypes = _nptonctype.keys()
- * # make sure NC_CHAR points to S1
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_value_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 1073, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1072
- *
- * _nctonptype = {}
- * for _key,_value in _nptonctype.items(): # <<<<<<<<<<<<<<
- * _nctonptype[_value] = _key
- * _supportedtypes = _nptonctype.keys()
- */
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1074
- * for _key,_value in _nptonctype.items():
- * _nctonptype[_value] = _key
- * _supportedtypes = _nptonctype.keys() # <<<<<<<<<<<<<<
- * # make sure NC_CHAR points to S1
- * _nctonptype[NC_CHAR]='S1'
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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_11 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1074, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1074, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_supportedtypes, __pyx_t_11) < 0) __PYX_ERR(0, 1074, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1076
- * _supportedtypes = _nptonctype.keys()
- * # make sure NC_CHAR points to S1
- * _nctonptype[NC_CHAR]='S1' # <<<<<<<<<<<<<<
- *
- * # internal C functions.
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1076, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(__Pyx_SetItemInt(__pyx_t_11, NC_CHAR, __pyx_n_s_S1, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 1076, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1183
- * return value_arr
- *
- * def _set_default_format(object format='NETCDF4'): # <<<<<<<<<<<<<<
- * # Private function to set the netCDF file format
- * if format not in _format_dict:
- */
- __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_5_set_default_format, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1183, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_format, __pyx_t_11) < 0) __PYX_ERR(0, 1183, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1585
- *
- * _private_atts =\
- * ['_grpid','_grp','_varid','groups','dimensions','variables','dtype','data_model','disk_format', # <<<<<<<<<<<<<<
- * '_nunlimdim','path','parent','ndim','mask','scale','cmptypes','vltypes','enumtypes','_isprimitive',
- * 'file_format','_isvlen','_isenum','_iscompound','_cmptype','_vltype','_enumtype','name',
- */
- __pyx_t_11 = PyList_New(30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1585, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_n_s_grpid);
- __Pyx_GIVEREF(__pyx_n_s_grpid);
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_grpid);
- __Pyx_INCREF(__pyx_n_s_grp_2);
- __Pyx_GIVEREF(__pyx_n_s_grp_2);
- PyList_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_grp_2);
- __Pyx_INCREF(__pyx_n_s_varid);
- __Pyx_GIVEREF(__pyx_n_s_varid);
- PyList_SET_ITEM(__pyx_t_11, 2, __pyx_n_s_varid);
- __Pyx_INCREF(__pyx_n_s_groups);
- __Pyx_GIVEREF(__pyx_n_s_groups);
- PyList_SET_ITEM(__pyx_t_11, 3, __pyx_n_s_groups);
- __Pyx_INCREF(__pyx_n_s_dimensions);
- __Pyx_GIVEREF(__pyx_n_s_dimensions);
- PyList_SET_ITEM(__pyx_t_11, 4, __pyx_n_s_dimensions);
- __Pyx_INCREF(__pyx_n_s_variables);
- __Pyx_GIVEREF(__pyx_n_s_variables);
- PyList_SET_ITEM(__pyx_t_11, 5, __pyx_n_s_variables);
- __Pyx_INCREF(__pyx_n_s_dtype);
- __Pyx_GIVEREF(__pyx_n_s_dtype);
- PyList_SET_ITEM(__pyx_t_11, 6, __pyx_n_s_dtype);
- __Pyx_INCREF(__pyx_n_s_data_model);
- __Pyx_GIVEREF(__pyx_n_s_data_model);
- PyList_SET_ITEM(__pyx_t_11, 7, __pyx_n_s_data_model);
- __Pyx_INCREF(__pyx_n_s_disk_format_2);
- __Pyx_GIVEREF(__pyx_n_s_disk_format_2);
- PyList_SET_ITEM(__pyx_t_11, 8, __pyx_n_s_disk_format_2);
- __Pyx_INCREF(__pyx_n_s_nunlimdim);
- __Pyx_GIVEREF(__pyx_n_s_nunlimdim);
- PyList_SET_ITEM(__pyx_t_11, 9, __pyx_n_s_nunlimdim);
- __Pyx_INCREF(__pyx_n_s_path);
- __Pyx_GIVEREF(__pyx_n_s_path);
- PyList_SET_ITEM(__pyx_t_11, 10, __pyx_n_s_path);
- __Pyx_INCREF(__pyx_n_s_parent);
- __Pyx_GIVEREF(__pyx_n_s_parent);
- PyList_SET_ITEM(__pyx_t_11, 11, __pyx_n_s_parent);
- __Pyx_INCREF(__pyx_n_s_ndim);
- __Pyx_GIVEREF(__pyx_n_s_ndim);
- PyList_SET_ITEM(__pyx_t_11, 12, __pyx_n_s_ndim);
- __Pyx_INCREF(__pyx_n_s_mask);
- __Pyx_GIVEREF(__pyx_n_s_mask);
- PyList_SET_ITEM(__pyx_t_11, 13, __pyx_n_s_mask);
- __Pyx_INCREF(__pyx_n_s_scale);
- __Pyx_GIVEREF(__pyx_n_s_scale);
- PyList_SET_ITEM(__pyx_t_11, 14, __pyx_n_s_scale);
- __Pyx_INCREF(__pyx_n_s_cmptypes);
- __Pyx_GIVEREF(__pyx_n_s_cmptypes);
- PyList_SET_ITEM(__pyx_t_11, 15, __pyx_n_s_cmptypes);
- __Pyx_INCREF(__pyx_n_s_vltypes);
- __Pyx_GIVEREF(__pyx_n_s_vltypes);
- PyList_SET_ITEM(__pyx_t_11, 16, __pyx_n_s_vltypes);
- __Pyx_INCREF(__pyx_n_s_enumtypes);
- __Pyx_GIVEREF(__pyx_n_s_enumtypes);
- PyList_SET_ITEM(__pyx_t_11, 17, __pyx_n_s_enumtypes);
- __Pyx_INCREF(__pyx_n_s_isprimitive);
- __Pyx_GIVEREF(__pyx_n_s_isprimitive);
- PyList_SET_ITEM(__pyx_t_11, 18, __pyx_n_s_isprimitive);
- __Pyx_INCREF(__pyx_n_s_file_format);
- __Pyx_GIVEREF(__pyx_n_s_file_format);
- PyList_SET_ITEM(__pyx_t_11, 19, __pyx_n_s_file_format);
- __Pyx_INCREF(__pyx_n_s_isvlen);
- __Pyx_GIVEREF(__pyx_n_s_isvlen);
- PyList_SET_ITEM(__pyx_t_11, 20, __pyx_n_s_isvlen);
- __Pyx_INCREF(__pyx_n_s_isenum);
- __Pyx_GIVEREF(__pyx_n_s_isenum);
- PyList_SET_ITEM(__pyx_t_11, 21, __pyx_n_s_isenum);
- __Pyx_INCREF(__pyx_n_s_iscompound);
- __Pyx_GIVEREF(__pyx_n_s_iscompound);
- PyList_SET_ITEM(__pyx_t_11, 22, __pyx_n_s_iscompound);
- __Pyx_INCREF(__pyx_n_s_cmptype);
- __Pyx_GIVEREF(__pyx_n_s_cmptype);
- PyList_SET_ITEM(__pyx_t_11, 23, __pyx_n_s_cmptype);
- __Pyx_INCREF(__pyx_n_s_vltype);
- __Pyx_GIVEREF(__pyx_n_s_vltype);
- PyList_SET_ITEM(__pyx_t_11, 24, __pyx_n_s_vltype);
- __Pyx_INCREF(__pyx_n_s_enumtype);
- __Pyx_GIVEREF(__pyx_n_s_enumtype);
- PyList_SET_ITEM(__pyx_t_11, 25, __pyx_n_s_enumtype);
- __Pyx_INCREF(__pyx_n_s_name);
- __Pyx_GIVEREF(__pyx_n_s_name);
- PyList_SET_ITEM(__pyx_t_11, 26, __pyx_n_s_name);
- __Pyx_INCREF(__pyx_n_s_orthogoral_indexing);
- __Pyx_GIVEREF(__pyx_n_s_orthogoral_indexing);
- PyList_SET_ITEM(__pyx_t_11, 27, __pyx_n_s_orthogoral_indexing);
- __Pyx_INCREF(__pyx_n_s_keepweakref);
- __Pyx_GIVEREF(__pyx_n_s_keepweakref);
- PyList_SET_ITEM(__pyx_t_11, 28, __pyx_n_s_keepweakref);
- __Pyx_INCREF(__pyx_n_s_has_lsd);
- __Pyx_GIVEREF(__pyx_n_s_has_lsd);
- PyList_SET_ITEM(__pyx_t_11, 29, __pyx_n_s_has_lsd);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_private_atts, __pyx_t_11) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1589
- * 'file_format','_isvlen','_isenum','_iscompound','_cmptype','_vltype','_enumtype','name',
- * '__orthogoral_indexing__','keepweakref','_has_lsd']
- * __pdoc__ = {} # <<<<<<<<<<<<<<
- *
- * cdef class Dataset:
- */
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1589, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_pdoc, __pyx_t_11) < 0) __PYX_ERR(0, 1589, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1665
- * keepweakref
- * # Docstrings for class variables (used by pdoc).
- * __pdoc__['Dataset.dimensions']=\ # <<<<<<<<<<<<<<
- * """The `dimensions` dictionary maps the names of
- * dimensions defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1665, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_dimensions, __pyx_kp_s_The_dimensions_dictionary_maps_t) < 0)) __PYX_ERR(0, 1665, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1669
- * dimensions defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- * `netCDF4.Dimension` class."""
- * __pdoc__['Dataset.variables']=\ # <<<<<<<<<<<<<<
- * """The `variables` dictionary maps the names of variables
- * defined for this `netCDF4.Dataset` or `netCDF4.Group` to instances of the `netCDF4.Variable`
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1669, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_variables, __pyx_kp_s_The_variables_dictionary_maps_th) < 0)) __PYX_ERR(0, 1669, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1673
- * defined for this `netCDF4.Dataset` or `netCDF4.Group` to instances of the `netCDF4.Variable`
- * class."""
- * __pdoc__['Dataset.groups']=\ # <<<<<<<<<<<<<<
- * """The groups dictionary maps the names of groups created for
- * this `netCDF4.Dataset` or `netCDF4.Group` to instances of the `netCDF4.Group` class (the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1673, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_groups, __pyx_kp_s_The_groups_dictionary_maps_the_n) < 0)) __PYX_ERR(0, 1673, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1678
- * `netCDF4.Dataset` class is simply a special case of the `netCDF4.Group` class which
- * describes the root group in the netCDF4 file)."""
- * __pdoc__['Dataset.cmptypes']=\ # <<<<<<<<<<<<<<
- * """The `cmptypes` dictionary maps the names of
- * compound types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1678, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_cmptypes, __pyx_kp_s_The_cmptypes_dictionary_maps_the) < 0)) __PYX_ERR(0, 1678, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1682
- * compound types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- * `netCDF4.CompoundType` class."""
- * __pdoc__['Dataset.vltypes']=\ # <<<<<<<<<<<<<<
- * """The `vltypes` dictionary maps the names of
- * variable-length types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1682, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_vltypes, __pyx_kp_s_The_vltypes_dictionary_maps_the) < 0)) __PYX_ERR(0, 1682, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1686
- * variable-length types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- * `netCDF4.VLType` class."""
- * __pdoc__['Dataset.enumtypes']=\ # <<<<<<<<<<<<<<
- * """The `enumtypes` dictionary maps the names of
- * Enum types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1686, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_enumtypes, __pyx_kp_s_The_enumtypes_dictionary_maps_th) < 0)) __PYX_ERR(0, 1686, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1690
- * Enum types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the
- * `netCDF4.EnumType` class."""
- * __pdoc__['Dataset.data_model']=\ # <<<<<<<<<<<<<<
- * """`data_model` describes the netCDF
- * data model version, one of `NETCDF3_CLASSIC`, `NETCDF4`,
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1690, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_data_model, __pyx_kp_s_data_model_describes_the_netCDF) < 0)) __PYX_ERR(0, 1690, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1694
- * data model version, one of `NETCDF3_CLASSIC`, `NETCDF4`,
- * `NETCDF4_CLASSIC`, `NETCDF3_64BIT_OFFSET` or `NETCDF3_64BIT_DATA`."""
- * __pdoc__['Dataset.file_format']=\ # <<<<<<<<<<<<<<
- * """same as `data_model`, retained for backwards compatibility."""
- * __pdoc__['Dataset.disk_format']=\
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1694, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_file_format, __pyx_kp_s_same_as_data_model_retained_for) < 0)) __PYX_ERR(0, 1694, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1696
- * __pdoc__['Dataset.file_format']=\
- * """same as `data_model`, retained for backwards compatibility."""
- * __pdoc__['Dataset.disk_format']=\ # <<<<<<<<<<<<<<
- * """`disk_format` describes the underlying
- * file format, one of `NETCDF3`, `HDF5`, `HDF4`,
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_disk_format, __pyx_kp_s_disk_format_describes_the_under) < 0)) __PYX_ERR(0, 1696, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1702
- * netcdf C library version >= 4.3.1, otherwise will always return
- * `UNDEFINED`."""
- * __pdoc__['Dataset.parent']=\ # <<<<<<<<<<<<<<
- * """`parent` is a reference to the parent
- * `netCDF4.Group` instance. `None` for the root group or `netCDF4.Dataset` instance"""
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1702, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_parent, __pyx_kp_s_parent_is_a_reference_to_the_pa) < 0)) __PYX_ERR(0, 1702, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1705
- * """`parent` is a reference to the parent
- * `netCDF4.Group` instance. `None` for the root group or `netCDF4.Dataset` instance"""
- * __pdoc__['Dataset.path']=\ # <<<<<<<<<<<<<<
- * """`path` shows the location of the `netCDF4.Group` in
- * the `netCDF4.Dataset` in a unix directory format (the names of groups in the
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1705, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_path, __pyx_kp_s_path_shows_the_location_of_the) < 0)) __PYX_ERR(0, 1705, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1710
- * hierarchy separated by backslashes). A `netCDF4.Dataset` instance is the root
- * group, so the path is simply `'/'`."""
- * __pdoc__['Dataset.keepweakref']=\ # <<<<<<<<<<<<<<
- * """If `True`, child Dimension and Variables objects only keep weak references to
- * the parent Dataset or Group."""
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1710, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dataset_keepweakref, __pyx_kp_s_If_True_child_Dimension_and_Vari) < 0)) __PYX_ERR(0, 1710, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2621
- * """
- * # Docstrings for class variables (used by pdoc).
- * __pdoc__['Group.name']=\ # <<<<<<<<<<<<<<
- * """A string describing the name of the `netCDF4.Group`."""
- * def __init__(self, parent, name, **kwargs):
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Group_name, __pyx_kp_s_A_string_describing_the_name_of) < 0)) __PYX_ERR(0, 2621, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2720
- * cdef public _data_model, _name, _grp
- * # Docstrings for class variables (used by pdoc).
- * __pdoc__['Dimension.name']=\ # <<<<<<<<<<<<<<
- * """A string describing the name of the `netCDF4.Dimension` - used when creating a
- * `netCDF4.Variable` instance with `netCDF4.Dataset.createVariable`."""
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2720, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Dimension_name, __pyx_kp_s_A_string_describing_the_name_of_2) < 0)) __PYX_ERR(0, 2720, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2916
- * __orthogonal_indexing__, _has_lsd
- * # Docstrings for class variables (used by pdoc).
- * __pdoc__['Variable.dimensions'] = \ # <<<<<<<<<<<<<<
- * """A tuple containing the names of the
- * dimensions associated with this variable."""
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2916, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_dimensions, __pyx_kp_s_A_tuple_containing_the_names_of) < 0)) __PYX_ERR(0, 2916, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2919
- * """A tuple containing the names of the
- * dimensions associated with this variable."""
- * __pdoc__['Variable.dtype'] = \ # <<<<<<<<<<<<<<
- * """A numpy dtype object describing the
- * variable's data type."""
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_dtype, __pyx_kp_s_A_numpy_dtype_object_describing) < 0)) __PYX_ERR(0, 2919, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2922
- * """A numpy dtype object describing the
- * variable's data type."""
- * __pdoc__['Variable.ndim'] = \ # <<<<<<<<<<<<<<
- * """The number of variable dimensions."""
- * __pdoc__['Variable.scale'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_ndim, __pyx_kp_s_The_number_of_variable_dimension) < 0)) __PYX_ERR(0, 2922, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2924
- * __pdoc__['Variable.ndim'] = \
- * """The number of variable dimensions."""
- * __pdoc__['Variable.scale'] = \ # <<<<<<<<<<<<<<
- * """if True, `scale_factor` and `add_offset` are
- * applied. Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2924, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_scale, __pyx_kp_s_if_True_scale_factor_and_add_off) < 0)) __PYX_ERR(0, 2924, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2928
- * applied. Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and
- * `netCDF4.Variable.set_auto_maskandscale` methods."""
- * __pdoc__['Variable.mask'] = \ # <<<<<<<<<<<<<<
- * """If True, data is automatically converted to/from masked
- * arrays when missing values or fill values are present. Default is `True`, can be
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2928, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_mask, __pyx_kp_s_If_True_data_is_automatically_co) < 0)) __PYX_ERR(0, 2928, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2933
- * reset using `netCDF4.Variable.set_auto_mask` and `netCDF4.Variable.set_auto_maskandscale`
- * methods."""
- * __pdoc__['Variable.least_significant_digit'] = \ # <<<<<<<<<<<<<<
- * """Describes the power of ten of the
- * smallest decimal place in the data the contains a reliable value. Data is
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2933, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_least_significant_digit, __pyx_kp_s_Describes_the_power_of_ten_of_th) < 0)) __PYX_ERR(0, 2933, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2938
- * truncated to this decimal place when it is assigned to the `netCDF4.Variable`
- * instance. If `None`, the data is not truncated."""
- * __pdoc__['Variable.__orthogonal_indexing__'] = \ # <<<<<<<<<<<<<<
- * """Always `True`. Indicates to client code
- * that the object supports 'orthogonal indexing', which means that slices
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2938, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable___orthogonal_indexing, __pyx_kp_s_Always_True_Indicates_to_client) < 0)) __PYX_ERR(0, 2938, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2943
- * that are 1d arrays or lists slice along each dimension independently. This
- * behavior is similar to Fortran or Matlab, but different than numpy."""
- * __pdoc__['Variable.datatype'] = \ # <<<<<<<<<<<<<<
- * """numpy data type (for primitive data types) or
- * VLType/CompoundType/EnumType instance (for compound, vlen or enum
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2943, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_datatype, __pyx_kp_s_numpy_data_type_for_primitive_da) < 0)) __PYX_ERR(0, 2943, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2947
- * VLType/CompoundType/EnumType instance (for compound, vlen or enum
- * data types)."""
- * __pdoc__['Variable.name'] = \ # <<<<<<<<<<<<<<
- * """String name."""
- * __pdoc__['Variable.shape'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2947, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_name, __pyx_kp_s_String_name) < 0)) __PYX_ERR(0, 2947, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2949
- * __pdoc__['Variable.name'] = \
- * """String name."""
- * __pdoc__['Variable.shape'] = \ # <<<<<<<<<<<<<<
- * """A tuple with the current shape (length of all dimensions)."""
- * __pdoc__['Variable.size'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2949, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_shape, __pyx_kp_s_A_tuple_with_the_current_shape_l) < 0)) __PYX_ERR(0, 2949, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":2951
- * __pdoc__['Variable.shape'] = \
- * """A tuple with the current shape (length of all dimensions)."""
- * __pdoc__['Variable.size'] = \ # <<<<<<<<<<<<<<
- * """The number of stored elements."""
- *
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2951, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_Variable_size, __pyx_kp_s_The_number_of_stored_elements) < 0)) __PYX_ERR(0, 2951, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4580
- * cdef public nc_type _nc_type
- * cdef public dtype, name
- * __pdoc__['CompoundType.name'] = \ # <<<<<<<<<<<<<<
- * """String name."""
- * __pdoc__['CompoundType.dtype'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4580, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_CompoundType_name, __pyx_kp_s_String_name) < 0)) __PYX_ERR(0, 4580, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4582
- * __pdoc__['CompoundType.name'] = \
- * """String name."""
- * __pdoc__['CompoundType.dtype'] = \ # <<<<<<<<<<<<<<
- * """A numpy dtype object describing the compound data type."""
- * def __init__(self, grp, object dt, object dtype_name, **kwargs):
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4582, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_CompoundType_dtype, __pyx_kp_s_A_numpy_dtype_object_describing_2) < 0)) __PYX_ERR(0, 4582, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4828
- * cdef public nc_type _nc_type
- * cdef public dtype, name
- * __pdoc__['VLType.name'] = \ # <<<<<<<<<<<<<<
- * """String name."""
- * __pdoc__['VLType.dtype'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4828, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_VLType_name, __pyx_kp_s_String_name) < 0)) __PYX_ERR(0, 4828, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4830
- * __pdoc__['VLType.name'] = \
- * """String name."""
- * __pdoc__['VLType.dtype'] = \ # <<<<<<<<<<<<<<
- * """A numpy dtype object describing the component type for the VLEN."""
- * def __init__(self, grp, object dt, object dtype_name, **kwargs):
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4830, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_VLType_dtype, __pyx_kp_s_A_numpy_dtype_object_describing_3) < 0)) __PYX_ERR(0, 4830, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4946
- * cdef public nc_type _nc_type
- * cdef public dtype, name, enum_dict
- * __pdoc__['EnumType.name'] = \ # <<<<<<<<<<<<<<
- * """String name."""
- * __pdoc__['EnumType.dtype'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_EnumType_name, __pyx_kp_s_String_name) < 0)) __PYX_ERR(0, 4946, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4948
- * __pdoc__['EnumType.name'] = \
- * """String name."""
- * __pdoc__['EnumType.dtype'] = \ # <<<<<<<<<<<<<<
- * """A numpy integer dtype object describing the base type for the Enum."""
- * __pdoc__['EnumType.enum_dict'] = \
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4948, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_EnumType_dtype, __pyx_kp_s_A_numpy_integer_dtype_object_des) < 0)) __PYX_ERR(0, 4948, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":4950
- * __pdoc__['EnumType.dtype'] = \
- * """A numpy integer dtype object describing the base type for the Enum."""
- * __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):
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pdoc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4950, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_kp_s_EnumType_enum_dict, __pyx_kp_s_A_python_dictionary_describing_t) < 0)) __PYX_ERR(0, 4950, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5074
- * return pystr # already bytes or unicode?
- *
- * def _to_ascii(bytestr): # <<<<<<<<<<<<<<
- * # encode a byte string to an ascii encoded string.
- * if python3:
- */
- __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_7_to_ascii, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5074, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_ascii, __pyx_t_11) < 0) __PYX_ERR(0, 5074, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5084
- * # extra utilities (formerly in utils.pyx)
- * #----------------------------------------
- * from datetime import timedelta, datetime, MINYEAR # <<<<<<<<<<<<<<
- * from netcdftime import _parse_date, microsec_units, millisec_units,\
- * sec_units, min_units, hr_units, day_units
- */
- __pyx_t_11 = PyList_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_n_s_timedelta);
- __Pyx_GIVEREF(__pyx_n_s_timedelta);
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_timedelta);
- __Pyx_INCREF(__pyx_n_s_datetime);
- __Pyx_GIVEREF(__pyx_n_s_datetime);
- PyList_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_datetime);
- __Pyx_INCREF(__pyx_n_s_MINYEAR);
- __Pyx_GIVEREF(__pyx_n_s_MINYEAR);
- PyList_SET_ITEM(__pyx_t_11, 2, __pyx_n_s_MINYEAR);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_11, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_11) < 0) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_11) < 0) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINYEAR, __pyx_t_11) < 0) __PYX_ERR(0, 5084, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5085
- * #----------------------------------------
- * from datetime import timedelta, datetime, MINYEAR
- * from netcdftime import _parse_date, microsec_units, millisec_units,\ # <<<<<<<<<<<<<<
- * sec_units, min_units, hr_units, day_units
- *
- */
- __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_parse_date);
- __Pyx_GIVEREF(__pyx_n_s_parse_date);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_parse_date);
- __Pyx_INCREF(__pyx_n_s_microsec_units);
- __Pyx_GIVEREF(__pyx_n_s_microsec_units);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_microsec_units);
- __Pyx_INCREF(__pyx_n_s_millisec_units);
- __Pyx_GIVEREF(__pyx_n_s_millisec_units);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_millisec_units);
- __Pyx_INCREF(__pyx_n_s_sec_units);
- __Pyx_GIVEREF(__pyx_n_s_sec_units);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_sec_units);
- __Pyx_INCREF(__pyx_n_s_min_units);
- __Pyx_GIVEREF(__pyx_n_s_min_units);
- PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_min_units);
- __Pyx_INCREF(__pyx_n_s_hr_units);
- __Pyx_GIVEREF(__pyx_n_s_hr_units);
- PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_hr_units);
- __Pyx_INCREF(__pyx_n_s_day_units);
- __Pyx_GIVEREF(__pyx_n_s_day_units);
- PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_day_units);
- __pyx_t_11 = __Pyx_Import(__pyx_n_s_netcdftime, __pyx_t_2, -1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_parse_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_date, __pyx_t_2) < 0) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_microsec_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_microsec_units, __pyx_t_2) < 0) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_millisec_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_millisec_units, __pyx_t_2) < 0) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_sec_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sec_units, __pyx_t_2) < 0) __PYX_ERR(0, 5086, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_min_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_units, __pyx_t_2) < 0) __PYX_ERR(0, 5086, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_hr_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_hr_units, __pyx_t_2) < 0) __PYX_ERR(0, 5086, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_11, __pyx_n_s_day_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5085, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_day_units, __pyx_t_2) < 0) __PYX_ERR(0, 5086, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5089
- *
- * # start of the gregorian calendar
- * gregorian = datetime(1582,10,15) # <<<<<<<<<<<<<<
- *
- * def _dateparse(timestr):
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5089, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5089, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_gregorian, __pyx_t_2) < 0) __PYX_ERR(0, 5089, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5091
- * 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"""
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_dateparse, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5091, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateparse, __pyx_t_2) < 0) __PYX_ERR(0, 5091, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5116
- * return basedate
- *
- * def stringtoarr(string,NUMCHARS,dtype='S'): # <<<<<<<<<<<<<<
- * """
- * **`stringtoarr(a, NUMCHARS,dtype='S')`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_11stringtoarr, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringtoarr, __pyx_t_2) < 0) __PYX_ERR(0, 5116, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5139
- * return arr
- *
- * def stringtochar(a): # <<<<<<<<<<<<<<
- * """
- * **`stringtochar(a)`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_13stringtochar, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5139, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringtochar, __pyx_t_2) < 0) __PYX_ERR(0, 5139, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5158
- * return b
- *
- * def chartostring(b): # <<<<<<<<<<<<<<
- * """
- * **`chartostring(b)`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_15chartostring, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_chartostring, __pyx_t_2) < 0) __PYX_ERR(0, 5158, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5179
- * return a
- *
- * def date2num(dates,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`date2num(dates,units,calendar='standard')`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_17date2num, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date2num, __pyx_t_2) < 0) __PYX_ERR(0, 5179, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5267
- * return cdftime.date2num(dates)
- *
- * def num2date(times,units,calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * **`num2date(times,units,calendar='standard')`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_19num2date, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5267, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_num2date, __pyx_t_2) < 0) __PYX_ERR(0, 5267, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5370
- * return cdftime.num2date(times)
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * **`date2index(dates, nctime, calendar=None, select='exact')`**
- */
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_21date2index, NULL, __pyx_n_s_netCDF4__netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date2index, __pyx_t_2) < 0) __PYX_ERR(0, 5370, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5426
- * return netcdftime.date2index(dates, nctime, calendar, select)
- *
- * class MFDataset(Dataset): # <<<<<<<<<<<<<<
- * """
- * Class for reading multi-file netCDF Datasets, making variables
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset));
- __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dataset));
- __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_MFDataset, __pyx_n_s_MFDataset, (PyObject *) NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_kp_s_Class_for_reading_multi_file_ne); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5456
- * """
- *
- * def __init__(self, files, check=False, aggdim=None, exclude=[]): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, files, check=False, aggdim=None, exclude=[])`**
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_1__init__, 0, __pyx_n_s_MFDataset___init, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5456, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 5456, __pyx_L1_error)
- __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 5456, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_exclude = __pyx_t_13;
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_t_13 = 0;
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_7netCDF4_8_netCDF4_9MFDataset_14__defaults__);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 5456, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5629
- * self._path = '/'
- *
- * def __setattr__(self, name, value): # <<<<<<<<<<<<<<
- * """override base class attribute creation"""
- * self.__dict__[name] = value
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_3__setattr__, 0, __pyx_n_s_MFDataset___setattr, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5629, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_setattr, __pyx_t_7) < 0) __PYX_ERR(0, 5629, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5633
- * self.__dict__[name] = value
- *
- * def __getattribute__(self, name): # <<<<<<<<<<<<<<
- * if name in ['variables','dimensions','file_format','groups',\
- * 'data_model','disk_format','path']:
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_5__getattribute__, 0, __pyx_n_s_MFDataset___getattribute, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5633, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getattribute, __pyx_t_7) < 0) __PYX_ERR(0, 5633, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5646
- * return Dataset.__getattribute__(self, name)
- *
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * """
- * **`ncattrs(self)`**
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_7ncattrs, 0, __pyx_n_s_MFDataset_ncattrs, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5646, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ncattrs, __pyx_t_7) < 0) __PYX_ERR(0, 5646, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5654
- * return self._cdf[0].__dict__.keys()
- *
- * def close(self): # <<<<<<<<<<<<<<
- * """
- * **`close(self)`**
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_9close, 0, __pyx_n_s_MFDataset_close, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5654, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 5654, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5663
- * dset.close()
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions.keys()])
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_11__repr__, 0, __pyx_n_s_MFDataset___repr, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 5663, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5681
- * return ''.join(ncdump)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * # raise error is user tries to pickle a MFDataset object.
- * raise NotImplementedError('MFDataset is not picklable')
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9MFDataset_13__reduce__, 0, __pyx_n_s_MFDataset___reduce, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5681, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_reduce, __pyx_t_7) < 0) __PYX_ERR(0, 5681, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5426
- * return netcdftime.date2index(dates, nctime, calendar, select)
- *
- * class MFDataset(Dataset): # <<<<<<<<<<<<<<
- * """
- * Class for reading multi-file netCDF Datasets, making variables
- */
- __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_MFDataset, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MFDataset, __pyx_t_7) < 0) __PYX_ERR(0, 5426, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5685
- * raise NotImplementedError('MFDataset is not picklable')
- *
- * class _Dimension(object): # <<<<<<<<<<<<<<
- * def __init__(self, dimname, dim, dimlens, dimtotlen):
- * self.dimlens = dimlens
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_builtin_object);
- __Pyx_GIVEREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
- __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_Dimension, __pyx_n_s_Dimension, (PyObject *) NULL, __pyx_n_s_netCDF4__netCDF4, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5686
- *
- * class _Dimension(object):
- * def __init__(self, dimname, dim, dimlens, dimtotlen): # <<<<<<<<<<<<<<
- * self.dimlens = dimlens
- * self.dimtotlen = dimtotlen
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_1__init__, 0, __pyx_n_s_Dimension___init, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5686, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 5686, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5690
- * self.dimtotlen = dimtotlen
- * self._name = dimname
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self.dimtotlen
- * def isunlimited(self):
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_3__len__, 0, __pyx_n_s_Dimension___len, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5690, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_len, __pyx_t_7) < 0) __PYX_ERR(0, 5690, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5692
- * def __len__(self):
- * return self.dimtotlen
- * def isunlimited(self): # <<<<<<<<<<<<<<
- * return True
- * def __repr__(self):
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_5isunlimited, 0, __pyx_n_s_Dimension_isunlimited, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5692, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_isunlimited, __pyx_t_7) < 0) __PYX_ERR(0, 5692, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5694
- * def isunlimited(self):
- * return True
- * def __repr__(self): # <<<<<<<<<<<<<<
- * if self.isunlimited():
- * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self))
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_10_Dimension_7__repr__, 0, __pyx_n_s_Dimension___repr, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5694, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 5694, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5685
- * raise NotImplementedError('MFDataset is not picklable')
- *
- * class _Dimension(object): # <<<<<<<<<<<<<<
- * def __init__(self, dimname, dim, dimlens, dimtotlen):
- * self.dimlens = dimlens
- */
- __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Dimension, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5685, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dimension, __pyx_t_7) < 0) __PYX_ERR(0, 5685, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5700
- * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self))
- *
- * class _Variable(object): # <<<<<<<<<<<<<<
- * def __init__(self, dset, varname, var, recdimname):
- * self.dimensions = var.dimensions
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_builtin_object);
- __Pyx_GIVEREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
- __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_Variable, __pyx_n_s_Variable, (PyObject *) NULL, __pyx_n_s_netCDF4__netCDF4, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5701
- *
- * class _Variable(object):
- * def __init__(self, dset, varname, var, recdimname): # <<<<<<<<<<<<<<
- * self.dimensions = var.dimensions
- * self._dset = dset
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_1__init__, 0, __pyx_n_s_Variable___init, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5701, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 5701, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5714
- * for name, value in var.__dict__.items():
- * self.__dict__[name] = value
- * def typecode(self): # <<<<<<<<<<<<<<
- * return self.dtype
- * def ncattrs(self):
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_3typecode, 0, __pyx_n_s_Variable_typecode, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5714, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_typecode, __pyx_t_7) < 0) __PYX_ERR(0, 5714, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5716
- * def typecode(self):
- * return self.dtype
- * def ncattrs(self): # <<<<<<<<<<<<<<
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name):
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_5ncattrs, 0, __pyx_n_s_Variable_ncattrs, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5716, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ncattrs, __pyx_t_7) < 0) __PYX_ERR(0, 5716, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5718
- * def ncattrs(self):
- * return self._mastervar.__dict__.keys()
- * def __getattr__(self,name): # <<<<<<<<<<<<<<
- * if name == 'shape': return self._shape()
- * if name == 'ndim': return len(self._shape())
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_7__getattr__, 0, __pyx_n_s_Variable___getattr, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5718, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getattr, __pyx_t_7) < 0) __PYX_ERR(0, 5718, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5725
- * except:
- * raise AttributeError(name)
- * def __repr__(self): # <<<<<<<<<<<<<<
- * ncdump_var = ['%r\n' % type(self)]
- * dimnames = tuple([str(dimname) for dimname in self.dimensions])
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_9__repr__, 0, __pyx_n_s_Variable___repr, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5725, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 5725, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5741
- * ncdump_var.append('current size = %s\n' % repr(self.shape))
- * return ''.join(ncdump_var)
- * def __len__(self): # <<<<<<<<<<<<<<
- * if not self._shape:
- * raise TypeError('len() of unsized object')
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_11__len__, 0, __pyx_n_s_Variable___len, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5741, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_len, __pyx_t_7) < 0) __PYX_ERR(0, 5741, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5746
- * else:
- * return self._shape()[0]
- * def _shape(self): # <<<<<<<<<<<<<<
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_13_shape, 0, __pyx_n_s_Variable__shape, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5746, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_shape_2, __pyx_t_7) < 0) __PYX_ERR(0, 5746, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5749
- * recdimlen = len(self._dset.dimensions[self._recdimname])
- * return (recdimlen,) + self._mastervar.shape[1:]
- * def set_auto_maskandscale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_15set_auto_maskandscale, 0, __pyx_n_s_Variable_set_auto_maskandscale, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5749, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_set_auto_maskandscale, __pyx_t_7) < 0) __PYX_ERR(0, 5749, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5752
- * for v in self._recVar:
- * v.set_auto_maskandscale(val)
- * def set_auto_mask(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_mask(val)
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_17set_auto_mask, 0, __pyx_n_s_Variable_set_auto_mask, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_set_auto_mask, __pyx_t_7) < 0) __PYX_ERR(0, 5752, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5755
- * for v in self._recVar:
- * v.set_auto_mask(val)
- * def set_auto_scale(self,val): # <<<<<<<<<<<<<<
- * for v in self._recVar:
- * v.set_auto_scale(val)
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_19set_auto_scale, 0, __pyx_n_s_Variable_set_auto_scale, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5755, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_set_auto_scale, __pyx_t_7) < 0) __PYX_ERR(0, 5755, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5758
- * for v in self._recVar:
- * v.set_auto_scale(val)
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * """Get records from a concatenated set of variables."""
- *
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_9_Variable_21__getitem__, 0, __pyx_n_s_Variable___getitem, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5758, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 5758, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5700
- * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self))
- *
- * class _Variable(object): # <<<<<<<<<<<<<<
- * def __init__(self, dset, varname, var, recdimname):
- * self.dimensions = var.dimensions
- */
- __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Variable, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Variable, __pyx_t_7) < 0) __PYX_ERR(0, 5700, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5862
- *
- *
- * class MFTime(_Variable): # <<<<<<<<<<<<<<
- * """
- * Class providing an interface to a MFDataset time Variable by imposing a unique common
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5862, __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 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_11, __pyx_n_s_MFTime, __pyx_n_s_MFTime, (PyObject *) NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_kp_s_Class_providing_an_interface_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netCDF4/_netCDF4.pyx":5897
- * """
- *
- * def __init__(self, time, units=None): # <<<<<<<<<<<<<<
- * """
- * **`__init__(self, time, units=None)`**
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_6MFTime_1__init__, 0, __pyx_n_s_MFTime___init, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5897, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__203);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 5897, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5945
- *
- *
- * def __getitem__(self, elem): # <<<<<<<<<<<<<<
- * return self.__time[elem] + self.__delta[elem]
- */
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7netCDF4_8_netCDF4_6MFTime_3__getitem__, 0, __pyx_n_s_MFTime___getitem, NULL, __pyx_n_s_netCDF4__netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5945, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 5945, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netCDF4/_netCDF4.pyx":5862
- *
- *
- * class MFTime(_Variable): # <<<<<<<<<<<<<<
- * """
- * Class providing an interface to a MFDataset time Variable by imposing a unique common
- */
- __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MFTime, __pyx_t_11, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MFTime, __pyx_t_7) < 0) __PYX_ERR(0, 5862, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netCDF4/_netCDF4.pyx":1
- * """ # <<<<<<<<<<<<<<
- * Version 1.2.7
- * -------------
- */
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_t_11, __pyx_kp_u_Dataset_get_variables_by_attribu, __pyx_kp_u_get_variables_by_attribute_self) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_11) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /*--- Wrapped vars code ---*/
-
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_14);
- if (__pyx_m) {
- if (__pyx_d) {
- __Pyx_AddTraceback("init netCDF4._netCDF4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- }
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init netCDF4._netCDF4");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-/* --- Runtime support code --- */
-/* Refnanny */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif
-
-/* GetBuiltinName */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-/* IterFinish */
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-/* PyObjectCall */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- PyObject *result;
- ternaryfunc call = func->ob_type->tp_call;
- if (unlikely(!call))
- return PyObject_Call(func, arg, kw);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = (*call)(func, arg, kw);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* PyObjectCallMethO */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
- PyObject *self, *result;
- PyCFunction cfunc;
- cfunc = PyCFunction_GET_FUNCTION(func);
- self = PyCFunction_GET_SELF(func);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = cfunc(self, arg);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* PyObjectCallNoArg */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
-#ifdef __Pyx_CyFunction_USED
- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
-#else
- if (likely(PyCFunction_Check(func))) {
-#endif
- if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
- return __Pyx_PyObject_CallMethO(func, NULL);
- }
- }
- return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
-}
-#endif
-
-/* PyObjectCallOneArg */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_New(1);
- if (unlikely(!args)) return NULL;
- Py_INCREF(arg);
- PyTuple_SET_ITEM(args, 0, arg);
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
-#ifdef __Pyx_CyFunction_USED
- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
-#else
- if (likely(PyCFunction_Check(func))) {
-#endif
- if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
- return __Pyx_PyObject_CallMethO(func, arg);
- }
- }
- return __Pyx__PyObject_CallOneArg(func, arg);
-}
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_Pack(1, arg);
- if (unlikely(!args)) return NULL;
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-#endif
-
-/* PyObjectCallMethod0 */
- static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
- PyObject *method, *result = NULL;
- method = __Pyx_PyObject_GetAttrStr(obj, method_name);
- if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyMethod_Check(method))) {
- PyObject *self = PyMethod_GET_SELF(method);
- if (likely(self)) {
- PyObject *function = PyMethod_GET_FUNCTION(method);
- result = __Pyx_PyObject_CallOneArg(function, self);
- Py_DECREF(method);
- return result;
- }
- }
-#endif
- result = __Pyx_PyObject_CallNoArg(method);
- Py_DECREF(method);
-bad:
- return result;
-}
-
-/* RaiseNeedMoreValuesToUnpack */
- static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-/* RaiseTooManyValuesToUnpack */
- static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-/* UnpackItemEndCheck */
- static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- } else {
- return __Pyx_IterFinish();
- }
- return 0;
-}
-
-/* RaiseNoneIterError */
- static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-}
-
-/* UnpackTupleError */
- static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
- if (t == Py_None) {
- __Pyx_RaiseNoneNotIterableError();
- } else if (PyTuple_GET_SIZE(t) < index) {
- __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
- } else {
- __Pyx_RaiseTooManyValuesError(index);
- }
-}
-
-/* UnpackTuple2 */
- static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
- int is_tuple, int has_known_size, int decref_tuple) {
- Py_ssize_t index;
- PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
- if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
- iternextfunc iternext;
- iter = PyObject_GetIter(tuple);
- if (unlikely(!iter)) goto bad;
- if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
- iternext = Py_TYPE(iter)->tp_iternext;
- value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
- value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
- if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
- Py_DECREF(iter);
- } else {
- if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
- __Pyx_UnpackTupleError(tuple, 2);
- goto bad;
- }
-#if CYTHON_COMPILING_IN_PYPY
- value1 = PySequence_ITEM(tuple, 0);
- if (unlikely(!value1)) goto bad;
- value2 = PySequence_ITEM(tuple, 1);
- if (unlikely(!value2)) goto bad;
-#else
- value1 = PyTuple_GET_ITEM(tuple, 0);
- value2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(value1);
- Py_INCREF(value2);
-#endif
- if (decref_tuple) { Py_DECREF(tuple); }
- }
- *pvalue1 = value1;
- *pvalue2 = value2;
- return 0;
-unpacking_failed:
- if (!has_known_size && __Pyx_IterFinish() == 0)
- __Pyx_RaiseNeedMoreValuesError(index);
-bad:
- Py_XDECREF(iter);
- Py_XDECREF(value1);
- Py_XDECREF(value2);
- if (decref_tuple) { Py_XDECREF(tuple); }
- return -1;
-}
-
-/* dict_iter */
- static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
- Py_ssize_t* p_orig_length, int* p_source_is_dict) {
- is_dict = is_dict || likely(PyDict_CheckExact(iterable));
- *p_source_is_dict = is_dict;
-#if !CYTHON_COMPILING_IN_PYPY
- if (is_dict) {
- *p_orig_length = PyDict_Size(iterable);
- Py_INCREF(iterable);
- return iterable;
- }
-#endif
- *p_orig_length = 0;
- if (method_name) {
- PyObject* iter;
- iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
- if (!iterable)
- return NULL;
-#if !CYTHON_COMPILING_IN_PYPY
- if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
- return iterable;
-#endif
- iter = PyObject_GetIter(iterable);
- Py_DECREF(iterable);
- return iter;
- }
- return PyObject_GetIter(iterable);
-}
-static CYTHON_INLINE int __Pyx_dict_iter_next(
- PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
- PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
- PyObject* next_item;
-#if !CYTHON_COMPILING_IN_PYPY
- if (source_is_dict) {
- PyObject *key, *value;
- if (unlikely(orig_length != PyDict_Size(iter_obj))) {
- PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
- return -1;
- }
- if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
- return 0;
- }
- if (pitem) {
- PyObject* tuple = PyTuple_New(2);
- if (unlikely(!tuple)) {
- return -1;
- }
- Py_INCREF(key);
- Py_INCREF(value);
- PyTuple_SET_ITEM(tuple, 0, key);
- PyTuple_SET_ITEM(tuple, 1, value);
- *pitem = tuple;
- } else {
- if (pkey) {
- Py_INCREF(key);
- *pkey = key;
- }
- if (pvalue) {
- Py_INCREF(value);
- *pvalue = value;
- }
- }
- return 1;
- } else if (PyTuple_CheckExact(iter_obj)) {
- Py_ssize_t pos = *ppos;
- if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
- *ppos = pos + 1;
- next_item = PyTuple_GET_ITEM(iter_obj, pos);
- Py_INCREF(next_item);
- } else if (PyList_CheckExact(iter_obj)) {
- Py_ssize_t pos = *ppos;
- if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
- *ppos = pos + 1;
- next_item = PyList_GET_ITEM(iter_obj, pos);
- Py_INCREF(next_item);
- } else
-#endif
- {
- next_item = PyIter_Next(iter_obj);
- if (unlikely(!next_item)) {
- return __Pyx_IterFinish();
- }
- }
- if (pitem) {
- *pitem = next_item;
- } else if (pkey && pvalue) {
- if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
- return -1;
- } else if (pkey) {
- *pkey = next_item;
- } else {
- *pvalue = next_item;
- }
- return 1;
-}
-
-/* GetModuleGlobalName */
- static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
- PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
- result = PyDict_GetItem(__pyx_d, name);
- if (likely(result)) {
- Py_INCREF(result);
- } else {
-#else
- result = PyObject_GetItem(__pyx_d, name);
- if (!result) {
- PyErr_Clear();
-#endif
- result = __Pyx_GetBuiltinName(name);
- }
- return result;
-}
-
-/* decode_c_string */
- 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)) {
- Py_ssize_t length;
- if (unlikely((start < 0) | (stop < 0))) {
- size_t slen = strlen(cstring);
- if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
- PyErr_SetString(PyExc_OverflowError,
- "c-string too long to convert to Python");
- return NULL;
- }
- length = (Py_ssize_t) slen;
- if (start < 0) {
- start += length;
- if (start < 0)
- start = 0;
- }
- if (stop < 0)
- stop += length;
- }
- length = stop - start;
- if (unlikely(length <= 0))
- return PyUnicode_FromUnicode(NULL, 0);
- cstring += start;
- if (decode_func) {
- return decode_func(cstring, length, errors);
- } else {
- return PyUnicode_Decode(cstring, length, encoding, errors);
- }
-}
-
-/* PyErrFetchRestore */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-}
-#endif
-
-/* RaiseException */
- #if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
- CYTHON_UNUSED PyObject *cause) {
- __Pyx_PyThreadState_declare
- Py_XINCREF(type);
- if (!value || value == Py_None)
- value = NULL;
- else
- Py_INCREF(value);
- if (!tb || tb == Py_None)
- tb = NULL;
- else {
- Py_INCREF(tb);
- if (!PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- }
- if (PyType_Check(type)) {
-#if CYTHON_COMPILING_IN_PYPY
- if (!value) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#endif
- PyErr_NormalizeException(&type, &value, &tb);
- } else {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- value = type;
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- }
- __Pyx_PyThreadState_assign
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-#else
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
- PyObject* owned_instance = NULL;
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (PyExceptionClass_Check(type)) {
- PyObject *instance_class = NULL;
- if (value && PyExceptionInstance_Check(value)) {
- instance_class = (PyObject*) Py_TYPE(value);
- if (instance_class != type) {
- int is_subclass = PyObject_IsSubclass(instance_class, type);
- if (!is_subclass) {
- instance_class = NULL;
- } else if (unlikely(is_subclass == -1)) {
- goto bad;
- } else {
- type = instance_class;
- }
- }
- }
- if (!instance_class) {
- PyObject *args;
- if (!value)
- args = PyTuple_New(0);
- else if (PyTuple_Check(value)) {
- Py_INCREF(value);
- args = value;
- } else
- args = PyTuple_Pack(1, value);
- if (!args)
- goto bad;
- owned_instance = PyObject_Call(type, args, NULL);
- Py_DECREF(args);
- if (!owned_instance)
- goto bad;
- value = owned_instance;
- if (!PyExceptionInstance_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "calling %R should have returned an instance of "
- "BaseException, not %R",
- type, Py_TYPE(value));
- goto bad;
- }
- }
- } else {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-#if PY_VERSION_HEX >= 0x03030000
- if (cause) {
-#else
- if (cause && cause != Py_None) {
-#endif
- PyObject *fixed_cause;
- if (cause == Py_None) {
- fixed_cause = NULL;
- } else if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto bad;
- } else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- Py_INCREF(fixed_cause);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from "
- "BaseException");
- goto bad;
- }
- PyException_SetCause(value, fixed_cause);
- }
- PyErr_SetObject(type, value);
- if (tb) {
-#if CYTHON_COMPILING_IN_PYPY
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
- Py_INCREF(tb);
- PyErr_Restore(tmp_type, tmp_value, tb);
- Py_XDECREF(tmp_tb);
-#else
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
-#endif
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-/* ExtTypeTest */
- static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (unlikely(!type)) {
- PyErr_SetString(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (likely(PyObject_TypeCheck(obj, type)))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
- Py_TYPE(obj)->tp_name, type->tp_name);
- return 0;
-}
-
-/* BytesEquals */
- static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
- if (s1 == s2) {
- return (equals == Py_EQ);
- } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
- const char *ps1, *ps2;
- Py_ssize_t length = PyBytes_GET_SIZE(s1);
- if (length != PyBytes_GET_SIZE(s2))
- return (equals == Py_NE);
- ps1 = PyBytes_AS_STRING(s1);
- ps2 = PyBytes_AS_STRING(s2);
- if (ps1[0] != ps2[0]) {
- return (equals == Py_NE);
- } else if (length == 1) {
- return (equals == Py_EQ);
- } else {
- int result = memcmp(ps1, ps2, (size_t)length);
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
- return (equals == Py_NE);
- } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
- return (equals == Py_NE);
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-#endif
-}
-
-/* UnicodeEquals */
- static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
- PyObject* owned_ref = NULL;
-#endif
- int s1_is_unicode, s2_is_unicode;
- if (s1 == s2) {
- goto return_eq;
- }
- s1_is_unicode = PyUnicode_CheckExact(s1);
- s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
- if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
- owned_ref = PyUnicode_FromObject(s2);
- if (unlikely(!owned_ref))
- return -1;
- s2 = owned_ref;
- s2_is_unicode = 1;
- } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
- owned_ref = PyUnicode_FromObject(s1);
- if (unlikely(!owned_ref))
- return -1;
- s1 = owned_ref;
- s1_is_unicode = 1;
- } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
- return __Pyx_PyBytes_Equals(s1, s2, equals);
- }
-#endif
- if (s1_is_unicode & s2_is_unicode) {
- Py_ssize_t length;
- int kind;
- void *data1, *data2;
- if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
- return -1;
- length = __Pyx_PyUnicode_GET_LENGTH(s1);
- if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
- goto return_ne;
- }
- kind = __Pyx_PyUnicode_KIND(s1);
- if (kind != __Pyx_PyUnicode_KIND(s2)) {
- goto return_ne;
- }
- data1 = __Pyx_PyUnicode_DATA(s1);
- data2 = __Pyx_PyUnicode_DATA(s2);
- if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
- goto return_ne;
- } else if (length == 1) {
- goto return_eq;
- } else {
- int result = memcmp(data1, data2, (size_t)(length * kind));
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & s2_is_unicode) {
- goto return_ne;
- } else if ((s2 == Py_None) & s1_is_unicode) {
- goto return_ne;
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-return_eq:
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_EQ);
-return_ne:
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_NE);
-#endif
-}
-
-/* GetException */
- #if CYTHON_COMPILING_IN_CPYTHON
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-#endif
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (local_tb) {
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- }
- #endif
- Py_XINCREF(local_tb);
- Py_XINCREF(local_type);
- Py_XINCREF(local_value);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-/* SwapException */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = *type;
- tstate->exc_value = *value;
- tstate->exc_traceback = *tb;
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
-}
-#else
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
- PyErr_SetExcInfo(*type, *value, *tb);
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
-}
-#endif
-
-/* SaveResetException */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-}
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-#endif
-
-/* GetItemInt */
- static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- return NULL;
- PyErr_Clear();
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-/* PyErrExceptionMatches */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
- PyObject *exc_type = tstate->curexc_type;
- if (exc_type == err) return 1;
- if (unlikely(!exc_type)) return 0;
- return PyErr_GivenExceptionMatches(exc_type, err);
-}
-#endif
-
-/* RaiseDoubleKeywords */
- static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-/* ParseKeywords */
- static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%.200s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%.200s() got an unexpected keyword argument '%.200s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-/* RaiseArgTupleInvalid */
- 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)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-/* SliceObject */
- 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, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- goto bad;
- PyErr_Clear();
- }
- }
- return ms->sq_slice(obj, cstart, cstop);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_subscript))
-#endif
- {
- PyObject* result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- result = mp->mp_subscript(obj, py_slice);
-#else
- result = PyObject_GetItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
- return NULL;
-}
-
-/* StringJoin */
- #if !CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
- return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
-}
-#endif
-
-/* KeywordStringCheck */
- static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
- PyObject *kwdict,
- const char* function_name,
- int kw_allowed)
-{
- PyObject* key = 0;
- Py_ssize_t pos = 0;
-#if CYTHON_COMPILING_IN_PYPY
- if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
- goto invalid_keyword;
- return 1;
-#else
- while (PyDict_Next(kwdict, &pos, &key, 0)) {
- #if PY_MAJOR_VERSION < 3
- if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
- #endif
- if (unlikely(!PyUnicode_Check(key)))
- goto invalid_keyword_type;
- }
- if ((!kw_allowed) && unlikely(key))
- goto invalid_keyword;
- return 1;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%.200s() keywords must be strings", function_name);
- return 0;
-#endif
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%.200s() got an unexpected keyword argument '%.200s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
- return 0;
-}
-
-/* UnpackUnboundCMethod */
- static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
- PyObject *method;
- method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
- if (unlikely(!method))
- return -1;
- target->method = method;
-#if CYTHON_COMPILING_IN_CPYTHON
- #if PY_MAJOR_VERSION >= 3
- if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
- #endif
- {
- PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
- target->func = descr->d_method->ml_meth;
- target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
- }
-#endif
- return 0;
-}
-
-/* CallUnboundCMethod0 */
- static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
- PyObject *args, *result = NULL;
- if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
-#if CYTHON_COMPILING_IN_CPYTHON
- args = PyTuple_New(1);
- if (unlikely(!args)) goto bad;
- Py_INCREF(self);
- PyTuple_SET_ITEM(args, 0, self);
-#else
- args = PyTuple_Pack(1, self);
- if (unlikely(!args)) goto bad;
-#endif
- result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
- Py_DECREF(args);
-bad:
- return result;
-}
-
-/* py_dict_items */
- static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
- if (PY_MAJOR_VERSION >= 3)
- return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
- else
- return PyDict_Items(d);
-}
-
-/* GetAttr */
- static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
-#if PY_MAJOR_VERSION >= 3
- if (likely(PyUnicode_Check(n)))
-#else
- if (likely(PyString_Check(n)))
-#endif
- return __Pyx_PyObject_GetAttrStr(o, n);
-#endif
- return PyObject_GetAttr(o, n);
-}
-
-/* GetAttr3 */
- static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
- PyObject *r = __Pyx_GetAttr(o, n);
- if (unlikely(!r)) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError))
- goto bad;
- PyErr_Clear();
- r = d;
- Py_INCREF(d);
- }
- return r;
-bad:
- return NULL;
-}
-
-/* None */
- static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
- PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-/* PyIntBinop */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a + b);
- if (likely((x^a) >= 0 || (x^b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- }
- x = a + b;
- return PyLong_FromLong(x);
- long_long:
- llx = lla + llb;
- return PyLong_FromLongLong(llx);
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("add", return NULL)
- result = ((double)a) + (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
-}
-#endif
-
-/* PyIntBinop */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- if (op1 == op2) {
- Py_RETURN_TRUE;
- }
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long a = PyInt_AS_LONG(op1);
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a;
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
- default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
- #else
- default: Py_RETURN_FALSE;
- #endif
- }
- }
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- if ((double)a == (double)b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- return PyObject_RichCompare(op1, op2, Py_EQ);
-}
-#endif
-
-/* SetItemInt */
- static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
- int r;
- if (!j) return -1;
- r = PyObject_SetItem(o, j, v);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
- CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
- if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
- PyObject* old = PyList_GET_ITEM(o, n);
- Py_INCREF(v);
- PyList_SET_ITEM(o, n, v);
- Py_DECREF(old);
- return 1;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_ass_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- return -1;
- PyErr_Clear();
- }
- }
- return m->sq_ass_item(o, i, v);
- }
- }
-#else
-#if CYTHON_COMPILING_IN_PYPY
- if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
-#else
- if (is_list || PySequence_Check(o)) {
-#endif
- return PySequence_SetItem(o, i, v);
- }
-#endif
- return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
-
-/* pyobject_as_double */
- static double __Pyx__PyObject_AsDouble(PyObject* obj) {
- PyObject* float_value;
-#if CYTHON_COMPILING_IN_PYPY
- float_value = PyNumber_Float(obj); if (0) goto bad;
-#else
- PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
- if (likely(nb) && likely(nb->nb_float)) {
- float_value = nb->nb_float(obj);
- if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
- PyErr_Format(PyExc_TypeError,
- "__float__ returned non-float (type %.200s)",
- Py_TYPE(float_value)->tp_name);
- Py_DECREF(float_value);
- goto bad;
- }
- } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
-#if PY_MAJOR_VERSION >= 3
- float_value = PyFloat_FromString(obj);
-#else
- float_value = PyFloat_FromString(obj, 0);
-#endif
- } else {
- PyObject* args = PyTuple_New(1);
- if (unlikely(!args)) goto bad;
- PyTuple_SET_ITEM(args, 0, obj);
- float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
- PyTuple_SET_ITEM(args, 0, 0);
- Py_DECREF(args);
- }
-#endif
- if (likely(float_value)) {
- double value = PyFloat_AS_DOUBLE(float_value);
- Py_DECREF(float_value);
- return value;
- }
-bad:
- return (double)-1;
-}
-
-/* SliceObject */
- 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, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_ass_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- goto bad;
- PyErr_Clear();
- }
- }
- return ms->sq_ass_slice(obj, cstart, cstop, value);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_ass_subscript))
-#endif
- {
- int result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- result = mp->mp_ass_subscript(obj, py_slice, value);
-#else
- result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object does not support slice %.10s",
- Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
-bad:
- return -1;
-}
-
-/* ArgTypeTest */
- static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
- PyErr_Format(PyExc_TypeError,
- "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
- name, type->tp_name, Py_TYPE(obj)->tp_name);
-}
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact)
-{
- if (unlikely(!type)) {
- PyErr_SetString(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (none_allowed && obj == Py_None) return 1;
- else if (exact) {
- if (likely(Py_TYPE(obj) == type)) return 1;
- #if PY_MAJOR_VERSION == 2
- else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
- #endif
- }
- else {
- if (likely(PyObject_TypeCheck(obj, type))) return 1;
- }
- __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
- return 0;
-}
-
-/* PyIntBinop */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a - b);
- if (likely((x^a) >= 0 || (x^~b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
- }
- default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- }
- x = a - b;
- return PyLong_FromLong(x);
- long_long:
- llx = lla - llb;
- return PyLong_FromLongLong(llx);
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("subtract", return NULL)
- result = ((double)a) - (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
-}
-#endif
-
-/* PyObjectCallMethod1 */
- static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
- PyObject *method, *result = NULL;
- method = __Pyx_PyObject_GetAttrStr(obj, method_name);
- if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyMethod_Check(method))) {
- PyObject *self = PyMethod_GET_SELF(method);
- if (likely(self)) {
- PyObject *args;
- PyObject *function = PyMethod_GET_FUNCTION(method);
- args = PyTuple_New(2);
- if (unlikely(!args)) goto bad;
- Py_INCREF(self);
- PyTuple_SET_ITEM(args, 0, self);
- Py_INCREF(arg);
- PyTuple_SET_ITEM(args, 1, arg);
- Py_INCREF(function);
- Py_DECREF(method); method = NULL;
- result = __Pyx_PyObject_Call(function, args, NULL);
- Py_DECREF(args);
- Py_DECREF(function);
- return result;
- }
- }
-#endif
- result = __Pyx_PyObject_CallOneArg(method, arg);
-bad:
- Py_XDECREF(method);
- return result;
-}
-
-/* append */
- static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
- if (likely(PyList_CheckExact(L))) {
- if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
- } else {
- PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
- if (unlikely(!retval))
- return -1;
- Py_DECREF(retval);
- }
- return 0;
-}
-
-/* PyFloatBinop */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
- const double b = floatval;
- double a, result;
- if (likely(PyFloat_CheckExact(op1))) {
- a = PyFloat_AS_DOUBLE(op1);
- } else
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- a = (double) PyInt_AS_LONG(op1);
- } else
- #endif
- if (likely(PyLong_CheckExact(op1))) {
- #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- switch (size) {
- case 0: a = 0.0; break;
- case -1: a = -(double) digits[0]; break;
- case 1: a = (double) digits[0]; break;
- case -2:
- case 2:
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
- a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -2)
- a = -a;
- break;
- }
- }
- case -3:
- case 3:
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
- a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -3)
- a = -a;
- break;
- }
- }
- case -4:
- case 4:
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
- a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -4)
- a = -a;
- break;
- }
- }
- default:
- #else
- {
- #endif
- a = PyLong_AsDouble(op1);
- if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
- }
- } else {
- return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
- }
- PyFPE_START_PROTECT("divide", return NULL)
- result = a / b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
-}
-#endif
-
-/* py_dict_keys */
- static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
- if (PY_MAJOR_VERSION >= 3)
- return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d);
- else
- return PyDict_Keys(d);
-}
-
-/* Import */
- static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
- if (!py_import)
- goto bad;
- #endif
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(1);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- #endif
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0;
- }
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-/* ImportFrom */
- static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
- PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
- if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Format(PyExc_ImportError,
- #if PY_MAJOR_VERSION < 3
- "cannot import name %.230s", PyString_AS_STRING(name));
- #else
- "cannot import name %S", name);
- #endif
- }
- return value;
-}
-
-/* CalculateMetaclass */
- static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
- Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
- for (i=0; i < nbases; i++) {
- PyTypeObject *tmptype;
- PyObject *tmp = PyTuple_GET_ITEM(bases, i);
- tmptype = Py_TYPE(tmp);
-#if PY_MAJOR_VERSION < 3
- if (tmptype == &PyClass_Type)
- continue;
-#endif
- if (!metaclass) {
- metaclass = tmptype;
- continue;
- }
- if (PyType_IsSubtype(metaclass, tmptype))
- continue;
- if (PyType_IsSubtype(tmptype, metaclass)) {
- metaclass = tmptype;
- continue;
- }
- PyErr_SetString(PyExc_TypeError,
- "metaclass conflict: "
- "the metaclass of a derived class "
- "must be a (non-strict) subclass "
- "of the metaclasses of all its bases");
- return NULL;
- }
- if (!metaclass) {
-#if PY_MAJOR_VERSION < 3
- metaclass = &PyClass_Type;
-#else
- metaclass = &PyType_Type;
-#endif
- }
- Py_INCREF((PyObject*) metaclass);
- return (PyObject*) metaclass;
-}
-
-/* FetchCommonType */
- static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
- PyObject* fake_module;
- PyTypeObject* cached_type = NULL;
- fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
- if (!fake_module) return NULL;
- Py_INCREF(fake_module);
- cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
- if (cached_type) {
- if (!PyType_Check((PyObject*)cached_type)) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s is not a type object",
- type->tp_name);
- goto bad;
- }
- if (cached_type->tp_basicsize != type->tp_basicsize) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s has the wrong size, try recompiling",
- type->tp_name);
- goto bad;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
- PyErr_Clear();
- if (PyType_Ready(type) < 0) goto bad;
- if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
- goto bad;
- Py_INCREF(type);
- cached_type = type;
- }
-done:
- Py_DECREF(fake_module);
- return cached_type;
-bad:
- Py_XDECREF(cached_type);
- cached_type = NULL;
- goto done;
-}
-
-/* CythonFunction */
- static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
- if (unlikely(op->func_doc == NULL)) {
- if (op->func.m_ml->ml_doc) {
-#if PY_MAJOR_VERSION >= 3
- op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
-#else
- op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
-#endif
- if (unlikely(op->func_doc == NULL))
- return NULL;
- } else {
- Py_INCREF(Py_None);
- return Py_None;
- }
- }
- Py_INCREF(op->func_doc);
- return op->func_doc;
-}
-static int
-__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp = op->func_doc;
- if (value == NULL) {
- value = Py_None;
- }
- Py_INCREF(value);
- op->func_doc = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
-{
- if (unlikely(op->func_name == NULL)) {
-#if PY_MAJOR_VERSION >= 3
- op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
-#else
- op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
-#endif
- if (unlikely(op->func_name == NULL))
- return NULL;
- }
- Py_INCREF(op->func_name);
- return op->func_name;
-}
-static int
-__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__name__ must be set to a string object");
- return -1;
- }
- tmp = op->func_name;
- Py_INCREF(value);
- op->func_name = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
-{
- Py_INCREF(op->func_qualname);
- return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__qualname__ must be set to a string object");
- return -1;
- }
- tmp = op->func_qualname;
- Py_INCREF(value);
- op->func_qualname = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
-{
- PyObject *self;
- self = m->func_closure;
- if (self == NULL)
- self = Py_None;
- Py_INCREF(self);
- return self;
-}
-static PyObject *
-__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
-{
- if (unlikely(op->func_dict == NULL)) {
- op->func_dict = PyDict_New();
- if (unlikely(op->func_dict == NULL))
- return NULL;
- }
- Py_INCREF(op->func_dict);
- return op->func_dict;
-}
-static int
-__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
- if (unlikely(value == NULL)) {
- PyErr_SetString(PyExc_TypeError,
- "function's dictionary may not be deleted");
- return -1;
- }
- if (unlikely(!PyDict_Check(value))) {
- PyErr_SetString(PyExc_TypeError,
- "setting function's dictionary to a non-dict");
- return -1;
- }
- tmp = op->func_dict;
- Py_INCREF(value);
- op->func_dict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
-{
- Py_INCREF(op->func_globals);
- return op->func_globals;
-}
-static PyObject *
-__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
-{
- Py_INCREF(Py_None);
- return Py_None;
-}
-static PyObject *
-__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
-{
- PyObject* result = (op->func_code) ? op->func_code : Py_None;
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
- int result = 0;
- PyObject *res = op->defaults_getter((PyObject *) op);
- if (unlikely(!res))
- return -1;
- #if CYTHON_COMPILING_IN_CPYTHON
- op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
- Py_INCREF(op->defaults_tuple);
- op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
- Py_INCREF(op->defaults_kwdict);
- #else
- op->defaults_tuple = PySequence_ITEM(res, 0);
- if (unlikely(!op->defaults_tuple)) result = -1;
- else {
- op->defaults_kwdict = PySequence_ITEM(res, 1);
- if (unlikely(!op->defaults_kwdict)) result = -1;
- }
- #endif
- Py_DECREF(res);
- return result;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyTuple_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__defaults__ must be set to a tuple object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_tuple;
- op->defaults_tuple = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
- PyObject* result = op->defaults_tuple;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_tuple;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__kwdefaults__ must be set to a dict object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_kwdict;
- op->defaults_kwdict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
- PyObject* result = op->defaults_kwdict;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_kwdict;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value || value == Py_None) {
- value = NULL;
- } else if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__annotations__ must be set to a dict object");
- return -1;
- }
- Py_XINCREF(value);
- tmp = op->func_annotations;
- op->func_annotations = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
- PyObject* result = op->func_annotations;
- if (unlikely(!result)) {
- result = PyDict_New();
- if (unlikely(!result)) return NULL;
- op->func_annotations = result;
- }
- Py_INCREF(result);
- return result;
-}
-static PyGetSetDef __pyx_CyFunction_getsets[] = {
- {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
- {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
- {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
- {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
- {0, 0, 0, 0, 0}
-};
-static PyMemberDef __pyx_CyFunction_members[] = {
- {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
- {0, 0, 0, 0, 0}
-};
-static PyObject *
-__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
-{
-#if PY_MAJOR_VERSION >= 3
- return PyUnicode_FromString(m->func.m_ml->ml_name);
-#else
- return PyString_FromString(m->func.m_ml->ml_name);
-#endif
-}
-static PyMethodDef __pyx_CyFunction_methods[] = {
- {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
- {0, 0, 0, 0}
-};
-#if PY_VERSION_HEX < 0x030500A0
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
-#else
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
-#endif
-static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
- PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
- __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
- if (op == NULL)
- return NULL;
- op->flags = flags;
- __Pyx_CyFunction_weakreflist(op) = NULL;
- op->func.m_ml = ml;
- op->func.m_self = (PyObject *) op;
- Py_XINCREF(closure);
- op->func_closure = closure;
- Py_XINCREF(module);
- op->func.m_module = module;
- op->func_dict = NULL;
- op->func_name = NULL;
- Py_INCREF(qualname);
- op->func_qualname = qualname;
- op->func_doc = NULL;
- op->func_classobj = NULL;
- op->func_globals = globals;
- Py_INCREF(op->func_globals);
- Py_XINCREF(code);
- op->func_code = code;
- op->defaults_pyobjects = 0;
- op->defaults = NULL;
- op->defaults_tuple = NULL;
- op->defaults_kwdict = NULL;
- op->defaults_getter = NULL;
- op->func_annotations = NULL;
- PyObject_GC_Track(op);
- return (PyObject *) op;
-}
-static int
-__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
-{
- Py_CLEAR(m->func_closure);
- Py_CLEAR(m->func.m_module);
- Py_CLEAR(m->func_dict);
- Py_CLEAR(m->func_name);
- Py_CLEAR(m->func_qualname);
- Py_CLEAR(m->func_doc);
- Py_CLEAR(m->func_globals);
- Py_CLEAR(m->func_code);
- Py_CLEAR(m->func_classobj);
- Py_CLEAR(m->defaults_tuple);
- Py_CLEAR(m->defaults_kwdict);
- Py_CLEAR(m->func_annotations);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_XDECREF(pydefaults[i]);
- PyObject_Free(m->defaults);
- m->defaults = NULL;
- }
- return 0;
-}
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
-{
- PyObject_GC_UnTrack(m);
- if (__Pyx_CyFunction_weakreflist(m) != NULL)
- PyObject_ClearWeakRefs((PyObject *) m);
- __Pyx_CyFunction_clear(m);
- PyObject_GC_Del(m);
-}
-static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
-{
- Py_VISIT(m->func_closure);
- Py_VISIT(m->func.m_module);
- Py_VISIT(m->func_dict);
- Py_VISIT(m->func_name);
- Py_VISIT(m->func_qualname);
- Py_VISIT(m->func_doc);
- Py_VISIT(m->func_globals);
- Py_VISIT(m->func_code);
- Py_VISIT(m->func_classobj);
- Py_VISIT(m->defaults_tuple);
- Py_VISIT(m->defaults_kwdict);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_VISIT(pydefaults[i]);
- }
- return 0;
-}
-static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
-{
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
- Py_INCREF(func);
- return func;
- }
- if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
- if (type == NULL)
- type = (PyObject *)(Py_TYPE(obj));
- return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
- }
- if (obj == Py_None)
- obj = NULL;
- return __Pyx_PyMethod_New(func, obj, type);
-}
-static PyObject*
-__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
-{
-#if PY_MAJOR_VERSION >= 3
- return PyUnicode_FromFormat("<cyfunction %U at %p>",
- op->func_qualname, (void *)op);
-#else
- return PyString_FromFormat("<cyfunction %s at %p>",
- PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = f->m_ml->ml_meth;
- PyObject *self = f->m_self;
- Py_ssize_t size;
- switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
- case METH_VARARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0))
- return (*meth)(self, arg);
- break;
- case METH_VARARGS | METH_KEYWORDS:
- return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
- case METH_NOARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 0))
- return (*meth)(self, NULL);
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- case METH_O:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 1)) {
- PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
- if (unlikely(!arg0)) return NULL;
- result = (*meth)(self, arg0);
- Py_DECREF(arg0);
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- default:
- PyErr_SetString(PyExc_SystemError, "Bad call flags in "
- "__Pyx_CyFunction_Call. METH_OLDARGS is no "
- "longer supported!");
- return NULL;
- }
- PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- f->m_ml->ml_name);
- return NULL;
-}
-#else
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- return PyCFunction_Call(func, arg, kw);
-}
-#endif
-static PyTypeObject __pyx_CyFunctionType_type = {
- PyVarObject_HEAD_INIT(0, 0)
- "cython_function_or_method",
- sizeof(__pyx_CyFunctionObject),
- 0,
- (destructor) __Pyx_CyFunction_dealloc,
- 0,
- 0,
- 0,
-#if PY_MAJOR_VERSION < 3
- 0,
-#else
- 0,
-#endif
- (reprfunc) __Pyx_CyFunction_repr,
- 0,
- 0,
- 0,
- 0,
- __Pyx_CyFunction_Call,
- 0,
- 0,
- 0,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
- 0,
- (traverseproc) __Pyx_CyFunction_traverse,
- (inquiry) __Pyx_CyFunction_clear,
- 0,
-#if PY_VERSION_HEX < 0x030500A0
- offsetof(__pyx_CyFunctionObject, func_weakreflist),
-#else
- offsetof(PyCFunctionObject, m_weakreflist),
-#endif
- 0,
- 0,
- __pyx_CyFunction_methods,
- __pyx_CyFunction_members,
- __pyx_CyFunction_getsets,
- 0,
- 0,
- __Pyx_CyFunction_descr_get,
- 0,
- offsetof(__pyx_CyFunctionObject, func_dict),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-#if PY_VERSION_HEX >= 0x030400a1
- 0,
-#endif
-};
-static int __pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
- __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
- __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
- if (__pyx_CyFunctionType == NULL) {
- return -1;
- }
- return 0;
-}
-static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults = PyObject_Malloc(size);
- if (!m->defaults)
- return PyErr_NoMemory();
- memset(m->defaults, 0, size);
- m->defaults_pyobjects = pyobjects;
- return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_tuple = tuple;
- Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_kwdict = dict;
- Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->func_annotations = dict;
- Py_INCREF(dict);
-}
-
-/* Py3ClassCreate */
- static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
- PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
- PyObject *ns;
- if (metaclass) {
- PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
- if (prep) {
- PyObject *pargs = PyTuple_Pack(2, name, bases);
- if (unlikely(!pargs)) {
- Py_DECREF(prep);
- return NULL;
- }
- ns = PyObject_Call(prep, pargs, mkw);
- Py_DECREF(prep);
- Py_DECREF(pargs);
- } else {
- if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
- return NULL;
- PyErr_Clear();
- ns = PyDict_New();
- }
- } else {
- ns = PyDict_New();
- }
- if (unlikely(!ns))
- return NULL;
- if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
- if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
- if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
- return ns;
-bad:
- Py_DECREF(ns);
- return NULL;
-}
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
- PyObject *dict, PyObject *mkw,
- int calculate_metaclass, int allow_py2_metaclass) {
- PyObject *result, *margs;
- PyObject *owned_metaclass = NULL;
- if (allow_py2_metaclass) {
- owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
- if (owned_metaclass) {
- metaclass = owned_metaclass;
- } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
- PyErr_Clear();
- } else {
- return NULL;
- }
- }
- if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
- metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
- Py_XDECREF(owned_metaclass);
- if (unlikely(!metaclass))
- return NULL;
- owned_metaclass = metaclass;
- }
- margs = PyTuple_Pack(3, name, bases, dict);
- if (unlikely(!margs)) {
- result = NULL;
- } else {
- result = PyObject_Call(metaclass, margs, mkw);
- Py_DECREF(margs);
- }
- Py_XDECREF(owned_metaclass);
- return result;
-}
-
-/* CodeObjectCache */
- static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = start + (end - start) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-/* AddTraceback */
- #include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(filename);
- #else
- py_srcfile = PyUnicode_FromString(filename);
- #endif
- if (!py_srcfile) goto bad;
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_code = __Pyx_PyCode_New(
- 0,
- 0,
- 0,
- 0,
- 0,
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line,
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- Py_DECREF(py_funcname);
- return py_code;
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyFrameObject *py_frame = 0;
- py_code = __pyx_find_code_object(c_line ? c_line : py_line);
- if (!py_code) {
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) goto bad;
- __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
- }
- py_frame = PyFrame_New(
- PyThreadState_GET(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- __pyx_d, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = (long) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(long),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = (int) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(int) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(int) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(int),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
- const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(unsigned long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
- const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(PY_LONG_LONG) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG),
- little, !is_unsigned);
- }
-}
-
-/* CIntFromPyVerify */
- #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
-#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
-#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
- {\
- func_type value = func_value;\
- if (sizeof(target_type) < sizeof(func_type)) {\
- if (unlikely(value != (func_type) (target_type) value)) {\
- func_type zero = 0;\
- if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
- return (target_type) -1;\
- if (is_unsigned && unlikely(value < zero))\
- goto raise_neg_overflow;\
- else\
- goto raise_overflow;\
- }\
- }\
- return (target_type) value;\
- }
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nc_type(nc_type value) {
- const nc_type neg_one = (nc_type) -1, const_zero = (nc_type) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(nc_type) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(nc_type) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(nc_type) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(nc_type) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(nc_type) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(nc_type),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
- const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(npy_intp) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(npy_intp) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
- const char neg_one = (char) -1, const_zero = (char) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(char) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(char) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
- }
- } else {
- if (sizeof(char) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(char),
- little, !is_unsigned);
- }
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = (int) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(int) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (int) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
- return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
- return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
- return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (int) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
- case -2:
- if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(int) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- int val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (int) -1;
- }
- } else {
- int val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (int) -1;
- val = __Pyx_PyInt_As_int(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to int");
- return (int) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to int");
- return (int) -1;
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
- const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(size_t) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (size_t) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (size_t) 0;
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
- case 2:
- if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
- return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
- return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
- return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (size_t) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(size_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (size_t) 0;
- case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
- case -2:
- if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
- return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
- return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
- return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
- return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
- return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
- return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(size_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
- } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- size_t val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (size_t) -1;
- }
- } else {
- size_t val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (size_t) -1;
- val = __Pyx_PyInt_As_size_t(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to size_t");
- return (size_t) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to size_t");
- return (size_t) -1;
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE nc_type __Pyx_PyInt_As_nc_type(PyObject *x) {
- const nc_type neg_one = (nc_type) -1, const_zero = (nc_type) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(nc_type) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(nc_type, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (nc_type) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (nc_type) 0;
- case 1: __PYX_VERIFY_RETURN_INT(nc_type, digit, digits[0])
- case 2:
- if (8 * sizeof(nc_type) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) >= 2 * PyLong_SHIFT) {
- return (nc_type) (((((nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(nc_type) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) >= 3 * PyLong_SHIFT) {
- return (nc_type) (((((((nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(nc_type) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) >= 4 * PyLong_SHIFT) {
- return (nc_type) (((((((((nc_type)digits[3]) << PyLong_SHIFT) | (nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (nc_type) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(nc_type) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(nc_type, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(nc_type) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(nc_type, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (nc_type) 0;
- case -1: __PYX_VERIFY_RETURN_INT(nc_type, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(nc_type, digit, +digits[0])
- case -2:
- if (8 * sizeof(nc_type) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 2 * PyLong_SHIFT) {
- return (nc_type) (((nc_type)-1)*(((((nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(nc_type) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 2 * PyLong_SHIFT) {
- return (nc_type) ((((((nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(nc_type) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 3 * PyLong_SHIFT) {
- return (nc_type) (((nc_type)-1)*(((((((nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(nc_type) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 3 * PyLong_SHIFT) {
- return (nc_type) ((((((((nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(nc_type) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 4 * PyLong_SHIFT) {
- return (nc_type) (((nc_type)-1)*(((((((((nc_type)digits[3]) << PyLong_SHIFT) | (nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(nc_type) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(nc_type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(nc_type) - 1 > 4 * PyLong_SHIFT) {
- return (nc_type) ((((((((((nc_type)digits[3]) << PyLong_SHIFT) | (nc_type)digits[2]) << PyLong_SHIFT) | (nc_type)digits[1]) << PyLong_SHIFT) | (nc_type)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(nc_type) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(nc_type, long, PyLong_AsLong(x))
- } else if (sizeof(nc_type) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(nc_type, PY_LONG_LONG, PyLong_AsLongLong(x))
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- nc_type val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (nc_type) -1;
- }
- } else {
- nc_type val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (nc_type) -1;
- val = __Pyx_PyInt_As_nc_type(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to nc_type");
- return (nc_type) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to nc_type");
- return (nc_type) -1;
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE ptrdiff_t __Pyx_PyInt_As_ptrdiff_t(PyObject *x) {
- const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(ptrdiff_t) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (ptrdiff_t) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (ptrdiff_t) 0;
- case 1: __PYX_VERIFY_RETURN_INT(ptrdiff_t, digit, digits[0])
- case 2:
- if (8 * sizeof(ptrdiff_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) >= 2 * PyLong_SHIFT) {
- return (ptrdiff_t) (((((ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(ptrdiff_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) >= 3 * PyLong_SHIFT) {
- return (ptrdiff_t) (((((((ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(ptrdiff_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) >= 4 * PyLong_SHIFT) {
- return (ptrdiff_t) (((((((((ptrdiff_t)digits[3]) << PyLong_SHIFT) | (ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (ptrdiff_t) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(ptrdiff_t, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(ptrdiff_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (ptrdiff_t) 0;
- case -1: __PYX_VERIFY_RETURN_INT(ptrdiff_t, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(ptrdiff_t, digit, +digits[0])
- case -2:
- if (8 * sizeof(ptrdiff_t) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 2 * PyLong_SHIFT) {
- return (ptrdiff_t) (((ptrdiff_t)-1)*(((((ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(ptrdiff_t) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 2 * PyLong_SHIFT) {
- return (ptrdiff_t) ((((((ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(ptrdiff_t) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 3 * PyLong_SHIFT) {
- return (ptrdiff_t) (((ptrdiff_t)-1)*(((((((ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(ptrdiff_t) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 3 * PyLong_SHIFT) {
- return (ptrdiff_t) ((((((((ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(ptrdiff_t) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 4 * PyLong_SHIFT) {
- return (ptrdiff_t) (((ptrdiff_t)-1)*(((((((((ptrdiff_t)digits[3]) << PyLong_SHIFT) | (ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(ptrdiff_t) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(ptrdiff_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(ptrdiff_t) - 1 > 4 * PyLong_SHIFT) {
- return (ptrdiff_t) ((((((((((ptrdiff_t)digits[3]) << PyLong_SHIFT) | (ptrdiff_t)digits[2]) << PyLong_SHIFT) | (ptrdiff_t)digits[1]) << PyLong_SHIFT) | (ptrdiff_t)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(ptrdiff_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(ptrdiff_t, long, PyLong_AsLong(x))
- } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(ptrdiff_t, PY_LONG_LONG, PyLong_AsLongLong(x))
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- ptrdiff_t val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (ptrdiff_t) -1;
- }
- } else {
- ptrdiff_t val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (ptrdiff_t) -1;
- val = __Pyx_PyInt_As_ptrdiff_t(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to ptrdiff_t");
- return (ptrdiff_t) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to ptrdiff_t");
- return (ptrdiff_t) -1;
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = (long) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(long) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (long) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
- return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
- return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
- return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (long) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
- case -2:
- if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(long) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- long val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (long) -1;
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (long) -1;
- val = __Pyx_PyInt_As_long(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to long");
- return (long) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long) -1;
-}
-
-/* CoroutineBase */
- #include <structmember.h>
-#include <frameobject.h>
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Coroutine_Close(PyObject *self);
-static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
-#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
- PyObject *et, *ev, *tb;
- PyObject *value = NULL;
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&et, &ev, &tb);
- if (!et) {
- Py_XDECREF(tb);
- Py_XDECREF(ev);
- Py_INCREF(Py_None);
- *pvalue = Py_None;
- return 0;
- }
- if (likely(et == PyExc_StopIteration)) {
-#if PY_VERSION_HEX >= 0x030300A0
- if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
- value = ((PyStopIterationObject *)ev)->value;
- Py_INCREF(value);
- Py_DECREF(ev);
- Py_XDECREF(tb);
- Py_DECREF(et);
- *pvalue = value;
- return 0;
- }
-#endif
- if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
- if (!ev) {
- Py_INCREF(Py_None);
- ev = Py_None;
- } else if (PyTuple_Check(ev)) {
- if (PyTuple_GET_SIZE(ev) >= 1) {
- PyObject *value;
-#if CYTHON_COMPILING_IN_CPYTHON
- value = PySequence_ITEM(ev, 0);
-#else
- value = PyTuple_GET_ITEM(ev, 0);
- Py_INCREF(value);
-#endif
- Py_DECREF(ev);
- ev = value;
- } else {
- Py_INCREF(Py_None);
- Py_DECREF(ev);
- ev = Py_None;
- }
- }
- Py_XDECREF(tb);
- Py_DECREF(et);
- *pvalue = ev;
- return 0;
- }
- } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
- __Pyx_ErrRestore(et, ev, tb);
- return -1;
- }
- PyErr_NormalizeException(&et, &ev, &tb);
- if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
- __Pyx_ErrRestore(et, ev, tb);
- return -1;
- }
- Py_XDECREF(tb);
- Py_DECREF(et);
-#if PY_VERSION_HEX >= 0x030300A0
- value = ((PyStopIterationObject *)ev)->value;
- Py_INCREF(value);
- Py_DECREF(ev);
-#else
- {
- PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
- Py_DECREF(ev);
- if (likely(args)) {
- value = PySequence_GetItem(args, 0);
- Py_DECREF(args);
- }
- if (unlikely(!value)) {
- __Pyx_ErrRestore(NULL, NULL, NULL);
- Py_INCREF(Py_None);
- value = Py_None;
- }
- }
-#endif
- *pvalue = value;
- return 0;
-}
-#endif
-static CYTHON_INLINE
-void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
- PyObject *exc_type = self->exc_type;
- PyObject *exc_value = self->exc_value;
- PyObject *exc_traceback = self->exc_traceback;
- self->exc_type = NULL;
- self->exc_value = NULL;
- self->exc_traceback = NULL;
- Py_XDECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_traceback);
-}
-static CYTHON_INLINE
-int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
- if (unlikely(gen->is_running)) {
- PyErr_SetString(PyExc_ValueError,
- "generator already executing");
- return 1;
- }
- return 0;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
- PyObject *retval;
- __Pyx_PyThreadState_declare
- assert(!self->is_running);
- if (unlikely(self->resume_label == 0)) {
- if (unlikely(value && value != Py_None)) {
- PyErr_SetString(PyExc_TypeError,
- "can't send non-None value to a "
- "just-started generator");
- return NULL;
- }
- }
- if (unlikely(self->resume_label == -1)) {
- PyErr_SetNone(PyExc_StopIteration);
- return NULL;
- }
- __Pyx_PyThreadState_assign
- if (value) {
-#if CYTHON_COMPILING_IN_PYPY
-#else
- if (self->exc_traceback) {
- PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
- PyFrameObject *f = tb->tb_frame;
- Py_XINCREF(__pyx_tstate->frame);
- assert(f->f_back == NULL);
- f->f_back = __pyx_tstate->frame;
- }
-#endif
- __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
- &self->exc_traceback);
- } else {
- __Pyx_Coroutine_ExceptionClear(self);
- }
- self->is_running = 1;
- retval = self->body((PyObject *) self, value);
- self->is_running = 0;
- if (retval) {
- __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
- &self->exc_traceback);
-#if CYTHON_COMPILING_IN_PYPY
-#else
- if (self->exc_traceback) {
- PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
- PyFrameObject *f = tb->tb_frame;
- Py_CLEAR(f->f_back);
- }
-#endif
- } else {
- __Pyx_Coroutine_ExceptionClear(self);
- }
- return retval;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
- if (unlikely(!retval && !PyErr_Occurred())) {
- PyErr_SetNone(PyExc_StopIteration);
- }
- return retval;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
- PyObject *ret;
- PyObject *val = NULL;
- __Pyx_Coroutine_Undelegate(gen);
- __Pyx_PyGen_FetchStopIterationValue(&val);
- ret = __Pyx_Coroutine_SendEx(gen, val);
- Py_XDECREF(val);
- return ret;
-}
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
- PyObject *retval;
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
- return NULL;
- if (yf) {
- PyObject *ret;
- gen->is_running = 1;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Coroutine_Send(yf, value);
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_CheckExact(yf)) {
- ret = __Pyx_Coroutine_Send(yf, value);
- } else
- #endif
- {
- if (value == Py_None)
- ret = Py_TYPE(yf)->tp_iternext(yf);
- else
- ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
- }
- gen->is_running = 0;
- if (likely(ret)) {
- return ret;
- }
- retval = __Pyx_Coroutine_FinishDelegation(gen);
- } else {
- retval = __Pyx_Coroutine_SendEx(gen, value);
- }
- return __Pyx_Coroutine_MethodReturn(retval);
-}
-static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
- PyObject *retval = NULL;
- int err = 0;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- retval = __Pyx_Coroutine_Close(yf);
- if (!retval)
- return -1;
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_CheckExact(yf)) {
- retval = __Pyx_Coroutine_Close(yf);
- if (!retval)
- return -1;
- } else
- #endif
- {
- PyObject *meth;
- gen->is_running = 1;
- meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
- if (unlikely(!meth)) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_WriteUnraisable(yf);
- }
- PyErr_Clear();
- } else {
- retval = PyObject_CallFunction(meth, NULL);
- Py_DECREF(meth);
- if (!retval)
- err = -1;
- }
- gen->is_running = 0;
- }
- Py_XDECREF(retval);
- return err;
-}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
- return NULL;
- if (yf) {
- PyObject *ret;
- gen->is_running = 1;
- ret = Py_TYPE(yf)->tp_iternext(yf);
- gen->is_running = 0;
- if (likely(ret)) {
- return ret;
- }
- return __Pyx_Coroutine_FinishDelegation(gen);
- }
- return __Pyx_Coroutine_SendEx(gen, Py_None);
-}
-static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject *retval, *raised_exception;
- PyObject *yf = gen->yieldfrom;
- int err = 0;
- if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
- return NULL;
- if (yf) {
- Py_INCREF(yf);
- err = __Pyx_Coroutine_CloseIter(gen, yf);
- __Pyx_Coroutine_Undelegate(gen);
- Py_DECREF(yf);
- }
- if (err == 0)
- PyErr_SetNone(PyExc_GeneratorExit);
- retval = __Pyx_Coroutine_SendEx(gen, NULL);
- if (retval) {
- Py_DECREF(retval);
- PyErr_SetString(PyExc_RuntimeError,
- "generator ignored GeneratorExit");
- return NULL;
- }
- raised_exception = PyErr_Occurred();
- if (!raised_exception
- || raised_exception == PyExc_StopIteration
- || raised_exception == PyExc_GeneratorExit
- || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
- || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
- {
- if (raised_exception) PyErr_Clear();
- Py_INCREF(Py_None);
- return Py_None;
- }
- return NULL;
-}
-static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject *typ;
- PyObject *tb = NULL;
- PyObject *val = NULL;
- PyObject *yf = gen->yieldfrom;
- if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
- return NULL;
- if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
- return NULL;
- if (yf) {
- PyObject *ret;
- Py_INCREF(yf);
- if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
- int err = __Pyx_Coroutine_CloseIter(gen, yf);
- Py_DECREF(yf);
- __Pyx_Coroutine_Undelegate(gen);
- if (err < 0)
- return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
- goto throw_here;
- }
- gen->is_running = 1;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Coroutine_Throw(yf, args);
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_CheckExact(yf)) {
- ret = __Pyx_Coroutine_Throw(yf, args);
- } else
- #endif
- {
- PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
- if (unlikely(!meth)) {
- Py_DECREF(yf);
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
- gen->is_running = 0;
- return NULL;
- }
- PyErr_Clear();
- __Pyx_Coroutine_Undelegate(gen);
- gen->is_running = 0;
- goto throw_here;
- }
- ret = PyObject_CallObject(meth, args);
- Py_DECREF(meth);
- }
- gen->is_running = 0;
- Py_DECREF(yf);
- if (!ret) {
- ret = __Pyx_Coroutine_FinishDelegation(gen);
- }
- return __Pyx_Coroutine_MethodReturn(ret);
- }
-throw_here:
- __Pyx_Raise(typ, val, tb, NULL);
- return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
-}
-static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- Py_VISIT(gen->closure);
- Py_VISIT(gen->classobj);
- Py_VISIT(gen->yieldfrom);
- Py_VISIT(gen->exc_type);
- Py_VISIT(gen->exc_value);
- Py_VISIT(gen->exc_traceback);
- return 0;
-}
-static int __Pyx_Coroutine_clear(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- Py_CLEAR(gen->closure);
- Py_CLEAR(gen->classobj);
- Py_CLEAR(gen->yieldfrom);
- Py_CLEAR(gen->exc_type);
- Py_CLEAR(gen->exc_value);
- Py_CLEAR(gen->exc_traceback);
- Py_CLEAR(gen->gi_name);
- Py_CLEAR(gen->gi_qualname);
- return 0;
-}
-static void __Pyx_Coroutine_dealloc(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject_GC_UnTrack(gen);
- if (gen->gi_weakreflist != NULL)
- PyObject_ClearWeakRefs(self);
- if (gen->resume_label > 0) {
- PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
- if (PyObject_CallFinalizerFromDealloc(self))
-#else
- Py_TYPE(gen)->tp_del(self);
- if (self->ob_refcnt > 0)
-#endif
- {
- return;
- }
- PyObject_GC_UnTrack(self);
- }
- __Pyx_Coroutine_clear(self);
- PyObject_GC_Del(gen);
-}
-static void __Pyx_Coroutine_del(PyObject *self) {
- PyObject *res;
- PyObject *error_type, *error_value, *error_traceback;
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- __Pyx_PyThreadState_declare
- if (gen->resume_label <= 0)
- return ;
-#if PY_VERSION_HEX < 0x030400a1
- assert(self->ob_refcnt == 0);
- self->ob_refcnt = 1;
-#endif
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
- res = __Pyx_Coroutine_Close(self);
- if (res == NULL)
- PyErr_WriteUnraisable(self);
- else
- Py_DECREF(res);
- __Pyx_ErrRestore(error_type, error_value, error_traceback);
-#if PY_VERSION_HEX < 0x030400a1
- assert(self->ob_refcnt > 0);
- if (--self->ob_refcnt == 0) {
- return;
- }
- {
- Py_ssize_t refcnt = self->ob_refcnt;
- _Py_NewReference(self);
- self->ob_refcnt = refcnt;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- assert(PyType_IS_GC(self->ob_type) &&
- _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
- _Py_DEC_REFTOTAL;
-#endif
-#ifdef COUNT_ALLOCS
- --Py_TYPE(self)->tp_frees;
- --Py_TYPE(self)->tp_allocs;
-#endif
-#endif
-}
-static PyObject *
-__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
-{
- Py_INCREF(self->gi_name);
- return self->gi_name;
-}
-static int
-__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__name__ must be set to a string object");
- return -1;
- }
- tmp = self->gi_name;
- Py_INCREF(value);
- self->gi_name = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
-{
- Py_INCREF(self->gi_qualname);
- return self->gi_qualname;
-}
-static int
-__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__qualname__ must be set to a string object");
- return -1;
- }
- tmp = self->gi_qualname;
- Py_INCREF(value);
- self->gi_qualname = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject* type, __pyx_coroutine_body_t body,
- PyObject *closure, PyObject *name, PyObject *qualname) {
- __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
- if (gen == NULL)
- return NULL;
- gen->body = body;
- gen->closure = closure;
- Py_XINCREF(closure);
- gen->is_running = 0;
- gen->resume_label = 0;
- gen->classobj = NULL;
- gen->yieldfrom = NULL;
- gen->exc_type = NULL;
- gen->exc_value = NULL;
- gen->exc_traceback = NULL;
- gen->gi_weakreflist = NULL;
- Py_XINCREF(qualname);
- gen->gi_qualname = qualname;
- Py_XINCREF(name);
- gen->gi_name = name;
- PyObject_GC_Track(gen);
- return gen;
-}
-
-/* PatchModuleWithCoroutine */
- static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
-#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- int result;
- PyObject *globals, *result_obj;
- globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
- result = PyDict_SetItemString(globals, "_cython_coroutine_type",
- #ifdef __Pyx_Coroutine_USED
- (PyObject*)__pyx_CoroutineType);
- #else
- Py_None);
- #endif
- if (unlikely(result < 0)) goto ignore;
- result = PyDict_SetItemString(globals, "_cython_generator_type",
- #ifdef __Pyx_Generator_USED
- (PyObject*)__pyx_GeneratorType);
- #else
- Py_None);
- #endif
- if (unlikely(result < 0)) goto ignore;
- if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
- if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
- result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
- if (unlikely(!result_obj)) goto ignore;
- Py_DECREF(result_obj);
- Py_DECREF(globals);
- return module;
-ignore:
- Py_XDECREF(globals);
- PyErr_WriteUnraisable(module);
- if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
- Py_DECREF(module);
- module = NULL;
- }
-#else
- py_code++;
-#endif
- return module;
-}
-
-/* PatchGeneratorABC */
- #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
-static PyObject* __Pyx_patch_abc_module(PyObject *module);
-static PyObject* __Pyx_patch_abc_module(PyObject *module) {
- module = __Pyx_Coroutine_patch_module(
- module, ""
-"if _cython_generator_type is not None:\n"
-" try: Generator = _module.Generator\n"
-" except AttributeError: pass\n"
-" else: Generator.register(_cython_generator_type)\n"
-"if _cython_coroutine_type is not None:\n"
-" try: Coroutine = _module.Coroutine\n"
-" except AttributeError: pass\n"
-" else: Coroutine.register(_cython_coroutine_type)\n"
- );
- return module;
-}
-#endif
-static int __Pyx_patch_abc(void) {
-#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- static int abc_patched = 0;
- if (!abc_patched) {
- PyObject *module;
- module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
- if (!module) {
- PyErr_WriteUnraisable(NULL);
- if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
- ((PY_VERSION_HEX >= 0x03030000) ?
- "Cython module failed to register with collections.abc module" :
- "Cython module failed to register with collections module"), 1) < 0)) {
- return -1;
- }
- } else {
- module = __Pyx_patch_abc_module(module);
- abc_patched = 1;
- if (unlikely(!module))
- return -1;
- Py_DECREF(module);
- }
- module = PyImport_ImportModule("backports_abc");
- if (module) {
- module = __Pyx_patch_abc_module(module);
- Py_XDECREF(module);
- }
- if (!module) {
- PyErr_Clear();
- }
- }
-#else
- if (0) __Pyx_Coroutine_patch_module(NULL, NULL);
-#endif
- return 0;
-}
-
-/* Generator */
- static PyMethodDef __pyx_Generator_methods[] = {
- {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
- (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
- {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
- (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
- {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
- (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
- {0, 0, 0, 0}
-};
-static PyMemberDef __pyx_Generator_memberlist[] = {
- {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
- {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
- (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
- {0, 0, 0, 0, 0}
-};
-static PyGetSetDef __pyx_Generator_getsets[] = {
- {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
- (char*) PyDoc_STR("name of the generator"), 0},
- {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
- (char*) PyDoc_STR("qualified name of the generator"), 0},
- {0, 0, 0, 0, 0}
-};
-static PyTypeObject __pyx_GeneratorType_type = {
- PyVarObject_HEAD_INIT(0, 0)
- "generator",
- sizeof(__pyx_CoroutineObject),
- 0,
- (destructor) __Pyx_Coroutine_dealloc,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
- 0,
- (traverseproc) __Pyx_Coroutine_traverse,
- 0,
- 0,
- offsetof(__pyx_CoroutineObject, gi_weakreflist),
- 0,
- (iternextfunc) __Pyx_Generator_Next,
- __pyx_Generator_methods,
- __pyx_Generator_memberlist,
- __pyx_Generator_getsets,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-#if PY_VERSION_HEX >= 0x030400a1
- 0,
-#else
- __Pyx_Coroutine_del,
-#endif
- 0,
-#if PY_VERSION_HEX >= 0x030400a1
- __Pyx_Coroutine_del,
-#endif
-};
-static int __pyx_Generator_init(void) {
- __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
- __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
- __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
- if (unlikely(!__pyx_GeneratorType)) {
- return -1;
- }
- return 0;
-}
-
-/* CheckBinaryVersion */
- static int __Pyx_check_binary_version(void) {
- char ctversion[4], rtversion[4];
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
- char message[200];
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- return PyErr_WarnEx(NULL, message, 1);
- }
- return 0;
-}
-
-/* ModuleImport */
- #ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
- PyObject *py_name = 0;
- PyObject *py_module = 0;
- py_name = __Pyx_PyIdentifier_FromString(name);
- if (!py_name)
- goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
-bad:
- Py_XDECREF(py_name);
- return 0;
-}
-#endif
-
-/* TypeImport */
- #ifndef __PYX_HAVE_RT_ImportType
-#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
- size_t size, int strict)
-{
- PyObject *py_module = 0;
- PyObject *result = 0;
- PyObject *py_name = 0;
- char warning[200];
- Py_ssize_t basicsize;
-#ifdef Py_LIMITED_API
- PyObject *py_basicsize;
-#endif
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- py_name = __Pyx_PyIdentifier_FromString(class_name);
- if (!py_name)
- goto bad;
- result = PyObject_GetAttr(py_module, py_name);
- Py_DECREF(py_name);
- py_name = 0;
- Py_DECREF(py_module);
- py_module = 0;
- if (!result)
- goto bad;
- if (!PyType_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "%.200s.%.200s is not a type object",
- module_name, class_name);
- goto bad;
- }
-#ifndef Py_LIMITED_API
- basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
- py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
- if (!py_basicsize)
- goto bad;
- basicsize = PyLong_AsSsize_t(py_basicsize);
- Py_DECREF(py_basicsize);
- py_basicsize = 0;
- if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
- goto bad;
-#endif
- if (!strict && (size_t)basicsize > size) {
- PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
- module_name, class_name, basicsize, size);
- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
- }
- else if ((size_t)basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
- module_name, class_name, basicsize, size);
- goto bad;
- }
- return (PyTypeObject *)result;
-bad:
- Py_XDECREF(py_module);
- Py_XDECREF(result);
- return NULL;
-}
-#endif
-
-/* InitStrings */
- static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-#else
- if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_LENGTH(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif
-#endif
- } else
-#endif
-#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
- if (PyByteArray_Check(o)) {
- *length = PyByteArray_GET_SIZE(o);
- return PyByteArray_AS_STRING(o);
- } else
-#endif
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (unlikely(r < 0)) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
- PyNumberMethods *m;
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return __Pyx_NewRef(x);
- m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
-#else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
-#endif
- if (res) {
-#if PY_MAJOR_VERSION < 3
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%.4s__ returned non-%.4s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject *x;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(b))) {
- if (sizeof(Py_ssize_t) >= sizeof(long))
- return PyInt_AS_LONG(b);
- else
- return PyInt_AsSsize_t(x);
- }
-#endif
- if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)b)->ob_digit;
- const Py_ssize_t size = Py_SIZE(b);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- ival = likely(size) ? digits[0] : 0;
- if (size == -1) ival = -ival;
- return ival;
- } else {
- switch (size) {
- case 2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- }
- }
- #endif
- return PyLong_AsSsize_t(b);
- }
- x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
- return PyInt_FromSize_t(ival);
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/netCDF4/_netCDF4.pyx b/netCDF4/_netCDF4.pyx
index f124e46..eabe485 100644
--- a/netCDF4/_netCDF4.pyx
+++ b/netCDF4/_netCDF4.pyx
@@ -1,5 +1,5 @@
"""
-Version 1.2.7
+Version 1.2.8
-------------
- - -
@@ -38,12 +38,7 @@ Requires
- Python 2.7 or later (python 3 works too).
- [numpy array module](http://numpy.scipy.org), version 1.7.0 or later.
- - [Cython](http://cython.org), 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.
+ - [Cython](http://cython.org), version 0.19 or later.
- The HDF5 C library version 1.8.4-patch1 or higher (1.8.x recommended)
from [](ftp://ftp.hdfgroup.org/HDF5/current/src).
***netCDF version 4.4.1 or higher is recommended if using HDF5 1.10.x -
@@ -337,8 +332,8 @@ used later to access and set variable data and attributes.
:::python
>>> times = rootgrp.createVariable("time","f8",("time",))
>>> levels = rootgrp.createVariable("level","i4",("level",))
- >>> latitudes = rootgrp.createVariable("latitude","f4",("lat",))
- >>> longitudes = rootgrp.createVariable("longitude","f4",("lon",))
+ >>> latitudes = rootgrp.createVariable("lat","f4",("lat",))
+ >>> longitudes = rootgrp.createVariable("lon","f4",("lon",))
>>> # two dimensions unlimited
>>> temp = rootgrp.createVariable("temp","f4",("time","level","lat","lon",))
@@ -385,8 +380,8 @@ 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>),
+ ("lat", <netCDF4.Variable object at 0x1b4baf0>),
+ ("lon", <netCDF4.Variable object at 0x1b4bb30>),
("temp", <netCDF4.Variable object at 0x1b4bb70>)])
`netCDF4.Variable` names can be changed using the
@@ -539,7 +534,7 @@ will be a numpy scalar array.
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
+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 function called `netCDF4.num2date` and `netCDF4.date2num` are
provided with this package to do just that. Here's an example of how they
@@ -916,8 +911,8 @@ PERFORMANCE OF THIS SOFTWARE.
"""
# Make changes to this file, not the c-wrappers that Cython generates.
-
from cpython.mem cimport PyMem_Malloc, PyMem_Free
+from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS
# pure python utilities
from .utils import (_StartCountStride, _quantize, _find_dim, _walk_grps,
@@ -936,7 +931,7 @@ except ImportError:
# python3: zip is already python2's itertools.izip
pass
-__version__ = "1.2.7"
+__version__ = "1.2.8"
# Initialize numpy
import posixpath
@@ -947,11 +942,11 @@ import sys
import warnings
from glob import glob
from numpy import ma
-from libc.string cimport memcpy
+from libc.string cimport memcpy, memset
from libc.stdlib cimport malloc, free
import_array()
-include "netCDF4.pxi"
include "constants.pyx"
+include "netCDF4.pxi"
# check for required version of netcdf-4 and hdf5.
@@ -980,6 +975,7 @@ __has_rename_grp__ = HAS_RENAME_GRP
__has_nc_inq_path__ = HAS_NC_INQ_PATH
__has_nc_inq_format_extended__ = HAS_NC_INQ_FORMAT_EXTENDED
__has_cdf5__ = HAS_CDF5_FORMAT
+__has_nc_open_mem__ = HAS_NC_OPEN_MEM
_needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \
(__netcdf4libversion__.startswith("4.4.0") and \
"-development" in __netcdf4libversion__)
@@ -1054,16 +1050,14 @@ default_fillvals = {#'S1':NC_FILL_CHAR,
is_native_little = numpy.dtype('<f4').byteorder == '='
is_native_big = numpy.dtype('>f4').byteorder == '='
-# hard code this here, instead of importing from netcdf.h
+# hard code these here, instead of importing from netcdf.h
# so it will compile with versions <= 4.2.
NC_DISKLESS = 0x0008
-# encoding used to convert strings to bytes when writing text data
-# to the netcdf file, and for converting bytes to strings when reading
-# from the netcdf file.
-default_encoding = 'utf-8'
-# unicode decode/encode error handling. Replace bad chars with "?"
-# can be set to 'strict' or 'ignore'.
+
+# next two lines do nothing, preserved for backwards compatibility.
+default_encoding = 'utf-8'
unicode_error = 'replace'
+
python3 = sys.version_info[0] > 2
if python3:
buffer = memoryview
@@ -1095,17 +1089,19 @@ cdef _get_att_names(int grpid, int varid):
ierr = nc_inq_attname(grpid, varid, n, namstring)
if ierr != NC_NOERR:
raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
- attslist.append(namstring.decode(default_encoding,unicode_error))
+ # attribute names are assumed to be utf-8
+ attslist.append(namstring.decode('utf-8'))
return attslist
-cdef _get_att(grp, int varid, name):
+cdef _get_att(grp, int varid, name, encoding='utf-8'):
# Private function to get an attribute value given its name
cdef int ierr, n, _grpid
cdef size_t att_len
cdef char *attname
cdef nc_type att_type
cdef ndarray value_arr
- bytestr = _strencode(name)
+ # attribute names are assumed to be utf-8
+ bytestr = _strencode(name,encoding='utf-8')
attname = bytestr
_grpid = grp._grpid
with nogil:
@@ -1125,7 +1121,7 @@ cdef _get_att(grp, int varid, name):
pstring = value_arr.tostring()
else:
pstring =\
- value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','')
+ value_arr.tostring().decode(encoding,errors='replace').replace('\x00','')
return pstring
elif att_type == NC_STRING:
values = <char**>PyMem_Malloc(sizeof(char*) * att_len)
@@ -1137,7 +1133,7 @@ cdef _get_att(grp, int varid, name):
if ierr != NC_NOERR:
raise AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
try:
- result = [values[j].decode(default_encoding,unicode_error).replace('\x00','')
+ result = [values[j].decode(encoding,errors='replace').replace('\x00','')
for j in range(att_len)]
finally:
ierr = nc_free_string(att_len, values) # free memory in netcdf C lib
@@ -1348,7 +1344,7 @@ cdef _get_types(group):
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
if classp == NC_COMPOUND: # a compound
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
# read the compound type info from the file,
# create a CompoundType instance from it.
try:
@@ -1359,7 +1355,7 @@ cdef _get_types(group):
continue
cmptypes[name] = cmptype
elif classp == NC_VLEN: # a vlen
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
# read the VLEN type info from the file,
# create a VLType instance from it.
try:
@@ -1370,7 +1366,7 @@ cdef _get_types(group):
continue
vltypes[name] = vltype
elif classp == NC_ENUM: # an enum type
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
# read the Enum type info from the file,
# create a EnumType instance from it.
try:
@@ -1412,7 +1408,7 @@ cdef _get_dims(group):
ierr = nc_inq_dimname(_grpid, dimids[n], namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
dimensions[name] = Dimension(group, name, id=dimids[n])
free(dimids)
return dimensions
@@ -1442,7 +1438,7 @@ cdef _get_grps(group):
ierr = nc_inq_grpname(grpids[n], namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
groups[name] = Group(group, name, id=grpids[n])
free(grpids)
return groups
@@ -1483,7 +1479,7 @@ cdef _get_vars(group):
ierr = nc_inq_varname(_grpid, varid, namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
# get variable type.
@@ -1578,14 +1574,18 @@ cdef _get_vars(group):
free(varids) # free pointer holding variable ids.
return variables
+cdef _ensure_nc_success(ierr, err_cls=RuntimeError):
+ if ierr != NC_NOERR:
+ raise err_cls((<char *>nc_strerror(ierr)).decode('ascii'))
+
# these are class attributes that
# only exist at the python level (not in the netCDF file).
-_private_atts =\
+_private_atts = \
['_grpid','_grp','_varid','groups','dimensions','variables','dtype','data_model','disk_format',
'_nunlimdim','path','parent','ndim','mask','scale','cmptypes','vltypes','enumtypes','_isprimitive',
'file_format','_isvlen','_isenum','_iscompound','_cmptype','_vltype','_enumtype','name',
- '__orthogoral_indexing__','keepweakref','_has_lsd']
+ '__orthogoral_indexing__','keepweakref','_has_lsd', '_buffer','chartostring']
__pdoc__ = {}
cdef class Dataset:
@@ -1658,6 +1658,7 @@ references to the parent Dataset or Group.
cdef object __weakref__
cdef public int _grpid
cdef public int _isopen
+ cdef Py_buffer _buffer
cdef public groups, dimensions, variables, disk_format, path, parent,\
file_format, data_model, cmptypes, vltypes, enumtypes, __orthogonal_indexing__, \
keepweakref
@@ -1712,7 +1713,7 @@ references to the parent Dataset or Group.
the parent Dataset or Group."""
def __init__(self, filename, mode='r', clobber=True, format='NETCDF4',
- diskless=False, persist=False, keepweakref=False, **kwargs):
+ diskless=False, persist=False, keepweakref=False, memory=None, **kwargs):
"""
**`__init__(self, filename, mode="r", clobber=True, diskless=False,
persist=False, keepweakref=False, format='NETCDF4')`**
@@ -1720,7 +1721,8 @@ references to the parent Dataset or Group.
`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.
+ be a python 3 pathlib instance or the URL of an OpenDAP dataset. When memory is
+ set this is just used to set the `filepath()`.
**`mode`**: access mode. `r` means read-only; no data can be
modified. `w` means write; a new file is created, an existing file with
@@ -1776,10 +1778,16 @@ references to the parent Dataset or Group.
reducing memory usage and open file handles. However, in many 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.
+
+ **`memory`**: if not `None`, open file with contents taken from this block of memory.
+ Must be a sequence of bytes. Note this only works with "r" mode.
"""
cdef int grpid, ierr, numgrps, numdims, numvars
cdef char *path
cdef char namstring[NC_MAX_NAME+1]
+
+ memset(&self._buffer, 0, sizeof(self._buffer))
+
# flag to indicate that Variables in this Dataset support orthogonal indexing.
self.__orthogonal_indexing__ = True
if diskless and __netcdf4libversion__ < '4.2.1':
@@ -1787,6 +1795,10 @@ references to the parent Dataset or Group.
raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__)
bytestr = _strencode(str(filename))
path = bytestr
+
+ if memory is not None and (mode != 'r' or type(memory) != bytes):
+ raise ValueError('memory mode only works with \'r\' modes and must be `bytes`')
+
if mode == 'w':
_set_default_format(format=format)
if clobber:
@@ -1811,7 +1823,20 @@ references to the parent Dataset or Group.
# 4.3.0 of the netcdf library (add a version check here?).
_set_default_format(format='NETCDF3_64BIT_OFFSET')
elif mode == 'r':
- if diskless:
+ if memory is not None:
+ IF HAS_NC_OPEN_MEM:
+ # Store reference to memory
+ result = PyObject_GetBuffer(memory, &self._buffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS)
+ if result != 0:
+ raise ValueError("Unable to retrieve Buffer from %s" % (memory,))
+
+ ierr = nc_open_mem(<char *>path, 0, self._buffer.len, <void *>self._buffer.buf, &grpid)
+ ELSE:
+ msg = """
+ nc_open_mem method not enabled. To enable, install Cython, make sure you have
+ version 4.4.1 or higher of the netcdf C lib, and rebuild netcdf4-python."""
+ raise ValueError(msg)
+ elif diskless:
ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid)
else:
ierr = nc_open(path, NC_NOWRITE, &grpid)
@@ -1844,8 +1869,9 @@ references to the parent Dataset or Group.
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 IOError((<char *>nc_strerror(ierr)).decode('ascii'))
+
+ _ensure_nc_success(ierr, IOError)
+
# 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
@@ -1910,16 +1936,16 @@ open/create the Dataset. Requires netcdf >= 4.1.2"""
IF HAS_NC_INQ_PATH:
with nogil:
ierr = nc_inq_path(self._grpid, &pathlen, NULL)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(ierr)
+
c_path = <char *>malloc(sizeof(char) * (pathlen + 1))
if not c_path:
raise MemoryError()
try:
with nogil:
ierr = nc_inq_path(self._grpid, &pathlen, c_path)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(ierr)
+
py_path = c_path[:pathlen] # makes a copy of pathlen bytes from c_string
finally:
free(c_path)
@@ -1934,7 +1960,7 @@ version 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python."""
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
ncdump = ['%r\n' % type(self)]
@@ -1961,17 +1987,27 @@ version 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python."""
ncdump.append(' groups: %s\n' % ', '.join(grpnames))
return ''.join(ncdump)
+ def _close(self, check_err):
+ cdef int ierr = nc_close(self._grpid)
+
+ if check_err:
+ _ensure_nc_success(ierr)
+
+ self._isopen = 0 # indicates file already closed, checked by __dealloc__
+
+ # Only release buffer if close succeeded
+ # per impl of PyBuffer_Release: https://github.com/python/cpython/blob/master/Objects/abstract.c#L667
+ # view.obj is checked, ref on obj is decremented and obj will be null'd out
+ PyBuffer_Release(&self._buffer)
+
+
def close(self):
"""
**`close(self)`**
Close the Dataset.
"""
- cdef int ierr
- ierr = nc_close(self._grpid)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- self._isopen = 0 # indicates file already closed, checked by __dealloc__
+ self._close(True)
def isopen(self):
"""
@@ -1983,9 +2019,8 @@ is the Dataset open or closed?
def __dealloc__(self):
# close file when there are no references to object left
- cdef int ierr
if self._isopen:
- ierr = nc_close(self._grpid)
+ self._close(False)
def __reduce__(self):
# raise error is user tries to pickle a Dataset object.
@@ -1996,10 +2031,7 @@ is the Dataset open or closed?
**`sync(self)`**
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((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(nc_sync(self._grpid))
def _redef(self):
cdef int ierr
@@ -2022,10 +2054,8 @@ separately for each variable type). The default behavior of the netCDF
library corresponds to `set_fill_on`. Data which are equal to the
`_Fill_Value` indicate that the variable was created, but never written
to."""
- cdef int ierr, oldmode
- ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ cdef int oldmode
+ _ensure_nc_success(nc_set_fill(self._grpid, NC_FILL, &oldmode))
def set_fill_off(self):
"""
@@ -2036,10 +2066,8 @@ Sets the fill mode for a `netCDF4.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."""
- cdef int ierr, oldmode
- ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ cdef int oldmode
+ _ensure_nc_success(nc_set_fill(self._grpid, NC_NOFILL, &oldmode))
def createDimension(self, dimname, size=None):
"""
@@ -2072,8 +2100,8 @@ rename a `netCDF4.Dimension` named `oldname` to `newname`."""
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((<char *>nc_strerror(ierr)).decode('ascii'))
+
+ _ensure_nc_success(ierr)
# remove old key from dimensions dict.
self.dimensions.pop(oldname)
# add new key.
@@ -2282,8 +2310,8 @@ rename a `netCDF4.Variable` named `oldname` to `newname`"""
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((<char *>nc_strerror(ierr)).decode('ascii'))
+
+ _ensure_nc_success(ierr)
# remove old key from dimensions dict.
self.variables.pop(oldname)
# add new key.
@@ -2365,14 +2393,17 @@ each attribute"""
_set_att(self, NC_GLOBAL, name, value)
if self.data_model != 'NETCDF4': self._enddef()
- def getncattr(self,name):
+ def getncattr(self,name,encoding='utf-8'):
"""
**`getncattr(self,name)`**
retrieve 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."""
- return _get_att(self, NC_GLOBAL, name)
+Use if you need to get a netCDF attribute with the same
+name as one of the reserved python attributes.
+
+option kwarg `encoding` can be used to specify the
+character encoding of a string attribute (default is `utf-8`)."""
+ return _get_att(self, NC_GLOBAL, name, encoding=encoding)
def __delattr__(self,name):
# if it's a netCDF attribute, remove it
@@ -2396,8 +2427,7 @@ attributes."""
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 AttributeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(ierr)
def __setattr__(self,name,value):
# if name in _private_atts, it is stored at the python
@@ -2434,23 +2464,19 @@ attributes."""
**`renameAttribute(self, oldname, newname)`**
rename a `netCDF4.Dataset` or `netCDF4.Group` attribute named `oldname` to `newname`."""
- cdef int ierr
cdef char *oldnamec
cdef char *newnamec
bytestr = _strencode(oldname)
oldnamec = bytestr
bytestr = _strencode(newname)
newnamec = bytestr
- ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec))
def renameGroup(self, oldname, newname):
"""
**`renameGroup(self, oldname, newname)`**
rename a `netCDF4.Group` named `oldname` to `newname` (requires netcdf >= 4.3.1)."""
- cdef int ierr
cdef char *newnamec
IF HAS_RENAME_GRP:
bytestr = _strencode(newname)
@@ -2459,9 +2485,7 @@ rename a `netCDF4.Group` named `oldname` to `newname` (requires netcdf >= 4.3.1)
grp = self.groups[oldname]
except KeyError:
raise KeyError('%s not a valid group name' % oldname)
- ierr = nc_rename_grp(grp._grpid, newnamec)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(nc_rename_grp(grp._grpid, newnamec))
# remove old key from groups dict.
self.groups.pop(oldname)
# add new key.
@@ -2472,6 +2496,34 @@ 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_chartostring(self, value):
+ """
+**`set_auto_chartostring(self, True_or_False)`**
+
+Call `netCDF4.Variable.set_auto_chartostring` for all variables contained in this `netCDF4.Dataset` or
+`netCDF4.Group`, as well as for all variables in all its subgroups.
+
+**`True_or_False`**: Boolean determining if automatic conversion of
+all character arrays <--> string arrays should be performed for
+character variables (variables of type `NC_CHAR` or `S1`) with the
+`_Encoding` attribute set.
+
+***Note***: Calling this function only affects existing variables. Variables created
+after calling this function will follow the default behaviour.
+ """
+
+ # this is a hack to make inheritance work in MFDataset
+ # (which stores variables in _vars)
+ _vars = self.variables
+ if _vars is None: _vars = self._vars
+ for var in _vars.values():
+ var.set_auto_chartostring(value)
+
+ for groups in _walk_grps(self):
+ for group in groups:
+ for var in group.variables.values():
+ var.set_auto_chartostring(value)
+
def set_auto_maskandscale(self, value):
"""
**`set_auto_maskandscale(self, True_or_False)`**
@@ -2634,7 +2686,6 @@ Additional read-only class variables:
`netCDF4.Dataset.createGroup` method of a `netCDF4.Dataset` instance, or
another `netCDF4.Group` instance, not using this class directly.
"""
- cdef int ierr
cdef char *groupname
# flag to indicate that Variables in this Group support orthogonal indexing.
self.__orthogonal_indexing__ = True
@@ -2660,9 +2711,7 @@ Additional read-only class variables:
else:
bytestr = _strencode(name)
groupname = bytestr
- ierr = nc_def_grp(parent._grpid, groupname, &self._grpid)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
+ _ensure_nc_success(nc_def_grp(parent._grpid, groupname, &self._grpid))
self.cmptypes = OrderedDict()
self.vltypes = OrderedDict()
self.enumtypes = OrderedDict()
@@ -2680,13 +2729,12 @@ instances, raises IOError."""
def _getname(self):
# private method to get name associated with instance.
- cdef int err
+ cdef int ierr
cdef char namstring[NC_MAX_NAME+1]
with nogil:
ierr = nc_inq_grpname(self._grpid, namstring)
- if ierr != NC_NOERR:
- raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- return namstring.decode(default_encoding,unicode_error)
+ _ensure_nc_success(ierr)
+ return namstring.decode('utf-8')
property name:
"""string name of Group instance"""
@@ -2773,7 +2821,7 @@ Read-only class variables:
ierr = nc_inq_dimname(_grpid, self._dimid, namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- return namstring.decode(default_encoding,unicode_error)
+ return namstring.decode('utf-8')
property name:
"""string name of Dimension instance"""
@@ -2793,7 +2841,7 @@ Read-only class variables:
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
if not dir(self._grp):
@@ -2883,7 +2931,9 @@ variable's data type.
**`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 `netCDF4.Variable.set_auto_scale` and
+applied, and signed integer data is automatically converted to
+unsigned integer data if the `_Unsigned` attribute is set.
+Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and
`netCDF4.Variable.set_auto_maskandscale` methods.
**`mask`**: If True, data is automatically converted to/from masked
@@ -2891,6 +2941,11 @@ arrays when missing values or fill values are present. Default is `True`, can be
reset using `netCDF4.Variable.set_auto_mask` and `netCDF4.Variable.set_auto_maskandscale`
methods.
+**`chartostring`**: If True, data is automatically converted to/from character
+arrays to string arrays when the `_Encoding` variable attribute is set.
+Default is `True`, can be reset using
+`netCDF4.Variable.set_auto_chartostring` method.
+
**`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 `netCDF4.Variable`
@@ -2909,7 +2964,7 @@ behavior is similar to Fortran or Matlab, but different than numpy.
**`size`**: The number of stored elements.
"""
cdef public int _varid, _grpid, _nunlimdim
- cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\
+ cdef public _name, ndim, dtype, mask, scale, chartostring, _isprimitive, _iscompound,\
_isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype,\
__orthogonal_indexing__, _has_lsd
# Docstrings for class variables (used by pdoc).
@@ -2923,13 +2978,20 @@ behavior is similar to Fortran or Matlab, but different than numpy.
"""The number of variable dimensions."""
__pdoc__['Variable.scale'] = \
"""if True, `scale_factor` and `add_offset` are
- applied. Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and
+ applied, and signed integer data is converted to unsigned
+ integer data if the `_Unsigned` attribute is set.
+ Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and
`netCDF4.Variable.set_auto_maskandscale` methods."""
__pdoc__['Variable.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 `netCDF4.Variable.set_auto_mask` and `netCDF4.Variable.set_auto_maskandscale`
methods."""
+ __pdoc__['Variable.chartostring'] = \
+ """If True, data is automatically converted to/from character
+ arrays to string arrays when `_Encoding` variable attribute is set.
+ Default is `True`, can be reset using
+ `netCDF4.Variable.set_auto_chartostring` method."""
__pdoc__['Variable.least_significant_digit'] = \
"""Describes the power of ten of the
smallest decimal place in the data the contains a reliable value. Data is
@@ -3296,6 +3358,9 @@ behavior is similar to Fortran or Matlab, but different than numpy.
# add_offset, and converting to/from masked arrays is True.
self.scale = True
self.mask = True
+ # default is to automatically convert to/from character
+ # to string arrays when _Encoding variable attribute is set.
+ self.chartostring = True
if 'least_significant_digit' in self.ncattrs():
self._has_lsd = True
@@ -3309,7 +3374,7 @@ behavior is similar to Fortran or Matlab, but different than numpy.
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
cdef int ierr, no_fill
@@ -3391,7 +3456,7 @@ behavior is similar to Fortran or Matlab, but different than numpy.
ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = namstring.decode(default_encoding,unicode_error)
+ name = namstring.decode('utf-8')
dimensions = dimensions + (name,)
free(dimids)
return dimensions
@@ -3405,7 +3470,7 @@ behavior is similar to Fortran or Matlab, but different than numpy.
ierr = nc_inq_varname(_grpid, self._varid, namstring)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- return namstring.decode(default_encoding,unicode_error)
+ return namstring.decode('utf-8')
property name:
"""string name of Variable instance"""
@@ -3506,14 +3571,17 @@ each attribute"""
_set_att(self._grp, self._varid, name, value)
if self._grp.data_model != 'NETCDF4': self._grp._enddef()
- def getncattr(self,name):
+ def getncattr(self,name,encoding='utf-8'):
"""
**`getncattr(self,name)`**
retrieve a netCDF variable attribute. Use if you need to set a
netCDF attribute with the same name as one of the reserved python
-attributes."""
- return _get_att(self._grp, self._varid, name)
+attributes.
+
+option kwarg `encoding` can be used to specify the
+character encoding of a string attribute (default is `utf-8`)."""
+ return _get_att(self._grp, self._varid, name, encoding=encoding)
def delncattr(self, name):
"""
@@ -3769,6 +3837,13 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
# length 1.
if data.ndim != 0: data = numpy.asarray(data[0])
+ # if attribute _Unsigned is True, and variable has signed integer
+ # dtype, return view with corresponding unsigned dtype (issue #656)
+ if self.scale: # only do this if autoscale option is on.
+ is_unsigned = getattr(self, '_Unsigned', False)
+ if is_unsigned and data.dtype.kind == 'i':
+ data = data.view('u%s' % data.dtype.itemsize)
+
# if auto_scale mode set to True, (through
# a call to set_auto_scale or set_auto_maskandscale),
# perform automatic unpacking using scale_factor/add_offset.
@@ -3799,6 +3874,27 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
# 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
+
+ # if _Encoding is specified for a character variable, return
+ # a numpy array of strings with one less dimension.
+ if self.chartostring and getattr(self.dtype,'kind',None) == 'S' and\
+ getattr(self.dtype,'itemsize',None) == 1:
+ encoding = getattr(self,'_Encoding',None)
+ # should this only be done if self.scale = True?
+ # should there be some other way to disable this?
+ if encoding is not None:
+ # only try to return a string array if rightmost dimension of
+ # sliced data matches rightmost dimension of char variable
+ if len(data.shape) > 0 and data.shape[-1] == self.shape[-1]:
+ # also make sure slice is along last dimension
+ matchdim = True
+ for cnt in count:
+ if cnt[-1] != self.shape[-1]:
+ matchdim = False
+ break
+ if matchdim:
+ data = chartostring(data, encoding=encoding)
+
return data
def _toma(self,data):
@@ -3923,7 +4019,9 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
# to numpy.ma.MaskedConstant to be consistent with slicing
# behavior of masked arrays.
if data.shape == () and data.mask.all():
- data = data[...]
+ # return a scalar numpy masked constant not a 0-d masked array,
+ # so that data == numpy.ma.masked.
+ data = data[()] # changed from [...] (issue #662)
return data
def _assign_vlen(self, elem, data):
@@ -3979,7 +4077,10 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
countp[n] = count[n]
if self.dtype == str: # VLEN string
strdata = <char **>malloc(sizeof(char *))
- bytestr = _strencode(data)
+ # use _Encoding attribute to specify string encoding - if
+ # not given, use 'utf-8'.
+ encoding = getattr(self,'_Encoding','utf-8')
+ bytestr = _strencode(data,encoding=encoding)
strdata[0] = bytestr
ierr = nc_put_vara(self._grpid, self._varid,
startp, countp, strdata)
@@ -4008,6 +4109,24 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
# arguments to the nc_put_var() function, and is much more easy
# to use.
+ # if _Encoding is specified for a character variable, convert
+ # numpy array of strings to a numpy array of characters with one more
+ # dimension.
+ if self.chartostring and getattr(self.dtype,'kind',None) == 'S' and\
+ getattr(self.dtype,'itemsize',None) == 1:
+ # NC_CHAR variable
+ encoding = getattr(self,'_Encoding',None)
+ if encoding is not None:
+ # _Encoding attribute is set
+ # if data is a string or a bytes object, convert to a numpy string array
+ # whose length is equal to the rightmost dimension of the
+ # variable.
+ if type(data) in [str,bytes]: data = numpy.asarray(data,dtype='S'+repr(self.shape[-1]))
+ if data.dtype.kind in ['S','U'] and data.dtype.itemsize > 1:
+ # if data is a numpy string array, convert it to an array
+ # of characters with one more dimension.
+ data = stringtochar(data, encoding=encoding)
+
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
@@ -4052,8 +4171,13 @@ rename a `netCDF4.Variable` attribute named `oldname` to `newname`."""
# 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
+ if ma.isMA(data):
+ # fix for new behaviour in numpy.ma in 1.13 (issue #662)
+ for val in self.datatype.enum_dict.values():
+ test += data.filled() == val
+ else:
+ 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)
@@ -4173,13 +4297,41 @@ Scientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...])."""
raise IndexError('to retrieve values from a non-scalar variable, use slicing')
return self[slice(None)]
+ def set_auto_chartostring(self,chartostring):
+ """
+**`set_auto_chartostring(self,chartostring)`**
+
+turn on or off automatic conversion of character variable data to and
+from numpy fixed length string arrays when the `_Encoding` variable attribute
+is set.
+
+If `chartostring` is set to `True`, when data is read from a character variable
+(dtype = `S1`) that has an `_Encoding` attribute, it is converted to a numpy
+fixed length unicode string array (dtype = `UN`, where `N` is the length
+of the the rightmost dimension of the variable). The value of `_Encoding`
+is the unicode encoding that is used to decode the bytes into strings.
+
+When numpy string data is written to a variable it is converted back to
+indiviual bytes, with the number of bytes in each string equalling the
+rightmost dimension of the variable.
+
+The default value of `chartostring` is `True`
+(automatic conversions are performed).
+ """
+ if chartostring:
+ self.chartostring = True
+ else:
+ self.chartostring = False
+
def set_auto_maskandscale(self,maskandscale):
"""
**`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.
+from masked arrays, automatic packing/unpacking of variable
+data using `scale_factor` and `add_offset` attributes and
+automatic conversion of signed integer data to unsigned integer
+data if the `_Unsigned` attribute exists.
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
@@ -4212,6 +4364,13 @@ For more information on how `scale_factor` and `add_offset` can be
used to provide simple compression, see the
[PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml).
+In addition, if `maskandscale` is set to `True`, and if the variable has an
+attribute `_Unsigned` set, and the variable has a signed integer data type,
+a view to the data is returned with the corresponding unsigned integer data type.
+This convention is used by the netcdf-java library to save unsigned integer
+data in `NETCDF3` or `NETCDF4_CLASSIC` files (since the `NETCDF3`
+data model does not have unsigned integer data types).
+
The default value of `maskandscale` is `True`
(automatic conversions are performed).
"""
@@ -4228,6 +4387,9 @@ The default value of `maskandscale` is `True`
turn on or off automatic packing/unpacking of variable
data using `scale_factor` and `add_offset` attributes.
+Also turns on and off automatic conversion of signed integer data
+to unsigned integer data if the variable has an `_Unsigned`
+attribute.
If `scale` is set to `True`, and the variable has a
`scale_factor` or an `add_offset` attribute, then data read
@@ -4246,6 +4408,13 @@ For more information on how `scale_factor` and `add_offset` can be
used to provide simple compression, see the
[PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml).
+In addition, if `scale` is set to `True`, and if the variable has an
+attribute `_Unsigned` set, and the variable has a signed integer data type,
+a view to the data is returned with the corresponding unsigned integer datatype.
+This convention is used by the netcdf-java library to save unsigned integer
+data in `NETCDF3` or `NETCDF4_CLASSIC` files (since the `NETCDF3`
+data model does not have unsigned integer data types).
+
The default value of `scale` is `True`
(automatic conversions are performed).
"""
@@ -4359,8 +4528,11 @@ The default value of `mask` is `True`
data = data.flatten()
if self.dtype == str:
# convert all elements from strings to bytes
+ # use _Encoding attribute to specify string encoding - if
+ # not given, use 'utf-8'.
+ encoding = getattr(self,'_Encoding','utf-8')
for n in range(data.shape[0]):
- data[n] = _strencode(data[n])
+ data[n] = _strencode(data[n],encoding=encoding)
# vlen string (NC_STRING)
# loop over elements of object array, put data buffer for
# each element in struct.
@@ -4496,8 +4668,11 @@ The default value of `mask` is `True`
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
# loop over elements of object array, fill array with
# contents of strdata.
+ # use _Encoding attribute to decode string to bytes - if
+ # not given, use 'utf-8'.
+ encoding = getattr(self,'_Encoding','utf-8')
for i from 0<=i<totelem:
- data[i] = strdata[i].decode(default_encoding)
+ data[i] = strdata[i].decode(encoding)
# reshape the output array
data = numpy.reshape(data, shapeout)
# free string data internally allocated in netcdf C lib
@@ -4619,7 +4794,7 @@ the user.
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\
@@ -4747,7 +4922,7 @@ cdef _read_compound(group, nc_type xtype, endian=None):
ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = cmp_namstring.decode(default_encoding,unicode_error)
+ name = cmp_namstring.decode('utf-8')
# loop over fields.
names = []
formats = []
@@ -4776,7 +4951,7 @@ cdef _read_compound(group, nc_type xtype, endian=None):
dim_sizes)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- field_name = field_namstring.decode(default_encoding,unicode_error)
+ field_name = field_namstring.decode('utf-8')
names.append(field_name)
offsets.append(offset)
# if numdims=0, not an array.
@@ -4863,7 +5038,7 @@ the user.
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
if self.dtype == str:
@@ -4920,7 +5095,7 @@ cdef _read_vlen(group, nc_type xtype, endian=None):
ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = vl_namstring.decode(default_encoding,unicode_error)
+ name = vl_namstring.decode('utf-8')
try:
datatype = _nctonptype[base_xtype]
if endian is not None: datatype = endian + datatype
@@ -4984,7 +5159,7 @@ the user.
if python3:
return self.__unicode__()
else:
- return unicode(self).encode(default_encoding)
+ return unicode(self).encode('utf-8')
def __unicode__(self):
return repr(type(self))+\
@@ -5042,7 +5217,7 @@ cdef _read_enum(group, nc_type xtype, endian=None):
&nmembers)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = enum_namstring.decode(default_encoding,unicode_error)
+ name = enum_namstring.decode('utf-8')
try:
datatype = _nctonptype[base_xtype]
if endian is not None: datatype = endian + datatype
@@ -5057,15 +5232,15 @@ cdef _read_enum(group, nc_type xtype, endian=None):
enum_namstring, &enum_val)
if ierr != NC_NOERR:
raise RuntimeError((<char *>nc_strerror(ierr)).decode('ascii'))
- name = enum_namstring.decode(default_encoding,unicode_error)
+ name = enum_namstring.decode('utf-8')
enum_dict[name] = int(enum_val)
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.
+ # uses 'utf-8' for default encoding.
if encoding is None:
- encoding = default_encoding
+ encoding = 'utf-8'
try:
return pystr.encode(encoding)
except (AttributeError, UnicodeDecodeError):
@@ -5136,9 +5311,9 @@ returns a rank 1 numpy character array of length NUMCHARS with datatype `'S1'`
arr[0:len(string)] = tuple(string)
return arr
-def stringtochar(a):
+def stringtochar(a,encoding='utf-8'):
"""
-**`stringtochar(a)`**
+**`stringtochar(a,encoding='utf-8')`**
convert a string array to a character array with one extra dimension
@@ -5146,18 +5321,21 @@ convert a string array to a character array with one extra dimension
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,)`.
+optional kwarg `encoding` can be used to specify character encoding (default
+`utf-8`).
+
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')")
- b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1')
+ b = numpy.array(tuple(a.tostring().decode(encoding)),dtype+'1')
b.shape = a.shape + (a.itemsize,)
return b
-def chartostring(b):
+def chartostring(b,encoding='utf-8'):
"""
-**`chartostring(b)`**
+**`chartostring(b,encoding='utf-8')`**
convert a character array to a string array with one less dimension.
@@ -5165,14 +5343,17 @@ convert a character array to a string array with one less dimension.
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
+optional kwarg `encoding` can be used to specify character encoding (default
+`utf-8`).
+
+returns a numpy string array with datatype `'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')")
- bs = b.tostring().decode(default_encoding)
+ raise ValueError("type must be string or unicode ('S' or 'U')")
+ bs = b.tostring().decode(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 = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],'U'+repr(slen))
a.shape = b.shape[:-1]
return a
@@ -5313,8 +5494,9 @@ contains one.
msg='negative reference year in time units, must be >= 1'
raise ValueError(msg)
- if (calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
- (calendar in ['gregorian','standard'] and basedate > gregorian):
+ postimes = (numpy.asarray(times) > 0).all()
+ if postimes and ((calendar == 'proleptic_gregorian' and basedate.year >= MINYEAR) or \
+ (calendar in ['gregorian','standard'] and basedate > gregorian)):
# use python datetime module,
isscalar = False
try:
@@ -5746,6 +5928,9 @@ class _Variable(object):
def _shape(self):
recdimlen = len(self._dset.dimensions[self._recdimname])
return (recdimlen,) + self._mastervar.shape[1:]
+ def set_auto_chartostring(self,val):
+ for v in self._recVar:
+ v.set_auto_chartostring(val)
def set_auto_maskandscale(self,val):
for v in self._recVar:
v.set_auto_maskandscale(val)
diff --git a/netCDF4/utils.py b/netCDF4/utils.py
index 27af42e..fc1a34b 100644
--- a/netCDF4/utils.py
+++ b/netCDF4/utils.py
@@ -223,7 +223,7 @@ Boolean array must have the same shape as the data along this dimension."""
# convert negative indices in 1d array to positive ones.
ea = np.where(ea < 0, ea + shape[i], ea)
if np.any(ea < 0):
- raise IndexErro("integer index out of range")
+ raise IndexError("integer index out of range")
# if unlim, let integer index be longer than current dimension
# length.
if ea.shape != (0,):
@@ -683,7 +683,7 @@ def _nc3tonc4(filename3,filename4,unpackshort=True,
ncvar = ncfile3.variables[varname]
if not quiet: sys.stdout.write('copying variable %s\n' % varname)
# quantize data?
- if lsd_dict is not None and lsd_dict.has_key(varname):
+ if lsd_dict is not None and varname in lsd_dict:
lsd = lsd_dict[varname]
if not quiet: sys.stdout.write('truncating to least_significant_digit = %d\n'%lsd)
else:
diff --git a/netcdftime/_netcdftime.c b/netcdftime/_netcdftime.c
deleted file mode 100644
index a671b8f..0000000
--- a/netcdftime/_netcdftime.c
+++ /dev/null
@@ -1,35225 +0,0 @@
-/* Generated by Cython 0.25.1 */
-
-#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_25_1"
-#include <stddef.h>
-#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 HAVE_LONG_LONG
- #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
- #define HAVE_LONG_LONG
- #endif
-#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_PYSTON 0
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #undef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 0
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #undef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 0
- #undef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 0
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #undef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 1
- #undef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 0
- #undef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 0
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
-#elif defined(PYSTON_VERSION)
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_PYSTON 1
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #undef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 0
- #ifndef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 1
- #endif
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #ifndef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 1
- #endif
- #ifndef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 1
- #endif
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
-#else
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_PYSTON 0
- #define CYTHON_COMPILING_IN_CPYTHON 1
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #if PY_MAJOR_VERSION < 3
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #elif !defined(CYTHON_USE_ASYNC_SLOTS)
- #define CYTHON_USE_ASYNC_SLOTS 1
- #endif
- #if PY_VERSION_HEX < 0x02070000
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
- #define CYTHON_USE_PYLONG_INTERNALS 1
- #endif
- #ifndef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 1
- #endif
- #ifndef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 1
- #endif
- #if PY_VERSION_HEX < 0x030300F0
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #elif !defined(CYTHON_USE_UNICODE_WRITER)
- #define CYTHON_USE_UNICODE_WRITER 1
- #endif
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #ifndef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 1
- #endif
- #ifndef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 1
- #endif
- #ifndef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 1
- #endif
- #ifndef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 1
- #endif
-#endif
-#if !defined(CYTHON_FAST_PYCCALL)
-#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
-#endif
-#if CYTHON_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #undef SHIFT
- #undef BASE
- #undef MASK
-#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
-#ifndef METH_FASTCALL
- #define METH_FASTCALL 0x80
- typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
- Py_ssize_t nargs, PyObject *kwnames);
-#else
- #define __Pyx_PyCFunctionFast _PyCFunctionFast
-#endif
-#if CYTHON_FAST_PYCCALL
-#define __Pyx_PyFastCFunction_Check(func)\
- ((PyCFunction_Check(func) && METH_FASTCALL == PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))
-#else
-#define __Pyx_PyFastCFunction_Check(func) 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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
- #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)
- #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
-#else
- #define CYTHON_PEP393_ENABLED 0
- #define PyUnicode_1BYTE_KIND 1
- #define PyUnicode_2BYTE_KIND 2
- #define PyUnicode_4BYTE_KIND 4
- #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
- #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]))
- #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
-#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
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
- #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
- #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
- #define PyObject_Malloc(s) PyMem_Malloc(s)
- #define PyObject_Free(p) PyMem_Free(p)
- #define PyObject_Realloc(p) PyMem_Realloc(p)
-#endif
-#if CYTHON_COMPILING_IN_PYSTON
- #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
- #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
-#else
- #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
- #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
-#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 && !defined(PyObject_ASCII)
- #define PyObject_ASCII(o) PyObject_Repr(o)
-#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)
-#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
-#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 CYTHON_USE_ASYNC_SLOTS
- #if PY_VERSION_HEX >= 0x030500B1
- #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
- #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
- #else
- 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))
- #endif
-#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 <math.h>
-#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 defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
-#define __Pyx_truncl trunc
-#else
-#define __Pyx_truncl truncl
-#endif
-
-
-#define __PYX_ERR(f_index, lineno, Ln_error) \
-{ \
- __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
-}
-
-#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__netcdftime___netcdftime
-#define __PYX_HAVE_API__netcdftime___netcdftime
-#include <string.h>
-#include <stdio.h>
-#ifdef _OPENMP
-#include <omp.h>
-#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; const 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 <cstdlib>
- #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_IntOrLong(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_ASSUME_SAFE_MACROS
-#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
-#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
-#else
-#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
-#endif
-#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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 PyObject *__pyx_empty_unicode;
-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[] = {
- "netcdftime/_netcdftime.pyx",
- "type.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_10netcdftime_11_netcdftime_datetime;
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap;
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap;
-struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day;
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian;
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian;
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
-
-/* "netcdftime/_netcdftime.pyx":1188
- * _converters[calendar] = utime("seconds since 1-1-1", calendar)
- *
- * cdef class datetime(object): # <<<<<<<<<<<<<<
- * """
- * The base class implementing most methods of datetime classes that
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_datetime {
- PyObject_HEAD
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *__pyx_vtab;
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int dayofwk;
- int dayofyr;
- int second;
- int microsecond;
- PyObject *calendar;
- int datetime_compatible;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1352
- * return NotImplemented
- *
- * cdef class DatetimeNoLeap(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1365
- * return DatetimeNoLeap(*add_timedelta(self, delta, no_leap, False))
- *
- * cdef class DatetimeAllLeap(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1378
- * return DatetimeAllLeap(*add_timedelta(self, delta, all_leap, False))
- *
- * cdef class Datetime360Day(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1391
- * return Datetime360Day(*add_timedelta_360_day(self, delta))
- *
- * cdef class DatetimeJulian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1404
- * return DatetimeJulian(*add_timedelta(self, delta, is_leap_julian, False))
- *
- * cdef class DatetimeGregorian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-/* "netcdftime/_netcdftime.pyx":1431
- * return DatetimeGregorian(*add_timedelta(self, delta, is_leap_gregorian, True))
- *
- * cdef class DatetimeProlepticGregorian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-
-
-
-/* "netcdftime/_netcdftime.pyx":1188
- * _converters[calendar] = utime("seconds since 1-1-1", calendar)
- *
- * cdef class datetime(object): # <<<<<<<<<<<<<<
- * """
- * The base class implementing most methods of datetime classes that
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime {
- PyObject *(*_to_real_datetime)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, int __pyx_skip_dispatch);
- PyObject *(*to_tuple)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *);
- PyObject *(*_getstate)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *);
- PyObject *(*_add_timedelta)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *);
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
-
-
-/* "netcdftime/_netcdftime.pyx":1352
- * return NotImplemented
- *
- * cdef class DatetimeNoLeap(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeNoLeap {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeNoLeap *__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeNoLeap;
-
-
-/* "netcdftime/_netcdftime.pyx":1365
- * return DatetimeNoLeap(*add_timedelta(self, delta, no_leap, False))
- *
- * cdef class DatetimeAllLeap(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeAllLeap {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeAllLeap *__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeAllLeap;
-
-
-/* "netcdftime/_netcdftime.pyx":1378
- * return DatetimeAllLeap(*add_timedelta(self, delta, all_leap, False))
- *
- * cdef class Datetime360Day(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_Datetime360Day {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_Datetime360Day *__pyx_vtabptr_10netcdftime_11_netcdftime_Datetime360Day;
-
-
-/* "netcdftime/_netcdftime.pyx":1391
- * return Datetime360Day(*add_timedelta_360_day(self, delta))
- *
- * cdef class DatetimeJulian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeJulian {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeJulian *__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeJulian;
-
-
-/* "netcdftime/_netcdftime.pyx":1404
- * return DatetimeJulian(*add_timedelta(self, delta, is_leap_julian, False))
- *
- * cdef class DatetimeGregorian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeGregorian {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeGregorian *__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeGregorian;
-
-
-/* "netcdftime/_netcdftime.pyx":1431
- * return DatetimeGregorian(*add_timedelta(self, delta, is_leap_gregorian, True))
- *
- * cdef class DatetimeProlepticGregorian(datetime): # <<<<<<<<<<<<<<
- * """
- * Phony datetime object which mimics the python datetime object,
- */
-
-struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeProlepticGregorian {
- struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_base;
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
-
-/* --- Runtime support code (head) --- */
-/* Refnanny.proto */
-#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)
-
-/* PyObjectGetAttrStr.proto */
-#if CYTHON_USE_TYPE_SLOTS
-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
-
-/* GetBuiltinName.proto */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name);
-
-/* RaiseDoubleKeywords.proto */
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-
-/* ParseKeywords.proto */
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
- const char* function_name);
-
-/* RaiseArgTupleInvalid.proto */
-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);
-
-/* GetItemInt.proto */
-#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);
-
-/* PyThreadStateGet.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
-#else
-#define __Pyx_PyThreadState_declare
-#define __Pyx_PyThreadState_assign
-#endif
-
-/* SaveResetException.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-#else
-#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
-#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
-#endif
-
-/* GetException.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
-#endif
-
-/* GetModuleGlobalName.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
-
-/* PyCFunctionFastCall.proto */
-#if CYTHON_FAST_PYCCALL
-static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
-#else
-#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
-#endif
-
-/* PyFunctionFastCall.proto */
-#if CYTHON_FAST_PYCALL
-#define __Pyx_PyFunction_FastCall(func, args, nargs)\
- __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
-#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
-#else
-#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
-#endif
-#endif
-
-/* PyObjectCall.proto */
-#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
-
-/* PyObjectCallMethO.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
-#endif
-
-/* PyObjectCallOneArg.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-
-/* PyObjectCallNoArg.proto */
-#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
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-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
-
-/* PyFloatBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-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
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-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
-
-/* PyFloatBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
-#else
-#define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace)\
- (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
-#endif
-
-/* IncludeStringH.proto */
-#include <string.h>
-
-/* BytesEquals.proto */
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* UnicodeEquals.proto */
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* StrEquals.proto */
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-/* PyErrFetchRestore.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
-#endif
-
-/* RaiseException.proto */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
-#else
-#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\
- (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
-#endif
-
-/* PyFloatBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
-#else
-#define __Pyx_PyFloat_SubtractObjC(op1, op2, floatval, inplace)\
- (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
-#endif
-
-/* PyFloatBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace);
-#else
-#define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace)\
- (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
-#endif
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-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
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
-#else
-#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace)\
- (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
-#endif
-
-/* PySequenceContains.proto */
-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));
-}
-
-/* None.proto */
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-/* ListCompAppend.proto */
-#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
-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
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
-#else
-#define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace)\
- (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
-#endif
-
-/* RaiseTooManyValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-/* RaiseNeedMoreValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-/* IterFinish.proto */
-static CYTHON_INLINE int __Pyx_IterFinish(void);
-
-/* UnpackItemEndCheck.proto */
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
-
-/* SliceObject.proto */
-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);
-
-/* PyObjectSetAttrStr.proto */
-#if CYTHON_USE_TYPE_SLOTS
-#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
-
-/* ListAppend.proto */
-#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
-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
-
-/* PyObjectCallMethod1.proto */
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
-
-/* append.proto */
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
-
-/* PyErrExceptionMatches.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
-#else
-#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
-#endif
-
-/* GetAttr.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
-
-/* GetAttr3.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
-
-/* Import.proto */
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
-
-/* pyobject_as_double.proto */
-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
-
-/* KeywordStringCheck.proto */
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
-
-/* py_dict_items.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
-
-/* UnpackUnboundCMethod.proto */
-typedef struct {
- PyObject *type;
- PyObject **method_name;
- PyCFunction func;
- PyObject *method;
- int flag;
-} __Pyx_CachedCFunction;
-
-/* CallUnboundCMethod0.proto */
-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) :\
- (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :\
- __Pyx__CallUnboundCMethod0(cfunc, self))))) :\
- __Pyx__CallUnboundCMethod0(cfunc, self))
-#else
-#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
-#endif
-
-/* ExtTypeTest.proto */
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-
-/* DictGetItem.proto */
-#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
-
-/* None.proto */
-static CYTHON_INLINE long __Pyx_mod_long(long, long);
-
-/* None.proto */
-static CYTHON_INLINE long __Pyx_div_long(long, long);
-
-/* SetVTable.proto */
-static int __Pyx_SetVtable(PyObject *dict, void *vtable);
-
-/* ImportFrom.proto */
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-
-/* FetchCommonType.proto */
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-/* CythonFunction.proto */
-#define __Pyx_CyFunction_USED 1
-#include <structmember.h>
-#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);
-
-/* CalculateMetaclass.proto */
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
-
-/* Py3ClassCreate.proto */
-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);
-
-/* CodeObjectCache.proto */
-typedef struct {
- PyCodeObject* code_object;
- int code_line;
-} __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);
-
-/* AddTraceback.proto */
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-/* CheckBinaryVersion.proto */
-static int __Pyx_check_binary_version(void);
-
-/* PyIdentifierFromString.proto */
-#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
-
-/* ModuleImport.proto */
-static PyObject *__Pyx_ImportModule(const char *name);
-
-/* TypeImport.proto */
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
-
-/* InitStrings.proto */
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__to_real_datetime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime_to_tuple(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__getstate(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__add_timedelta(CYTHON_UNUSED struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14DatetimeNoLeap__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_15DatetimeAllLeap__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14Datetime360Day__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14DatetimeJulian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_17DatetimeGregorian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *__pyx_v_self, PyObject *__pyx_v_delta); /* proto*/
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'netcdftime._netcdftime' */
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_datetime = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_DatetimeNoLeap = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_DatetimeAllLeap = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_Datetime360Day = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_DatetimeJulian = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_DatetimeGregorian = 0;
-static PyTypeObject *__pyx_ptype_10netcdftime_11_netcdftime_DatetimeProlepticGregorian = 0;
-static PyObject *__pyx_v_10netcdftime_11_netcdftime__converters = 0;
-static int __pyx_v_10netcdftime_11_netcdftime_month_lengths_365_day[13];
-static int __pyx_v_10netcdftime_11_netcdftime_month_lengths_366_day[13];
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__NoLeapDayFromDate(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__AllLeapFromDate(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__360DayFromDate(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFromNoLeapDay(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFromAllLeap(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFrom360Day(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__dateparse(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__parse_timezone(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__parse_date(PyObject *, int __pyx_skip_dispatch); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__check_index(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__toscalar(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_to_tuple(PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__findall(PyObject *, PyObject *); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__strftime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *); /*proto*/
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_julian(int); /*proto*/
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_proleptic_gregorian(int); /*proto*/
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_gregorian(int); /*proto*/
-static int __pyx_f_10netcdftime_11_netcdftime_all_leap(int); /*proto*/
-static int __pyx_f_10netcdftime_11_netcdftime_no_leap(int); /*proto*/
-static int *__pyx_f_10netcdftime_11_netcdftime_month_lengths(int (*)(int), int); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *, int (*)(int), int); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_add_timedelta_360_day(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *); /*proto*/
-#define __Pyx_MODULE_NAME "netcdftime._netcdftime"
-int __pyx_module_is_main_netcdftime___netcdftime = 0;
-
-/* Implementation of 'netcdftime._netcdftime' */
-static PyObject *__pyx_builtin_ImportError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_NotImplemented;
-static const char __pyx_k_A[] = "A";
-static const char __pyx_k_B[] = "B";
-static const char __pyx_k_C[] = "C";
-static const char __pyx_k_D[] = "D";
-static const char __pyx_k_E[] = "E";
-static const char __pyx_k_F[] = "F";
-static const char __pyx_k_N[] = "N";
-static const char __pyx_k_Z[] = "Z";
-static const char __pyx_k_d[] = "d";
-static const char __pyx_k_h[] = "h";
-static const char __pyx_k_i[] = "i";
-static const char __pyx_k_j[] = "j";
-static const char __pyx_k_m[] = "m";
-static const char __pyx_k_n[] = "n";
-static const char __pyx_k_s[] = "s";
-static const char __pyx_k_4d[] = "%4d";
-static const char __pyx_k_JD[] = "JD";
-static const char __pyx_k_dt[] = "dt";
-static const char __pyx_k_hr[] = "hr";
-static const char __pyx_k_ii[] = "ii";
-static const char __pyx_k_jd[] = "jd";
-static const char __pyx_k_np[] = "np";
-static const char __pyx_k_re[] = "re";
-static const char __pyx_k_t0[] = "t0";
-static const char __pyx_k_t1[] = "t1";
-static const char __pyx_k__14[] = "-";
-static const char __pyx_k__23[] = "";
-static const char __pyx_k_abs[] = "abs";
-static const char __pyx_k_all[] = "all";
-static const char __pyx_k_any[] = "any";
-static const char __pyx_k_day[] = "day";
-static const char __pyx_k_doc[] = "__doc__";
-static const char __pyx_k_eps[] = "eps";
-static const char __pyx_k_hrs[] = "hrs";
-static const char __pyx_k_jd0[] = "_jd0";
-static const char __pyx_k_min[] = "min";
-static const char __pyx_k_msg[] = "msg";
-static const char __pyx_k_num[] = "num";
-static const char __pyx_k_s_2[] = "((^|[^%])(%%)*%s)";
-static const char __pyx_k_sec[] = "sec";
-static const char __pyx_k_zip[] = "zip";
-static const char __pyx_k_args[] = "args";
-static const char __pyx_k_ceil[] = "ceil";
-static const char __pyx_k_clip[] = "clip";
-static const char __pyx_k_copy[] = "copy";
-static const char __pyx_k_date[] = "date";
-static const char __pyx_k_days[] = "days";
-static const char __pyx_k_find[] = "find";
-static const char __pyx_k_flat[] = "flat";
-static const char __pyx_k_fmod[] = "fmod";
-static const char __pyx_k_hour[] = "hour";
-static const char __pyx_k_init[] = "__init__";
-static const char __pyx_k_item[] = "item";
-static const char __pyx_k_izip[] = "izip";
-static const char __pyx_k_leap[] = "leap";
-static const char __pyx_k_main[] = "__main__";
-static const char __pyx_k_mask[] = "mask";
-static const char __pyx_k_math[] = "math";
-static const char __pyx_k_mins[] = "mins";
-static const char __pyx_k_modf[] = "modf";
-static const char __pyx_k_name[] = "__name__";
-static const char __pyx_k_nday[] = "nday";
-static const char __pyx_k_secs[] = "secs";
-static const char __pyx_k_self[] = "self";
-static const char __pyx_k_size[] = "size";
-static const char __pyx_k_test[] = "__test__";
-static const char __pyx_k_time[] = "time";
-static const char __pyx_k_year[] = "year";
-static const char __pyx_k_0_1_2[] = "{0}.{1}{2}";
-static const char __pyx_k_1_4_1[] = "1.4.1";
-static const char __pyx_k_after[] = "after";
-static const char __pyx_k_alpha[] = "alpha";
-static const char __pyx_k_array[] = "array";
-static const char __pyx_k_class[] = "__class__";
-static const char __pyx_k_dates[] = "dates";
-static const char __pyx_k_dtype[] = "dtype";
-static const char __pyx_k_empty[] = "empty";
-static const char __pyx_k_exact[] = "exact";
-static const char __pyx_k_finfo[] = "finfo";
-static const char __pyx_k_hours[] = "hours";
-static const char __pyx_k_index[] = "index";
-static const char __pyx_k_int32[] = "int32";
-static const char __pyx_k_int64[] = "int64";
-static const char __pyx_k_items[] = "items";
-static const char __pyx_k_lower[] = "lower";
-static const char __pyx_k_match[] = "match";
-static const char __pyx_k_month[] = "month";
-static const char __pyx_k_ncnum[] = "ncnum";
-static const char __pyx_k_numpy[] = "numpy";
-static const char __pyx_k_round[] = "round";
-static const char __pyx_k_shape[] = "shape";
-static const char __pyx_k_since[] = "since";
-static const char __pyx_k_split[] = "split";
-static const char __pyx_k_strip[] = "strip";
-static const char __pyx_k_times[] = "times";
-static const char __pyx_k_units[] = "_units";
-static const char __pyx_k_utime[] = "utime";
-static const char __pyx_k_where[] = "where";
-static const char __pyx_k_zeros[] = "zeros";
-static const char __pyx_k_append[] = "append";
-static const char __pyx_k_around[] = "around";
-static const char __pyx_k_astype[] = "astype";
-static const char __pyx_k_before[] = "before";
-static const char __pyx_k_bisect[] = "bisect";
-static const char __pyx_k_format[] = "format";
-static const char __pyx_k_groups[] = "groups";
-static const char __pyx_k_import[] = "__import__";
-static const char __pyx_k_jdelta[] = "jdelta";
-static const char __pyx_k_julian[] = "julian";
-static const char __pyx_k_minute[] = "minute";
-static const char __pyx_k_module[] = "__module__";
-static const char __pyx_k_nctime[] = "nctime";
-static const char __pyx_k_noleap[] = "noleap";
-static const char __pyx_k_origin[] = "origin";
-static const char __pyx_k_search[] = "search";
-static const char __pyx_k_second[] = "second";
-static const char __pyx_k_select[] = "select";
-static const char __pyx_k_360_day[] = "360_day";
-static const char __pyx_k_365_day[] = "365_day";
-static const char __pyx_k_366_day[] = "366_day";
-static const char __pyx_k_cdftime[] = "cdftime";
-static const char __pyx_k_compile[] = "compile";
-static const char __pyx_k_dayofwk[] = "dayofwk";
-static const char __pyx_k_dayofyr[] = "dayofyr";
-static const char __pyx_k_float64[] = "float64";
-static const char __pyx_k_inc_idx[] = "inc_idx";
-static const char __pyx_k_maximum[] = "maximum";
-static const char __pyx_k_minutes[] = "minutes";
-static const char __pyx_k_nearest[] = "nearest";
-static const char __pyx_k_nonzero[] = "nonzero";
-static const char __pyx_k_prepare[] = "__prepare__";
-static const char __pyx_k_reshape[] = "reshape";
-static const char __pyx_k_seconds[] = "seconds";
-static const char __pyx_k_squeeze[] = "squeeze";
-static const char __pyx_k_units_2[] = "units";
-static const char __pyx_k_version[] = "__version__";
-static const char __pyx_k_all_leap[] = "all_leap";
-static const char __pyx_k_calendar[] = "calendar";
-static const char __pyx_k_date2num[] = "date2num";
-static const char __pyx_k_datetime[] = "datetime";
-static const char __pyx_k_hr_units[] = "hr_units";
-static const char __pyx_k_ismasked[] = "ismasked";
-static const char __pyx_k_isscalar[] = "isscalar";
-static const char __pyx_k_microsec[] = "microsec";
-static const char __pyx_k_millisec[] = "millisec";
-static const char __pyx_k_mismatch[] = "mismatch";
-static const char __pyx_k_num2date[] = "num2date";
-static const char __pyx_k_qualname[] = "__qualname__";
-static const char __pyx_k_standard[] = "standard";
-static const char __pyx_k_strftime[] = "strftime";
-static const char __pyx_k_timezone[] = "timezone";
-static const char __pyx_k_tzoffset[] = "tzoffset";
-static const char __pyx_k_TypeError[] = "TypeError";
-static const char __pyx_k_calendars[] = "_calendars";
-static const char __pyx_k_day_units[] = "day_units";
-static const char __pyx_k_enumerate[] = "enumerate";
-static const char __pyx_k_gregorian[] = "gregorian";
-static const char __pyx_k_groupdict[] = "groupdict";
-static const char __pyx_k_illegal_s[] = "_illegal_s";
-static const char __pyx_k_itertools[] = "itertools";
-static const char __pyx_k_metaclass[] = "__metaclass__";
-static const char __pyx_k_microsecs[] = "microsecs";
-static const char __pyx_k_millisecs[] = "millisecs";
-static const char __pyx_k_min_units[] = "min_units";
-static const char __pyx_k_sec_units[] = "sec_units";
-static const char __pyx_k_timedelta[] = "timedelta";
-static const char __pyx_k_timetuple[] = "timetuple";
-static const char __pyx_k_IndexError[] = "IndexError";
-static const char __pyx_k_ValueError[] = "ValueError";
-static const char __pyx_k_atleast_1d[] = "atleast_1d";
-static const char __pyx_k_date2index[] = "date2index";
-static const char __pyx_k_ind_before[] = "ind_before";
-static const char __pyx_k_month_lt_3[] = "month_lt_3";
-static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static const char __pyx_k_time2index[] = "time2index";
-static const char __pyx_k_time_value[] = "time_value";
-static const char __pyx_k_ImportError[] = "ImportError";
-static const char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S";
-static const char __pyx_k_bisect_left[] = "bisect_left";
-static const char __pyx_k_microsecond[] = "microsecond";
-static const char __pyx_k_millisecond[] = "millisecond";
-static const char __pyx_k_unit_string[] = "unit_string";
-static const char __pyx_k_bisect_right[] = "bisect_right";
-static const char __pyx_k_microseconds[] = "microseconds";
-static const char __pyx_k_milliseconds[] = "milliseconds";
-static const char __pyx_k_utime___init[] = "utime.__init__";
-static const char __pyx_k_ISO8601_REGEX[] = "ISO8601_REGEX";
-static const char __pyx_k_datetime_type[] = "datetime_type";
-static const char __pyx_k_real_datetime[] = "real_datetime";
-static const char __pyx_k_AttributeError[] = "AttributeError";
-static const char __pyx_k_NotImplemented[] = "NotImplemented";
-static const char __pyx_k_TIMEZONE_REGEX[] = "TIMEZONE_REGEX";
-static const char __pyx_k_microsec_units[] = "microsec_units";
-static const char __pyx_k_millisec_units[] = "millisec_units";
-static const char __pyx_k_utime_date2num[] = "utime.date2num";
-static const char __pyx_k_utime_num2date[] = "utime.num2date";
-static const char __pyx_k_ind_nday_before[] = "ind_nday_before";
-static const char __pyx_k_nearest_to_left[] = "nearest_to_left";
-static const char __pyx_k_to_real_datetime[] = "_to_real_datetime";
-static const char __pyx_k_DateFromJulianDay[] = "DateFromJulianDay";
-static const char __pyx_k_JulianDayFromDate[] = "JulianDayFromDate";
-static const char __pyx_k_datetime_compatible[] = "datetime_compatible";
-static const char __pyx_k_invalid_year_in_0_r[] = "invalid year in {0!r}";
-static const char __pyx_k_proleptic_gregorian[] = "proleptic_gregorian";
-static const char __pyx_k_seconds_since_1_1_1[] = "seconds since 1-1-1";
-static const char __pyx_k_Expecting_a_string_r[] = "Expecting a string %r";
-static const char __pyx_k_invalid_month_in_0_r[] = "invalid month in {0!r}";
-static const char __pyx_k_netcdftime__netcdftime[] = "netcdftime._netcdftime";
-static const char __pyx_k_unsupported_calendar_0[] = "unsupported calendar: {0}";
-static const char __pyx_k_unsupported_time_units[] = "unsupported time units";
-static const char __pyx_k_no_since_in_unit_string[] = "no 'since' in unit_string";
-static const char __pyx_k_invalid_day_number_in_0_r[] = "invalid day number in {0!r}";
-static const char __pyx_k_cannot_compare_0_r_and_1_r[] = "cannot compare {0!r} and {1!r}";
-static const char __pyx_k_Julian_Day_must_be_positive[] = "Julian Day must be positive";
-static const char __pyx_k_Unable_to_parse_date_string_r[] = "Unable to parse date string %r";
-static const char __pyx_k_P_year_0_9_1_4_P_month_0_9_1_2[] = "(?P<year>[+-]?[0-9]{1,4})(-(?P<month>[0-9]{1,2})(-(?P<day>[0-9]{1,2})(((?P<separator1>.)(?P<hour>[0-9]{1,2}):(?P<minute>[0-9]{1,2})(:(?P<second>[0-9]{1,2})(\\.(?P<fraction>[0-9]+))?)?)?((?P<separator2>.?)(?P<timezone>Z|(([-+])([0-9]{1,2}):([0-9]{1,2}))))?)?)?)?";
-static const char __pyx_k_Performs_conversions_of_netCDF[] = "\nPerforms conversions of netCDF time coordinate data to/from datetime objects.\n";
-static const char __pyx_k_0_r_is_not_present_in_the_mixed[] = "{0!r} is not present in the mixed Julian/Gregorian calendar";
-static const char __pyx_k_P_prefix_P_hours_0_9_1_2_P_minu[] = "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})";
-static const char __pyx_k_Volumes_Drobo_python_netcdf4_py[] = "/Volumes/Drobo/python/netcdf4-python.git/netcdftime/_netcdftime.pyx";
-static const char __pyx_k_calendar_must_be_one_of_s_got_s[] = "calendar must be one of %s, got '%s'";
-static const char __pyx_k_negative_reference_year_in_time[] = "negative reference year in time units, must be >= 1";
-static const char __pyx_k_netcdf_time_variable_is_missing[] = "netcdf time variable is missing a 'units' attribute";
-static const char __pyx_k_s_is_not_an_option_for_the_sele[] = "%s is not an option for the `select` argument.";
-static const char __pyx_k_there_are_only_30_days_in_every[] = "there are only 30 days in every month with the 360_day calendar";
-static const char __pyx_k_unknown_calendar_must_be_one_of[] = "unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s";
-static const 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 const char __pyx_k_Performs_conversions_of_netCDF_2[] = "\nPerforms conversions of netCDF time coordinate\ndata to/from datetime objects.\n\nTo initialize: C{t = utime(unit_string,calendar='standard')}\n\nwhere\n\nB{C{unit_string}} is a string of the form\nC{'time-units since <time-origin>'} defining the time units.\n\nValid time-units are days, hours, minutes and seconds (the singular forms\nare also accepted). An example unit_string would be C{'hours\nsince 0001-01-01 00:00:00'} [...]
-static const char __pyx_k_Some_of_the_times_given_are_afte[] = "Some of the times given are after the last time in `nctime`.";
-static const char __pyx_k_Some_of_the_times_given_are_befo[] = "Some of the times given are before the first time in `nctime`.";
-static const char __pyx_k_Some_of_the_times_specified_were[] = "Some of the times specified were not found in the `nctime` variable.";
-static const char __pyx_k_This_strftime_implementation_doe[] = "This strftime implementation does not handle %s";
-static const char __pyx_k_cannot_compare_0_r_and_1_r_diffe[] = "cannot compare {0!r} and {1!r} (different calendars)";
-static const char __pyx_k_cannot_compute_the_time_differen[] = "cannot compute the time difference between dates with different calendars";
-static const char __pyx_k_cannot_specify_a_leap_day_as_the[] = "cannot specify a leap day as the reference time with the noleap calendar";
-static const char __pyx_k_impossible_date_falls_in_gap_bet[] = "impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar";
-static const char __pyx_k_there_is_no_leap_day_in_the_nole[] = "there is no leap day in the noleap calendar";
-static const char __pyx_k_units_must_be_one_of_seconds_min[] = "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'";
-static const char __pyx_k_cannot_compute_the_time_differen_2[] = "cannot compute the time difference between dates that are not calendar-aware";
-static PyObject *__pyx_kp_s_0_1_2;
-static PyObject *__pyx_kp_s_0_r_is_not_present_in_the_mixed;
-static PyObject *__pyx_kp_s_1_4_1;
-static PyObject *__pyx_kp_s_360_day;
-static PyObject *__pyx_kp_s_365_day;
-static PyObject *__pyx_kp_s_366_day;
-static PyObject *__pyx_kp_s_4d;
-static PyObject *__pyx_n_s_A;
-static PyObject *__pyx_n_s_AttributeError;
-static PyObject *__pyx_n_s_B;
-static PyObject *__pyx_n_s_C;
-static PyObject *__pyx_n_s_D;
-static PyObject *__pyx_n_s_DateFromJulianDay;
-static PyObject *__pyx_n_s_E;
-static PyObject *__pyx_kp_s_Expecting_a_string_r;
-static PyObject *__pyx_n_s_F;
-static PyObject *__pyx_n_s_ISO8601_REGEX;
-static PyObject *__pyx_n_s_ImportError;
-static PyObject *__pyx_n_s_IndexError;
-static PyObject *__pyx_n_s_JD;
-static PyObject *__pyx_n_s_JulianDayFromDate;
-static PyObject *__pyx_kp_s_Julian_Day_must_be_positive;
-static PyObject *__pyx_n_s_N;
-static PyObject *__pyx_n_s_NotImplemented;
-static PyObject *__pyx_kp_s_P_prefix_P_hours_0_9_1_2_P_minu;
-static PyObject *__pyx_kp_s_P_year_0_9_1_4_P_month_0_9_1_2;
-static PyObject *__pyx_kp_s_Performs_conversions_of_netCDF_2;
-static PyObject *__pyx_kp_s_Some_of_the_times_given_are_afte;
-static PyObject *__pyx_kp_s_Some_of_the_times_given_are_befo;
-static PyObject *__pyx_kp_s_Some_of_the_times_specified_were;
-static PyObject *__pyx_n_s_TIMEZONE_REGEX;
-static PyObject *__pyx_kp_s_This_strftime_implementation_doe;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_kp_s_Unable_to_parse_date_string_r;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_s_Volumes_Drobo_python_netcdf4_py;
-static PyObject *__pyx_kp_s_Y_m_d_H_M_S;
-static PyObject *__pyx_n_s_Z;
-static PyObject *__pyx_kp_s__14;
-static PyObject *__pyx_kp_s__23;
-static PyObject *__pyx_n_s_abs;
-static PyObject *__pyx_n_s_after;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_all_leap;
-static PyObject *__pyx_n_s_alpha;
-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_array;
-static PyObject *__pyx_n_s_astype;
-static PyObject *__pyx_n_s_atleast_1d;
-static PyObject *__pyx_n_s_before;
-static PyObject *__pyx_n_s_bisect;
-static PyObject *__pyx_n_s_bisect_left;
-static PyObject *__pyx_n_s_bisect_right;
-static PyObject *__pyx_n_s_calendar;
-static PyObject *__pyx_kp_s_calendar_must_be_one_of_s_got_s;
-static PyObject *__pyx_n_s_calendars;
-static PyObject *__pyx_kp_s_cannot_compare_0_r_and_1_r;
-static PyObject *__pyx_kp_s_cannot_compare_0_r_and_1_r_diffe;
-static PyObject *__pyx_kp_s_cannot_compute_the_time_differen;
-static PyObject *__pyx_kp_s_cannot_compute_the_time_differen_2;
-static PyObject *__pyx_kp_s_cannot_specify_a_leap_day_as_the;
-static PyObject *__pyx_n_s_cdftime;
-static PyObject *__pyx_n_s_ceil;
-static PyObject *__pyx_n_s_class;
-static PyObject *__pyx_n_s_clip;
-static PyObject *__pyx_n_s_compile;
-static PyObject *__pyx_n_s_copy;
-static PyObject *__pyx_n_s_d;
-static PyObject *__pyx_n_s_date;
-static PyObject *__pyx_n_s_date2index;
-static PyObject *__pyx_n_s_date2num;
-static PyObject *__pyx_n_s_dates;
-static PyObject *__pyx_n_s_datetime;
-static PyObject *__pyx_n_s_datetime_compatible;
-static PyObject *__pyx_n_s_datetime_type;
-static PyObject *__pyx_n_s_day;
-static PyObject *__pyx_n_s_day_units;
-static PyObject *__pyx_n_s_dayofwk;
-static PyObject *__pyx_n_s_dayofyr;
-static PyObject *__pyx_n_s_days;
-static PyObject *__pyx_n_s_doc;
-static PyObject *__pyx_n_s_dt;
-static PyObject *__pyx_n_s_dtype;
-static PyObject *__pyx_n_s_empty;
-static PyObject *__pyx_n_s_enumerate;
-static PyObject *__pyx_n_s_eps;
-static PyObject *__pyx_n_s_exact;
-static PyObject *__pyx_n_s_find;
-static PyObject *__pyx_n_s_finfo;
-static PyObject *__pyx_n_s_flat;
-static PyObject *__pyx_n_s_float64;
-static PyObject *__pyx_n_s_fmod;
-static PyObject *__pyx_n_s_format;
-static PyObject *__pyx_n_s_gregorian;
-static PyObject *__pyx_n_s_groupdict;
-static PyObject *__pyx_n_s_groups;
-static PyObject *__pyx_n_s_h;
-static PyObject *__pyx_n_s_hour;
-static PyObject *__pyx_n_s_hours;
-static PyObject *__pyx_n_s_hr;
-static PyObject *__pyx_n_s_hr_units;
-static PyObject *__pyx_n_s_hrs;
-static PyObject *__pyx_n_s_i;
-static PyObject *__pyx_n_s_ii;
-static PyObject *__pyx_n_s_illegal_s;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_impossible_date_falls_in_gap_bet;
-static PyObject *__pyx_n_s_inc_idx;
-static PyObject *__pyx_n_s_ind_before;
-static PyObject *__pyx_n_s_ind_nday_before;
-static PyObject *__pyx_n_s_index;
-static PyObject *__pyx_n_s_init;
-static PyObject *__pyx_n_s_int32;
-static PyObject *__pyx_n_s_int64;
-static PyObject *__pyx_kp_s_invalid_day_number_in_0_r;
-static PyObject *__pyx_kp_s_invalid_month_in_0_r;
-static PyObject *__pyx_kp_s_invalid_year_in_0_r;
-static PyObject *__pyx_n_s_ismasked;
-static PyObject *__pyx_n_s_isscalar;
-static PyObject *__pyx_n_s_item;
-static PyObject *__pyx_n_s_items;
-static PyObject *__pyx_n_s_itertools;
-static PyObject *__pyx_n_s_izip;
-static PyObject *__pyx_n_s_j;
-static PyObject *__pyx_n_s_jd;
-static PyObject *__pyx_n_s_jd0;
-static PyObject *__pyx_n_s_jdelta;
-static PyObject *__pyx_n_s_julian;
-static PyObject *__pyx_n_s_leap;
-static PyObject *__pyx_n_s_lower;
-static PyObject *__pyx_n_s_m;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_mask;
-static PyObject *__pyx_n_s_match;
-static PyObject *__pyx_n_s_math;
-static PyObject *__pyx_n_s_maximum;
-static PyObject *__pyx_n_s_metaclass;
-static PyObject *__pyx_n_s_microsec;
-static PyObject *__pyx_n_s_microsec_units;
-static PyObject *__pyx_n_s_microsecond;
-static PyObject *__pyx_n_s_microseconds;
-static PyObject *__pyx_n_s_microsecs;
-static PyObject *__pyx_n_s_millisec;
-static PyObject *__pyx_n_s_millisec_units;
-static PyObject *__pyx_n_s_millisecond;
-static PyObject *__pyx_n_s_milliseconds;
-static PyObject *__pyx_n_s_millisecs;
-static PyObject *__pyx_n_s_min;
-static PyObject *__pyx_n_s_min_units;
-static PyObject *__pyx_n_s_mins;
-static PyObject *__pyx_n_s_minute;
-static PyObject *__pyx_n_s_minutes;
-static PyObject *__pyx_n_s_mismatch;
-static PyObject *__pyx_n_s_modf;
-static PyObject *__pyx_n_s_module;
-static PyObject *__pyx_n_s_month;
-static PyObject *__pyx_n_s_month_lt_3;
-static PyObject *__pyx_n_s_msg;
-static PyObject *__pyx_n_s_n;
-static PyObject *__pyx_n_s_name;
-static PyObject *__pyx_n_s_ncnum;
-static PyObject *__pyx_n_s_nctime;
-static PyObject *__pyx_n_s_nday;
-static PyObject *__pyx_n_s_nearest;
-static PyObject *__pyx_n_s_nearest_to_left;
-static PyObject *__pyx_kp_s_negative_reference_year_in_time;
-static PyObject *__pyx_kp_s_netcdf_time_variable_is_missing;
-static PyObject *__pyx_n_s_netcdftime__netcdftime;
-static PyObject *__pyx_kp_s_no_since_in_unit_string;
-static PyObject *__pyx_n_s_noleap;
-static PyObject *__pyx_n_s_nonzero;
-static PyObject *__pyx_n_s_np;
-static PyObject *__pyx_n_s_num;
-static PyObject *__pyx_n_s_num2date;
-static PyObject *__pyx_n_s_numpy;
-static PyObject *__pyx_n_s_origin;
-static PyObject *__pyx_n_s_prepare;
-static PyObject *__pyx_n_s_proleptic_gregorian;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qualname;
-static PyObject *__pyx_n_s_re;
-static PyObject *__pyx_n_s_real_datetime;
-static PyObject *__pyx_n_s_reshape;
-static PyObject *__pyx_n_s_round;
-static PyObject *__pyx_n_s_s;
-static PyObject *__pyx_kp_s_s_2;
-static PyObject *__pyx_kp_s_s_is_not_an_option_for_the_sele;
-static PyObject *__pyx_n_s_search;
-static PyObject *__pyx_n_s_sec;
-static PyObject *__pyx_n_s_sec_units;
-static PyObject *__pyx_n_s_second;
-static PyObject *__pyx_n_s_seconds;
-static PyObject *__pyx_kp_s_seconds_since_1_1_1;
-static PyObject *__pyx_n_s_secs;
-static PyObject *__pyx_n_s_select;
-static PyObject *__pyx_n_s_self;
-static PyObject *__pyx_n_s_shape;
-static PyObject *__pyx_n_s_since;
-static PyObject *__pyx_n_s_size;
-static PyObject *__pyx_n_s_split;
-static PyObject *__pyx_n_s_squeeze;
-static PyObject *__pyx_n_s_standard;
-static PyObject *__pyx_n_s_strftime;
-static PyObject *__pyx_n_s_strip;
-static PyObject *__pyx_n_s_t0;
-static PyObject *__pyx_n_s_t1;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_kp_s_there_are_only_30_days_in_every;
-static PyObject *__pyx_kp_s_there_is_no_leap_day_in_the_nole;
-static PyObject *__pyx_n_s_time;
-static PyObject *__pyx_n_s_time2index;
-static PyObject *__pyx_n_s_time_value;
-static PyObject *__pyx_n_s_timedelta;
-static PyObject *__pyx_n_s_times;
-static PyObject *__pyx_n_s_timetuple;
-static PyObject *__pyx_n_s_timezone;
-static PyObject *__pyx_n_s_to_real_datetime;
-static PyObject *__pyx_n_s_tzoffset;
-static PyObject *__pyx_n_s_unit_string;
-static PyObject *__pyx_n_s_units;
-static PyObject *__pyx_n_s_units_2;
-static PyObject *__pyx_kp_s_units_must_be_one_of_seconds_min;
-static PyObject *__pyx_kp_s_unknown_calendar_must_be_one_of;
-static PyObject *__pyx_kp_s_unsupported_calendar_0;
-static PyObject *__pyx_kp_s_unsupported_time_units;
-static PyObject *__pyx_n_s_utime;
-static PyObject *__pyx_n_s_utime___init;
-static PyObject *__pyx_n_s_utime_date2num;
-static PyObject *__pyx_n_s_utime_num2date;
-static PyObject *__pyx_n_s_version;
-static PyObject *__pyx_n_s_where;
-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_pf_10netcdftime_11_netcdftime_JulianDayFromDate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date, PyObject *__pyx_v_calendar); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_2DateFromJulianDay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_JD, PyObject *__pyx_v_calendar); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit_string, PyObject *__pyx_v_calendar); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime_2date2num(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_date); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime_4num2date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_time_value); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_4_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datestring); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_6date2index(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_10netcdftime_11_netcdftime_8time2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_times, PyObject *__pyx_v_nctime, PyObject *__pyx_v_calendar, PyObject *__pyx_v_select); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_8datetime___init__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_dayofwk, int __pyx_v_dayofyr); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6format___get__(CYTHON_UNUSED struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_2strftime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, PyObject *__pyx_v_format); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4replace(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6timetuple(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_8_to_real_datetime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_10__repr__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_12__str__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static Py_hash_t __pyx_pf_10netcdftime_11_netcdftime_8datetime_14__hash__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_16__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_18__reduce__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_20__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_22__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4year___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_5month___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_3day___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4hour___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6minute___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofwk___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofyr___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6second___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_11microsecond___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_8calendar___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_19datetime_compatible___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_14DatetimeNoLeap___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_15DatetimeAllLeap___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_14Datetime360Day___init__(struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_14DatetimeJulian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_17DatetimeGregorian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static int __pyx_pf_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_datetime(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeNoLeap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeAllLeap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_Datetime360Day(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeJulian(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeGregorian(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeProlepticGregorian(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
-static PyObject *__pyx_float_1_;
-static PyObject *__pyx_float_2_;
-static PyObject *__pyx_float_0_5;
-static PyObject *__pyx_float_1_0;
-static PyObject *__pyx_float_1_5;
-static PyObject *__pyx_float_1e6;
-static PyObject *__pyx_float_24_;
-static PyObject *__pyx_float_30_;
-static PyObject *__pyx_float_60_;
-static PyObject *__pyx_float_0_25;
-static PyObject *__pyx_float_1_e3;
-static PyObject *__pyx_float_1_e6;
-static PyObject *__pyx_float_24_0;
-static PyObject *__pyx_float_360_;
-static PyObject *__pyx_float_365_;
-static PyObject *__pyx_float_366_;
-static PyObject *__pyx_float_60_0;
-static PyObject *__pyx_float_122_1;
-static PyObject *__pyx_float_1440_;
-static PyObject *__pyx_float_2000_;
-static PyObject *__pyx_float_6680_;
-static PyObject *__pyx_float_1440_0;
-static PyObject *__pyx_float_1524_5;
-static PyObject *__pyx_float_365_25;
-static PyObject *__pyx_float_86400_;
-static PyObject *__pyx_float_30_6001;
-static PyObject *__pyx_float_86400_0;
-static PyObject *__pyx_float_1867216_;
-static PyObject *__pyx_float_2439870_;
-static PyObject *__pyx_float_36524_25;
-static PyObject *__pyx_float_1718994_5;
-static PyObject *__pyx_float_2299160_5;
-static PyObject *__pyx_float_2299170_5;
-static PyObject *__pyx_float_86400000_;
-static PyObject *__pyx_float_86400000000_;
-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_7;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_12;
-static PyObject *__pyx_int_13;
-static PyObject *__pyx_int_14;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_int_23;
-static PyObject *__pyx_int_28;
-static PyObject *__pyx_int_29;
-static PyObject *__pyx_int_30;
-static PyObject *__pyx_int_31;
-static PyObject *__pyx_int_59;
-static PyObject *__pyx_int_60;
-static PyObject *__pyx_int_100;
-static PyObject *__pyx_int_123;
-static PyObject *__pyx_int_305;
-static PyObject *__pyx_int_360;
-static PyObject *__pyx_int_365;
-static PyObject *__pyx_int_400;
-static PyObject *__pyx_int_1524;
-static PyObject *__pyx_int_1582;
-static PyObject *__pyx_int_2000;
-static PyObject *__pyx_int_4715;
-static PyObject *__pyx_int_4716;
-static PyObject *__pyx_int_999999;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-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_tuple__9;
-static PyObject *__pyx_slice__15;
-static PyObject *__pyx_slice__18;
-static PyObject *__pyx_slice__30;
-static PyObject *__pyx_slice__31;
-static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__11;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__13;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__20;
-static PyObject *__pyx_tuple__21;
-static PyObject *__pyx_tuple__22;
-static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__25;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__27;
-static PyObject *__pyx_tuple__28;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__38;
-static PyObject *__pyx_tuple__40;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__43;
-static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_codeobj__35;
-static PyObject *__pyx_codeobj__37;
-static PyObject *__pyx_codeobj__39;
-static PyObject *__pyx_codeobj__42;
-static PyObject *__pyx_codeobj__44;
-static PyObject *__pyx_codeobj__46;
-static PyObject *__pyx_codeobj__48;
-
-/* "netcdftime/_netcdftime.pyx":41
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- * def JulianDayFromDate(date, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_1JulianDayFromDate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_JulianDayFromDate[] = "\n\n creates a Julian Day from a 'datetime-like' object. Returns the fractional\n Julian Day (approximately millisecond accuracy).\n\n if calendar='standard' or 'gregorian' (default), Julian day follows Julian\n Calendar on and before 1582-10-5, Gregorian calendar after 1582-10-15.\n\n if calendar='proleptic_gregorian', Julian Day follows gregorian calendar.\n\n if calendar='julian', Julian Day fol [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_1JulianDayFromDate = {"JulianDayFromDate", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_1JulianDayFromDate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_JulianDayFromDate};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_1JulianDayFromDate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_date = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("JulianDayFromDate (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_date,&__pyx_n_s_calendar,0};
- PyObject* values[2] = {0,0};
- values[1] = ((PyObject *)__pyx_n_s_standard);
- 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_date)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "JulianDayFromDate") < 0)) __PYX_ERR(0, 41, __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_date = values[0];
- __pyx_v_calendar = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("JulianDayFromDate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.JulianDayFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_JulianDayFromDate(__pyx_self, __pyx_v_date, __pyx_v_calendar);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_JulianDayFromDate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date, PyObject *__pyx_v_calendar) {
- int __pyx_v_isscalar;
- 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_microsecond = NULL;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_d = NULL;
- PyObject *__pyx_v_month_lt_3 = NULL;
- PyObject *__pyx_v_A = NULL;
- PyObject *__pyx_v_jd = NULL;
- PyObject *__pyx_v_B = NULL;
- PyObject *__pyx_v_ii = NULL;
- PyObject *__pyx_v_eps = 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 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- int __pyx_t_12;
- int __pyx_t_13;
- int __pyx_t_14;
- __Pyx_RefNannySetupContext("JulianDayFromDate", 0);
- __Pyx_INCREF(__pyx_v_date);
-
- /* "netcdftime/_netcdftime.pyx":64
- *
- * # check if input was scalar and change return accordingly
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * date[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netcdftime/_netcdftime.pyx":65
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":66
- * isscalar = False
- * try:
- * date[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_date, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":65
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":67
- * try:
- * date[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- *
- */
- /*except:*/ {
- __Pyx_AddTraceback("netcdftime._netcdftime.JulianDayFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 67, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "netcdftime/_netcdftime.pyx":68
- * date[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- *
- * date = np.atleast_1d(np.array(date))
- */
- __pyx_v_isscalar = 1;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L4_exception_handled;
- }
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":65
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __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_L4_exception_handled:;
- __Pyx_PyThreadState_assign
- __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);
- __pyx_L10_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":70
- * isscalar = True
- *
- * date = np.atleast_1d(np.array(date)) # <<<<<<<<<<<<<<
- * year = np.empty(len(date), dtype=np.int32)
- * month = year.copy()
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_date};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_date};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_INCREF(__pyx_v_date);
- __Pyx_GIVEREF(__pyx_v_date);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_date);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __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_5);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":71
- *
- * date = np.atleast_1d(np.array(date))
- * year = np.empty(len(date), dtype=np.int32) # <<<<<<<<<<<<<<
- * month = year.copy()
- * day = year.copy()
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = PyObject_Length(__pyx_v_date); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 71, __pyx_L1_error)
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_year = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":72
- * date = np.atleast_1d(np.array(date))
- * year = np.empty(len(date), dtype=np.int32)
- * month = year.copy() # <<<<<<<<<<<<<<
- * day = year.copy()
- * hour = year.copy()
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_month = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":73
- * year = np.empty(len(date), dtype=np.int32)
- * month = year.copy()
- * day = year.copy() # <<<<<<<<<<<<<<
- * hour = year.copy()
- * minute = year.copy()
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_day = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":74
- * month = year.copy()
- * day = year.copy()
- * hour = year.copy() # <<<<<<<<<<<<<<
- * minute = year.copy()
- * second = year.copy()
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_hour = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":75
- * day = year.copy()
- * hour = year.copy()
- * minute = year.copy() # <<<<<<<<<<<<<<
- * second = year.copy()
- * microsecond = year.copy()
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_minute = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":76
- * hour = year.copy()
- * minute = year.copy()
- * second = year.copy() # <<<<<<<<<<<<<<
- * microsecond = year.copy()
- * for i, d in enumerate(date):
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 76, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_second = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":77
- * minute = year.copy()
- * second = year.copy()
- * microsecond = year.copy() # <<<<<<<<<<<<<<
- * for i, d in enumerate(date):
- * year[i] = d.year
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 77, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (__pyx_t_9) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_microsecond = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":78
- * second = year.copy()
- * microsecond = year.copy()
- * for i, d in enumerate(date): # <<<<<<<<<<<<<<
- * year[i] = d.year
- * month[i] = d.month
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_8 = __pyx_int_0;
- if (likely(PyList_CheckExact(__pyx_v_date)) || PyTuple_CheckExact(__pyx_v_date)) {
- __pyx_t_6 = __pyx_v_date; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_date); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
- }
- 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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_11(__pyx_t_6);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 78, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_9);
- __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
- __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8);
- __pyx_t_8 = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":79
- * microsecond = year.copy()
- * for i, d in enumerate(date):
- * year[i] = d.year # <<<<<<<<<<<<<<
- * month[i] = d.month
- * day[i] = d.day
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_year); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_year, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":80
- * for i, d in enumerate(date):
- * year[i] = d.year
- * month[i] = d.month # <<<<<<<<<<<<<<
- * day[i] = d.day
- * hour[i] = d.hour
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_month); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_month, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 80, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":81
- * year[i] = d.year
- * month[i] = d.month
- * day[i] = d.day # <<<<<<<<<<<<<<
- * hour[i] = d.hour
- * minute[i] = d.minute
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 81, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_day, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":82
- * month[i] = d.month
- * day[i] = d.day
- * hour[i] = d.hour # <<<<<<<<<<<<<<
- * minute[i] = d.minute
- * second[i] = d.second
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_hour); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_hour, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":83
- * day[i] = d.day
- * hour[i] = d.hour
- * minute[i] = d.minute # <<<<<<<<<<<<<<
- * second[i] = d.second
- * microsecond[i] = d.microsecond
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_minute); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_minute, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":84
- * hour[i] = d.hour
- * minute[i] = d.minute
- * second[i] = d.second # <<<<<<<<<<<<<<
- * microsecond[i] = d.microsecond
- * # convert years in BC era to astronomical years (so that 1 BC is year zero)
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_second); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 84, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_second, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":85
- * minute[i] = d.minute
- * second[i] = d.second
- * microsecond[i] = d.microsecond # <<<<<<<<<<<<<<
- * # convert years in BC era to astronomical years (so that 1 BC is year zero)
- * # (fixes issue #596)
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 85, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(PyObject_SetItem(__pyx_v_microsecond, __pyx_v_i, __pyx_t_9) < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":78
- * second = year.copy()
- * microsecond = year.copy()
- * for i, d in enumerate(date): # <<<<<<<<<<<<<<
- * year[i] = d.year
- * month[i] = d.month
- */
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":88
- * # convert years in BC era to astronomical years (so that 1 BC is year zero)
- * # (fixes issue #596)
- * year[year < 0] = year[year < 0] + 1 # <<<<<<<<<<<<<<
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0
- */
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_year, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error)
- __pyx_t_6 = PyObject_GetItem(__pyx_v_year, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_year, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
- if (unlikely(PyObject_SetItem(__pyx_v_year, __pyx_t_6, __pyx_t_8) < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":90
- * year[year < 0] = year[year < 0] + 1
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0 # <<<<<<<<<<<<<<
- *
- * # Start Meeus algorithm (variables are in his notation)
- */
- __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_v_hour, __pyx_float_24_0, 24.0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyNumber_Add(__pyx_v_day, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_v_minute, __pyx_float_1440_0, 1440.0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_v_microsecond, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyNumber_Add(__pyx_v_second, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_t_6, __pyx_float_86400_0, 86400.0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF_SET(__pyx_v_day, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":93
- *
- * # Start Meeus algorithm (variables are in his notation)
- * month_lt_3 = month < 3 # <<<<<<<<<<<<<<
- * month[month_lt_3] = month[month_lt_3] + 12
- * year[month_lt_3] = year[month_lt_3] - 1
- */
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_month, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
- __pyx_v_month_lt_3 = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":94
- * # Start Meeus algorithm (variables are in his notation)
- * month_lt_3 = month < 3
- * month[month_lt_3] = month[month_lt_3] + 12 # <<<<<<<<<<<<<<
- * year[month_lt_3] = year[month_lt_3] - 1
- *
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_month, __pyx_v_month_lt_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_12, 12, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_month, __pyx_v_month_lt_3, __pyx_t_8) < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":95
- * month_lt_3 = month < 3
- * month[month_lt_3] = month[month_lt_3] + 12
- * year[month_lt_3] = year[month_lt_3] - 1 # <<<<<<<<<<<<<<
- *
- * # MC - assure array
- */
- __pyx_t_8 = PyObject_GetItem(__pyx_v_year, __pyx_v_month_lt_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_year, __pyx_v_month_lt_3, __pyx_t_6) < 0)) __PYX_ERR(0, 95, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":99
- * # MC - assure array
- * # A = np.int64(year / 100)
- * A = (year / 100).astype(np.int64) # <<<<<<<<<<<<<<
- *
- * # MC
- */
- __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_100); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_A = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":104
- * # jd = int(365.25 * (year + 4716)) + int(30.6001 * (month + 1)) + \
- * # day - 1524.5
- * jd = 365. * year + np.int32(0.25 * year + 2000.) + np.int32(30.6001 * (month + 1)) + \ # <<<<<<<<<<<<<<
- * day + 1718994.5
- *
- */
- __pyx_t_6 = PyNumber_Multiply(__pyx_float_365_, __pyx_v_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_25, __pyx_v_year); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyFloat_AddObjC(__pyx_t_5, __pyx_float_2000_, 2000., 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __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_8);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_month, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __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_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __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_7 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":105
- * # day - 1524.5
- * jd = 365. * year + np.int32(0.25 * year + 2000.) + np.int32(30.6001 * (month + 1)) + \
- * day + 1718994.5 # <<<<<<<<<<<<<<
- *
- * # optionally adjust the jd for the switch from
- */
- __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_v_day); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyFloat_AddObjC(__pyx_t_9, __pyx_float_1718994_5, 1718994.5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_jd = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":110
- * # the Julian to Gregorian Calendar
- * # here assumed to have occurred the day after 1582 October 4
- * if calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * # MC - do not have to be contiguous dates
- * # if np.min(jd) >= 2299170.5:
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_7 = __pyx_v_calendar;
- __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
- if (!__pyx_t_13) {
- } else {
- __pyx_t_12 = __pyx_t_13;
- goto __pyx_L16_bool_binop_done;
- }
- __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
- __pyx_t_12 = __pyx_t_13;
- __pyx_L16_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = (__pyx_t_12 != 0);
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":122
- * # raise ValueError(
- * # 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * if np.any((jd >= 2299160.5) & (jd < 2299170.5)): # missing days in Gregorian calendar # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- */
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_v_jd, __pyx_float_2299160_5, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_jd, __pyx_float_2299170_5, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
- __pyx_t_8 = PyNumber_And(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":123
- * # 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * if np.any((jd >= 2299160.5) & (jd < 2299170.5)): # missing days in Gregorian calendar
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar)
- */
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 123, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":122
- * # raise ValueError(
- * # 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * if np.any((jd >= 2299160.5) & (jd < 2299170.5)): # missing days in Gregorian calendar # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":125
- * raise ValueError(
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar) # <<<<<<<<<<<<<<
- * ii = np.where(jd >= 2299170.5)[0] # 1582 October 15 (Gregorian Calendar)
- * if ii.size>0:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_10 = PyObject_Length(__pyx_v_jd); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 125, __pyx_L1_error)
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_B = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":126
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar)
- * ii = np.where(jd >= 2299170.5)[0] # 1582 October 15 (Gregorian Calendar) # <<<<<<<<<<<<<<
- * if ii.size>0:
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- */
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_v_jd, __pyx_float_2299170_5, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error)
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __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_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_ii = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":127
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar)
- * ii = np.where(jd >= 2299170.5)[0] # 1582 October 15 (Gregorian Calendar)
- * if ii.size>0: # <<<<<<<<<<<<<<
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- * elif calendar == 'proleptic_gregorian':
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ii, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":128
- * ii = np.where(jd >= 2299170.5)[0] # 1582 October 15 (Gregorian Calendar)
- * if ii.size>0:
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4) # <<<<<<<<<<<<<<
- * elif calendar == 'proleptic_gregorian':
- * B = 2 - A + np.int32(A / 4)
- */
- __pyx_t_7 = PyObject_GetItem(__pyx_v_A, __pyx_v_ii); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_2, __pyx_t_7, 2, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_GetItem(__pyx_v_A, __pyx_v_ii); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_int_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __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;
- if (unlikely(PyObject_SetItem(__pyx_v_B, __pyx_v_ii, __pyx_t_9) < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":127
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar)
- * ii = np.where(jd >= 2299170.5)[0] # 1582 October 15 (Gregorian Calendar)
- * if ii.size>0: # <<<<<<<<<<<<<<
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- * elif calendar == 'proleptic_gregorian':
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":110
- * # the Julian to Gregorian Calendar
- * # here assumed to have occurred the day after 1582 October 4
- * if calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * # MC - do not have to be contiguous dates
- * # if np.min(jd) >= 2299170.5:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":129
- * if ii.size>0:
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- * elif calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * B = 2 - A + np.int32(A / 4)
- * elif calendar == 'julian':
- */
- __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":130
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- * elif calendar == 'proleptic_gregorian':
- * B = 2 - A + np.int32(A / 4) # <<<<<<<<<<<<<<
- * elif calendar == 'julian':
- * B = np.zeros(len(jd))
- */
- __pyx_t_9 = __Pyx_PyInt_SubtractCObj(__pyx_int_2, __pyx_v_A, 2, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_A, __pyx_int_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __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_t_6 = PyNumber_Add(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_B = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":129
- * if ii.size>0:
- * B[ii] = 2 - A[ii] + np.int32(A[ii] / 4)
- * elif calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * B = 2 - A + np.int32(A / 4)
- * elif calendar == 'julian':
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":131
- * elif calendar == 'proleptic_gregorian':
- * B = 2 - A + np.int32(A / 4)
- * elif calendar == 'julian': # <<<<<<<<<<<<<<
- * B = np.zeros(len(jd))
- * else:
- */
- __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 131, __pyx_L1_error)
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":132
- * B = 2 - A + np.int32(A / 4)
- * elif calendar == 'julian':
- * B = np.zeros(len(jd)) # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_10 = PyObject_Length(__pyx_v_jd); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_B = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":131
- * elif calendar == 'proleptic_gregorian':
- * B = 2 - A + np.int32(A / 4)
- * elif calendar == 'julian': # <<<<<<<<<<<<<<
- * B = np.zeros(len(jd))
- * else:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":134
- * B = np.zeros(len(jd))
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar)
- *
- */
- /*else*/ {
-
- /* "netcdftime/_netcdftime.pyx":135
- * else:
- * raise ValueError(
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar) # <<<<<<<<<<<<<<
- *
- * # adjust for Julian calendar if necessary
- */
- __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_unknown_calendar_must_be_one_of, __pyx_v_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "netcdftime/_netcdftime.pyx":134
- * B = np.zeros(len(jd))
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar)
- *
- */
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 134, __pyx_L1_error)
- }
- __pyx_L15:;
-
- /* "netcdftime/_netcdftime.pyx":138
- *
- * # adjust for Julian calendar if necessary
- * jd = jd + B # <<<<<<<<<<<<<<
- *
- * # Add a small offset (proportional to Julian date) for correct re-conversion.
- */
- __pyx_t_6 = PyNumber_Add(__pyx_v_jd, __pyx_v_B); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_jd, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":143
- * # This is about 45 microseconds in 2000 for Julian date starting -4712.
- * # (pull request #433).
- * eps = np.finfo(float).eps # <<<<<<<<<<<<<<
- * eps = np.maximum(eps*jd, eps)
- * jd += eps
- */
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_finfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)(&PyFloat_Type))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, ((PyObject *)(&PyFloat_Type))};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, ((PyObject *)(&PyFloat_Type))};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __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(((PyObject *)(&PyFloat_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)(&PyFloat_Type)));
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_eps = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":144
- * # (pull request #433).
- * eps = np.finfo(float).eps
- * eps = np.maximum(eps*jd, eps) # <<<<<<<<<<<<<<
- * jd += eps
- *
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_maximum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_eps, __pyx_v_jd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = NULL;
- __pyx_t_14 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_14 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_v_eps};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_v_eps};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_9) {
- __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_14, __pyx_t_6);
- __Pyx_INCREF(__pyx_v_eps);
- __Pyx_GIVEREF(__pyx_v_eps);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_14, __pyx_v_eps);
- __pyx_t_6 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_eps, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":145
- * eps = np.finfo(float).eps
- * eps = np.maximum(eps*jd, eps)
- * jd += eps # <<<<<<<<<<<<<<
- *
- * if isscalar:
- */
- __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_jd, __pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF_SET(__pyx_v_jd, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":147
- * jd += eps
- *
- * if isscalar: # <<<<<<<<<<<<<<
- * return jd[0]
- * else:
- */
- __pyx_t_13 = (__pyx_v_isscalar != 0);
- if (__pyx_t_13) {
-
- /* "netcdftime/_netcdftime.pyx":148
- *
- * if isscalar:
- * return jd[0] # <<<<<<<<<<<<<<
- * else:
- * return jd
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_jd, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":147
- * jd += eps
- *
- * if isscalar: # <<<<<<<<<<<<<<
- * return jd[0]
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":150
- * return jd[0]
- * else:
- * return jd # <<<<<<<<<<<<<<
- *
- *
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_jd);
- __pyx_r = __pyx_v_jd;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":41
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- * def JulianDayFromDate(date, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __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("netcdftime._netcdftime.JulianDayFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __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_microsecond);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_d);
- __Pyx_XDECREF(__pyx_v_month_lt_3);
- __Pyx_XDECREF(__pyx_v_A);
- __Pyx_XDECREF(__pyx_v_jd);
- __Pyx_XDECREF(__pyx_v_B);
- __Pyx_XDECREF(__pyx_v_ii);
- __Pyx_XDECREF(__pyx_v_eps);
- __Pyx_XDECREF(__pyx_v_date);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":153
- *
- *
- * cdef _NoLeapDayFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__NoLeapDayFromDate(PyObject *__pyx_v_date) {
- 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_microsecond = NULL;
- PyObject *__pyx_v_jd = 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;
- __Pyx_RefNannySetupContext("_NoLeapDayFromDate", 0);
-
- /* "netcdftime/_netcdftime.pyx":161
- * """
- *
- * year = date.year # <<<<<<<<<<<<<<
- * month = date.month
- * day = date.day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":162
- *
- * year = date.year
- * month = date.month # <<<<<<<<<<<<<<
- * day = date.day
- * hour = date.hour
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_month = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":163
- * year = date.year
- * month = date.month
- * day = date.day # <<<<<<<<<<<<<<
- * hour = date.hour
- * minute = date.minute
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_day = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":164
- * month = date.month
- * day = date.day
- * hour = date.hour # <<<<<<<<<<<<<<
- * minute = date.minute
- * second = date.second
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_hour = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":165
- * day = date.day
- * hour = date.hour
- * minute = date.minute # <<<<<<<<<<<<<<
- * second = date.second
- * microsecond = date.microsecond
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_minute = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":166
- * hour = date.hour
- * minute = date.minute
- * second = date.second # <<<<<<<<<<<<<<
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_second = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":167
- * minute = date.minute
- * second = date.second
- * microsecond = date.microsecond # <<<<<<<<<<<<<<
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_microsecond = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":169
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0 # <<<<<<<<<<<<<<
- *
- * # Start Meeus algorithm (variables are in his notation)
- */
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_hour, __pyx_float_24_0, 24.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_day, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_minute, __pyx_float_1440_0, 1440.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __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_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_microsecond, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_second, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_86400_0, 86400.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_day, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":172
- *
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3): # <<<<<<<<<<<<<<
- * month = month + 12
- * year = year - 1
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_month, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":173
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3):
- * month = month + 12 # <<<<<<<<<<<<<<
- * year = year - 1
- *
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_month, __pyx_int_12, 12, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_month, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":174
- * if (month < 3):
- * month = month + 12
- * year = year - 1 # <<<<<<<<<<<<<<
- *
- * jd = int(365. * (year + 4716)) + int(30.6001 * (month + 1)) + \
- */
- __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_year, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":172
- *
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3): # <<<<<<<<<<<<<<
- * month = month + 12
- * year = year - 1
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":176
- * year = year - 1
- *
- * jd = int(365. * (year + 4716)) + int(30.6001 * (month + 1)) + \ # <<<<<<<<<<<<<<
- * day - 1524.5
- *
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Multiply(__pyx_float_365_, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_month, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __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;
-
- /* "netcdftime/_netcdftime.pyx":177
- *
- * jd = int(365. * (year + 4716)) + int(30.6001 * (month + 1)) + \
- * day - 1524.5 # <<<<<<<<<<<<<<
- *
- * return jd
- */
- __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyFloat_SubtractObjC(__pyx_t_1, __pyx_float_1524_5, 1524.5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_jd = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":179
- * day - 1524.5
- *
- * return jd # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_jd);
- __pyx_r = __pyx_v_jd;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":153
- *
- *
- * cdef _NoLeapDayFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("netcdftime._netcdftime._NoLeapDayFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __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_microsecond);
- __Pyx_XDECREF(__pyx_v_jd);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":182
- *
- *
- * cdef _AllLeapFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__AllLeapFromDate(PyObject *__pyx_v_date) {
- 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_microsecond = NULL;
- PyObject *__pyx_v_jd = 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;
- __Pyx_RefNannySetupContext("_AllLeapFromDate", 0);
-
- /* "netcdftime/_netcdftime.pyx":191
- * """
- *
- * year = date.year # <<<<<<<<<<<<<<
- * month = date.month
- * day = date.day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":192
- *
- * year = date.year
- * month = date.month # <<<<<<<<<<<<<<
- * day = date.day
- * hour = date.hour
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_month = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":193
- * year = date.year
- * month = date.month
- * day = date.day # <<<<<<<<<<<<<<
- * hour = date.hour
- * minute = date.minute
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_day = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":194
- * month = date.month
- * day = date.day
- * hour = date.hour # <<<<<<<<<<<<<<
- * minute = date.minute
- * second = date.second
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_hour = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":195
- * day = date.day
- * hour = date.hour
- * minute = date.minute # <<<<<<<<<<<<<<
- * second = date.second
- * microsecond = date.microsecond
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_minute = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":196
- * hour = date.hour
- * minute = date.minute
- * second = date.second # <<<<<<<<<<<<<<
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_second = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":197
- * minute = date.minute
- * second = date.second
- * microsecond = date.microsecond # <<<<<<<<<<<<<<
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_microsecond = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":199
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0 # <<<<<<<<<<<<<<
- *
- * # Start Meeus algorithm (variables are in his notation)
- */
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_hour, __pyx_float_24_0, 24.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_day, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_minute, __pyx_float_1440_0, 1440.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __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_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_microsecond, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_second, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_86400_0, 86400.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_day, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":202
- *
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3): # <<<<<<<<<<<<<<
- * month = month + 12
- * year = year - 1
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_month, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":203
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3):
- * month = month + 12 # <<<<<<<<<<<<<<
- * year = year - 1
- *
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_month, __pyx_int_12, 12, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_month, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":204
- * if (month < 3):
- * month = month + 12
- * year = year - 1 # <<<<<<<<<<<<<<
- *
- * jd = int(366. * (year + 4716)) + int(30.6001 * (month + 1)) + \
- */
- __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_year, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":202
- *
- * # Start Meeus algorithm (variables are in his notation)
- * if (month < 3): # <<<<<<<<<<<<<<
- * month = month + 12
- * year = year - 1
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":206
- * year = year - 1
- *
- * jd = int(366. * (year + 4716)) + int(30.6001 * (month + 1)) + \ # <<<<<<<<<<<<<<
- * day - 1524.5
- *
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Multiply(__pyx_float_366_, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_month, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __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;
-
- /* "netcdftime/_netcdftime.pyx":207
- *
- * jd = int(366. * (year + 4716)) + int(30.6001 * (month + 1)) + \
- * day - 1524.5 # <<<<<<<<<<<<<<
- *
- * return jd
- */
- __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyFloat_SubtractObjC(__pyx_t_1, __pyx_float_1524_5, 1524.5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_jd = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":209
- * day - 1524.5
- *
- * return jd # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_jd);
- __pyx_r = __pyx_v_jd;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":182
- *
- *
- * cdef _AllLeapFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("netcdftime._netcdftime._AllLeapFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __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_microsecond);
- __Pyx_XDECREF(__pyx_v_jd);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":212
- *
- *
- * cdef _360DayFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__360DayFromDate(PyObject *__pyx_v_date) {
- 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_microsecond = NULL;
- PyObject *__pyx_v_jd = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("_360DayFromDate", 0);
-
- /* "netcdftime/_netcdftime.pyx":221
- * """
- *
- * year = date.year # <<<<<<<<<<<<<<
- * month = date.month
- * day = date.day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":222
- *
- * year = date.year
- * month = date.month # <<<<<<<<<<<<<<
- * day = date.day
- * hour = date.hour
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_month = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":223
- * year = date.year
- * month = date.month
- * day = date.day # <<<<<<<<<<<<<<
- * hour = date.hour
- * minute = date.minute
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_day = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":224
- * month = date.month
- * day = date.day
- * hour = date.hour # <<<<<<<<<<<<<<
- * minute = date.minute
- * second = date.second
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_hour = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":225
- * day = date.day
- * hour = date.hour
- * minute = date.minute # <<<<<<<<<<<<<<
- * second = date.second
- * microsecond = date.microsecond
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_minute = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":226
- * hour = date.hour
- * minute = date.minute
- * second = date.second # <<<<<<<<<<<<<<
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_second = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":227
- * minute = date.minute
- * second = date.second
- * microsecond = date.microsecond # <<<<<<<<<<<<<<
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_microsecond = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":229
- * microsecond = date.microsecond
- * # Convert time to fractions of a day
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0 # <<<<<<<<<<<<<<
- *
- * jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day
- */
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_hour, __pyx_float_24_0, 24.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_day, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_minute, __pyx_float_1440_0, 1440.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __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_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_microsecond, __pyx_float_1_e6, 1.e6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_second, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_t_2, __pyx_float_86400_0, 86400.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_day, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":231
- * day = day + hour / 24.0 + minute / 1440.0 + (second + microsecond/1.e6) / 86400.0
- *
- * jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day # <<<<<<<<<<<<<<
- *
- * return jd
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Multiply(__pyx_float_360_, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_month, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Multiply(__pyx_float_30_, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __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_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_jd = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":233
- * jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day
- *
- * return jd # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_jd);
- __pyx_r = __pyx_v_jd;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":212
- *
- *
- * cdef _360DayFromDate(date): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("netcdftime._netcdftime._360DayFromDate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __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_microsecond);
- __Pyx_XDECREF(__pyx_v_jd);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":236
- *
- *
- * def DateFromJulianDay(JD, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_3DateFromJulianDay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_2DateFromJulianDay[] = "\n\n returns a 'datetime-like' object given Julian Day. Julian Day is a\n fractional day with approximately millisecond accuracy.\n\n if calendar='standard' or 'gregorian' (default), Julian day follows Julian\n Calendar on and before 1582-10-5, Gregorian calendar after 1582-10-15.\n\n if calendar='proleptic_gregorian', Julian Day follows gregorian calendar.\n\n if calendar='julian', Julian Day fol [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_3DateFromJulianDay = {"DateFromJulianDay", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_3DateFromJulianDay, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_2DateFromJulianDay};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_3DateFromJulianDay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_JD = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("DateFromJulianDay (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_JD,&__pyx_n_s_calendar,0};
- PyObject* values[2] = {0,0};
- values[1] = ((PyObject *)__pyx_n_s_standard);
- 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_JD)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DateFromJulianDay") < 0)) __PYX_ERR(0, 236, __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_JD = values[0];
- __pyx_v_calendar = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("DateFromJulianDay", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.DateFromJulianDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_2DateFromJulianDay(__pyx_self, __pyx_v_JD, __pyx_v_calendar);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_2DateFromJulianDay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_JD, PyObject *__pyx_v_calendar) {
- PyObject *__pyx_v_julian = NULL;
- CYTHON_UNUSED PyObject *__pyx_v_dayofwk = NULL;
- PyObject *__pyx_v_Z = NULL;
- PyObject *__pyx_v_F = NULL;
- PyObject *__pyx_v_alpha = NULL;
- PyObject *__pyx_v_A = NULL;
- PyObject *__pyx_v_ind_before = NULL;
- PyObject *__pyx_v_B = NULL;
- PyObject *__pyx_v_C = NULL;
- PyObject *__pyx_v_D = NULL;
- PyObject *__pyx_v_E = NULL;
- PyObject *__pyx_v_day = NULL;
- PyObject *__pyx_v_nday = NULL;
- PyObject *__pyx_v_dayofyr = NULL;
- PyObject *__pyx_v_ind_nday_before = NULL;
- PyObject *__pyx_v_month = NULL;
- PyObject *__pyx_v_year = NULL;
- PyObject *__pyx_v_leap = NULL;
- PyObject *__pyx_v_inc_idx = NULL;
- PyObject *__pyx_v_eps = NULL;
- PyObject *__pyx_v_hour = NULL;
- PyObject *__pyx_v_minute = NULL;
- PyObject *__pyx_v_second = NULL;
- PyObject *__pyx_v_microsecond = NULL;
- int __pyx_v_isscalar;
- PyObject *__pyx_v_datetime_type = NULL;
- PyObject *__pyx_v_args = 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;
- int __pyx_t_5;
- 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 = NULL;
- PyObject *__pyx_t_12 = NULL;
- int __pyx_t_13;
- int __pyx_t_14;
- Py_ssize_t __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- PyObject *__pyx_t_17 = NULL;
- PyObject *__pyx_t_18 = NULL;
- PyObject *(*__pyx_t_19)(PyObject *);
- __Pyx_RefNannySetupContext("DateFromJulianDay", 0);
-
- /* "netcdftime/_netcdftime.pyx":264
- * # based on redate.py by David Finlayson.
- *
- * julian = np.array(JD, dtype=float) # <<<<<<<<<<<<<<
- *
- * if np.min(julian) < 0:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __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_ERR(0, 264, __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_ERR(0, 264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_JD);
- __Pyx_GIVEREF(__pyx_v_JD);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_JD);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __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_v_julian = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":266
- * julian = np.array(JD, dtype=float)
- *
- * if np.min(julian) < 0: # <<<<<<<<<<<<<<
- * raise ValueError('Julian Day must be positive')
- *
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_julian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_julian};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_julian};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __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_julian);
- __Pyx_GIVEREF(__pyx_v_julian);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_julian);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __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_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":267
- *
- * if np.min(julian) < 0:
- * raise ValueError('Julian Day must be positive') # <<<<<<<<<<<<<<
- *
- * dayofwk = np.atleast_1d(np.int32(np.fmod(np.int32(julian + 1.5), 7)))
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __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_ERR(0, 267, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":266
- * julian = np.array(JD, dtype=float)
- *
- * if np.min(julian) < 0: # <<<<<<<<<<<<<<
- * raise ValueError('Julian Day must be positive')
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":269
- * raise ValueError('Julian Day must be positive')
- *
- * dayofwk = np.atleast_1d(np.int32(np.fmod(np.int32(julian + 1.5), 7))) # <<<<<<<<<<<<<<
- * # get the day (Z) and the fraction of the day (F)
- * # add 0.000005 which is 452 ms in case of jd being after
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fmod); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyFloat_AddObjC(__pyx_v_julian, __pyx_float_1_5, 1.5, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_9};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_int_7};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_int_7};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_t_7);
- __Pyx_INCREF(__pyx_int_7);
- __Pyx_GIVEREF(__pyx_int_7);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_int_7);
- __pyx_t_7 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_3};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_3};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_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_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_dayofwk = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":273
- * # add 0.000005 which is 452 ms in case of jd being after
- * # second 23:59:59 of a day we want to round to the next day see issue #75
- * Z = np.atleast_1d(np.int32(np.round(julian))) # <<<<<<<<<<<<<<
- * F = np.atleast_1d(julian + 0.5 - Z).astype(np.float64)
- * if calendar in ['standard', 'gregorian']:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_round); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_julian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_julian};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_julian};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __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(__pyx_v_julian);
- __Pyx_GIVEREF(__pyx_v_julian);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_julian);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __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_2);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_Z = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":274
- * # second 23:59:59 of a day we want to round to the next day see issue #75
- * Z = np.atleast_1d(np.int32(np.round(julian)))
- * F = np.atleast_1d(julian + 0.5 - Z).astype(np.float64) # <<<<<<<<<<<<<<
- * if calendar in ['standard', 'gregorian']:
- * # MC
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyFloat_AddObjC(__pyx_v_julian, __pyx_float_0_5, 0.5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_7, __pyx_v_Z); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- }
- }
- if (!__pyx_t_12) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); __pyx_t_12 = 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_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __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;
- __pyx_v_F = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":275
- * Z = np.atleast_1d(np.int32(np.round(julian)))
- * F = np.atleast_1d(julian + 0.5 - Z).astype(np.float64)
- * if calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * # MC
- * # alpha = int((Z - 1867216.25)/36524.25)
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_1 = __pyx_v_calendar;
- __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
- if (!__pyx_t_14) {
- } else {
- __pyx_t_5 = __pyx_t_14;
- goto __pyx_L5_bool_binop_done;
- }
- __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_14;
- __pyx_L5_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_14 = (__pyx_t_5 != 0);
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":279
- * # alpha = int((Z - 1867216.25)/36524.25)
- * # A = Z + 1 + alpha - int(alpha/4)
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25) # <<<<<<<<<<<<<<
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * # check if dates before oct 5th 1582 are in the array
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyFloat_SubtractObjC(__pyx_v_Z, __pyx_float_1867216_, 1867216., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyFloat_SubtractObjC(__pyx_t_2, __pyx_float_0_25, 0.25, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_36524_25, 36524.25, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_alpha = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":280
- * # A = Z + 1 + alpha - int(alpha/4)
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25)
- * A = Z + 1 + alpha - np.int32(0.25 * alpha) # <<<<<<<<<<<<<<
- * # check if dates before oct 5th 1582 are in the array
- * ind_before = np.where(julian < 2299160.5)[0]
- */
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_Z, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_25, __pyx_v_alpha); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_12};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_12};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_A = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":282
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * # check if dates before oct 5th 1582 are in the array
- * ind_before = np.where(julian < 2299160.5)[0] # <<<<<<<<<<<<<<
- * if len(ind_before) > 0:
- * A[ind_before] = Z[ind_before]
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_julian, __pyx_float_2299160_5, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_ind_before = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":283
- * # check if dates before oct 5th 1582 are in the array
- * ind_before = np.where(julian < 2299160.5)[0]
- * if len(ind_before) > 0: # <<<<<<<<<<<<<<
- * A[ind_before] = Z[ind_before]
- *
- */
- __pyx_t_15 = PyObject_Length(__pyx_v_ind_before); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 283, __pyx_L1_error)
- __pyx_t_14 = ((__pyx_t_15 > 0) != 0);
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":284
- * ind_before = np.where(julian < 2299160.5)[0]
- * if len(ind_before) > 0:
- * A[ind_before] = Z[ind_before] # <<<<<<<<<<<<<<
- *
- * elif calendar == 'proleptic_gregorian':
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_Z, __pyx_v_ind_before); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyObject_SetItem(__pyx_v_A, __pyx_v_ind_before, __pyx_t_6) < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":283
- * # check if dates before oct 5th 1582 are in the array
- * ind_before = np.where(julian < 2299160.5)[0]
- * if len(ind_before) > 0: # <<<<<<<<<<<<<<
- * A[ind_before] = Z[ind_before]
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":275
- * Z = np.atleast_1d(np.int32(np.round(julian)))
- * F = np.atleast_1d(julian + 0.5 - Z).astype(np.float64)
- * if calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * # MC
- * # alpha = int((Z - 1867216.25)/36524.25)
- */
- goto __pyx_L4;
- }
-
- /* "netcdftime/_netcdftime.pyx":286
- * A[ind_before] = Z[ind_before]
- *
- * elif calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * # MC
- * # alpha = int((Z - 1867216.25)/36524.25)
- */
- __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":290
- * # alpha = int((Z - 1867216.25)/36524.25)
- * # A = Z + 1 + alpha - int(alpha/4)
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25) # <<<<<<<<<<<<<<
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * elif calendar == 'julian':
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyFloat_SubtractObjC(__pyx_v_Z, __pyx_float_1867216_, 1867216., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyFloat_SubtractObjC(__pyx_t_2, __pyx_float_0_25, 0.25, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_36524_25, 36524.25, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_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_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_alpha = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":291
- * # A = Z + 1 + alpha - int(alpha/4)
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25)
- * A = Z + 1 + alpha - np.int32(0.25 * alpha) # <<<<<<<<<<<<<<
- * elif calendar == 'julian':
- * A = Z
- */
- __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_Z, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = PyNumber_Add(__pyx_t_6, __pyx_v_alpha); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_float_0_25, __pyx_v_alpha); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __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_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_A = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":286
- * A[ind_before] = Z[ind_before]
- *
- * elif calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * # MC
- * # alpha = int((Z - 1867216.25)/36524.25)
- */
- goto __pyx_L4;
- }
-
- /* "netcdftime/_netcdftime.pyx":292
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25)
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * elif calendar == 'julian': # <<<<<<<<<<<<<<
- * A = Z
- * else:
- */
- __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":293
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * elif calendar == 'julian':
- * A = Z # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(
- */
- __Pyx_INCREF(__pyx_v_Z);
- __pyx_v_A = __pyx_v_Z;
-
- /* "netcdftime/_netcdftime.pyx":292
- * alpha = np.int32(((Z - 1867216.) - 0.25) / 36524.25)
- * A = Z + 1 + alpha - np.int32(0.25 * alpha)
- * elif calendar == 'julian': # <<<<<<<<<<<<<<
- * A = Z
- * else:
- */
- goto __pyx_L4;
- }
-
- /* "netcdftime/_netcdftime.pyx":295
- * A = Z
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar)
- *
- */
- /*else*/ {
-
- /* "netcdftime/_netcdftime.pyx":296
- * else:
- * raise ValueError(
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar) # <<<<<<<<<<<<<<
- *
- * B = A + 1524
- */
- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_unknown_calendar_must_be_one_of, __pyx_v_calendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netcdftime/_netcdftime.pyx":295
- * A = Z
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar)
- *
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __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 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __PYX_ERR(0, 295, __pyx_L1_error)
- }
- __pyx_L4:;
-
- /* "netcdftime/_netcdftime.pyx":298
- * 'unknown calendar, must be one of julian,standard,gregorian,proleptic_gregorian, got %s' % calendar)
- *
- * B = A + 1524 # <<<<<<<<<<<<<<
- * # MC
- * # C = int((B - 122.1)/365.25)
- */
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_A, __pyx_int_1524, 0x5F4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_B = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":302
- * # C = int((B - 122.1)/365.25)
- * # D = int(365.25 * C)
- * C = np.atleast_1d(np.int32(6680. + ((B - 2439870.) - 122.1) / 365.25)) # <<<<<<<<<<<<<<
- * D = np.atleast_1d(np.int32(365 * C + np.int32(0.25 * C)))
- * E = np.atleast_1d(np.int32((B - D) / 30.6001))
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyFloat_SubtractObjC(__pyx_v_B, __pyx_float_2439870_, 2439870., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyFloat_SubtractObjC(__pyx_t_4, __pyx_float_122_1, 122.1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_365_25, 365.25, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_AddCObj(__pyx_float_6680_, __pyx_t_4, 6680., 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 302, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 302, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_C = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":303
- * # D = int(365.25 * C)
- * C = np.atleast_1d(np.int32(6680. + ((B - 2439870.) - 122.1) / 365.25))
- * D = np.atleast_1d(np.int32(365 * C + np.int32(0.25 * C))) # <<<<<<<<<<<<<<
- * E = np.atleast_1d(np.int32((B - D) / 30.6001))
- *
- */
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_int_365, __pyx_v_C); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_25, __pyx_v_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 303, __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_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __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;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_12 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
- __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
- __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_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_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __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_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_D = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":304
- * C = np.atleast_1d(np.int32(6680. + ((B - 2439870.) - 122.1) / 365.25))
- * D = np.atleast_1d(np.int32(365 * C + np.int32(0.25 * C)))
- * E = np.atleast_1d(np.int32((B - D) / 30.6001)) # <<<<<<<<<<<<<<
- *
- * # Convert to date
- */
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_12, __pyx_float_30_6001, 30.6001, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- if (!__pyx_t_12) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL;
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __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_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_E = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":307
- *
- * # Convert to date
- * day = np.clip(B - D - np.int64(30.6001 * E) + F, 1, None) # <<<<<<<<<<<<<<
- * nday = B - D - 123
- * dayofyr = nday - 305
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_v_E); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_F); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_8, __pyx_int_1, Py_None};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_8, __pyx_int_1, Py_None};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_t_8);
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_int_1);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_13, Py_None);
- __pyx_t_8 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_day = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":308
- * # Convert to date
- * day = np.clip(B - D - np.int64(30.6001 * E) + F, 1, None)
- * nday = B - D - 123 # <<<<<<<<<<<<<<
- * dayofyr = nday - 305
- * ind_nday_before = np.where(nday <= 305)[0]
- */
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_123, 0x7B, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_nday = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":309
- * day = np.clip(B - D - np.int64(30.6001 * E) + F, 1, None)
- * nday = B - D - 123
- * dayofyr = nday - 305 # <<<<<<<<<<<<<<
- * ind_nday_before = np.where(nday <= 305)[0]
- * if len(ind_nday_before) > 0:
- */
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_nday, __pyx_int_305, 0x131, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_dayofyr = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":310
- * nday = B - D - 123
- * dayofyr = nday - 305
- * ind_nday_before = np.where(nday <= 305)[0] # <<<<<<<<<<<<<<
- * if len(ind_nday_before) > 0:
- * dayofyr[ind_nday_before] = nday[ind_nday_before] + 60
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_nday, __pyx_int_305, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_ind_nday_before = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":311
- * dayofyr = nday - 305
- * ind_nday_before = np.where(nday <= 305)[0]
- * if len(ind_nday_before) > 0: # <<<<<<<<<<<<<<
- * dayofyr[ind_nday_before] = nday[ind_nday_before] + 60
- * # MC
- */
- __pyx_t_15 = PyObject_Length(__pyx_v_ind_nday_before); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 311, __pyx_L1_error)
- __pyx_t_14 = ((__pyx_t_15 > 0) != 0);
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":312
- * ind_nday_before = np.where(nday <= 305)[0]
- * if len(ind_nday_before) > 0:
- * dayofyr[ind_nday_before] = nday[ind_nday_before] + 60 # <<<<<<<<<<<<<<
- * # MC
- * # if E < 14:
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_nday, __pyx_v_ind_nday_before); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_60, 60, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_dayofyr, __pyx_v_ind_nday_before, __pyx_t_1) < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":311
- * dayofyr = nday - 305
- * ind_nday_before = np.where(nday <= 305)[0]
- * if len(ind_nday_before) > 0: # <<<<<<<<<<<<<<
- * dayofyr[ind_nday_before] = nday[ind_nday_before] + 60
- * # MC
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":323
- * # else:
- * # year = C - 4715
- * month = E - 1 # <<<<<<<<<<<<<<
- * month[month > 12] = month[month > 12] - 12
- * year = C - 4715
- */
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_E, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_month = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":324
- * # year = C - 4715
- * month = E - 1
- * month[month > 12] = month[month > 12] - 12 # <<<<<<<<<<<<<<
- * year = C - 4715
- * year[month > 2] = year[month > 2] - 1
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_month, __pyx_int_12, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
- __pyx_t_6 = PyObject_GetItem(__pyx_v_month, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_12, 12, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_month, __pyx_int_12, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
- if (unlikely(PyObject_SetItem(__pyx_v_month, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":325
- * month = E - 1
- * month[month > 12] = month[month > 12] - 12
- * year = C - 4715 # <<<<<<<<<<<<<<
- * year[month > 2] = year[month > 2] - 1
- * year[year <= 0] = year[year <= 0] - 1
- */
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_C, __pyx_int_4715, 0x126B, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":326
- * month[month > 12] = month[month > 12] - 12
- * year = C - 4715
- * year[month > 2] = year[month > 2] - 1 # <<<<<<<<<<<<<<
- * year[year <= 0] = year[year <= 0] - 1
- *
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
- __pyx_t_6 = PyObject_GetItem(__pyx_v_year, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
- if (unlikely(PyObject_SetItem(__pyx_v_year, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":327
- * year = C - 4715
- * year[month > 2] = year[month > 2] - 1
- * year[year <= 0] = year[year <= 0] - 1 # <<<<<<<<<<<<<<
- *
- * # a leap year?
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_year, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
- __pyx_t_6 = PyObject_GetItem(__pyx_v_year, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_year, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
- if (unlikely(PyObject_SetItem(__pyx_v_year, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":330
- *
- * # a leap year?
- * leap = np.zeros(len(year),dtype=dayofyr.dtype) # <<<<<<<<<<<<<<
- * leap[year % 4 == 0] = 1
- * if calendar == 'proleptic_gregorian':
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_15 = PyObject_Length(__pyx_v_year); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 330, __pyx_L1_error)
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dayofyr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __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_leap = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":331
- * # a leap year?
- * leap = np.zeros(len(year),dtype=dayofyr.dtype)
- * leap[year % 4 == 0] = 1 # <<<<<<<<<<<<<<
- * if calendar == 'proleptic_gregorian':
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- */
- __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_year, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_leap, __pyx_t_1, __pyx_int_1) < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":332
- * leap = np.zeros(len(year),dtype=dayofyr.dtype)
- * leap[year % 4 == 0] = 1
- * if calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- * elif calendar in ['standard', 'gregorian']:
- */
- __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":333
- * leap[year % 4 == 0] = 1
- * if calendar == 'proleptic_gregorian':
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0 # <<<<<<<<<<<<<<
- * elif calendar in ['standard', 'gregorian']:
- * leap[(year % 100 == 0) & (year % 400 != 0) & (julian < 2299160.5)] = 0
- */
- __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_year, __pyx_int_100, 0x64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_year, __pyx_int_400, 0x190, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_leap, __pyx_t_1, __pyx_int_0) < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":332
- * leap = np.zeros(len(year),dtype=dayofyr.dtype)
- * leap[year % 4 == 0] = 1
- * if calendar == 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- * elif calendar in ['standard', 'gregorian']:
- */
- goto __pyx_L9;
- }
-
- /* "netcdftime/_netcdftime.pyx":334
- * if calendar == 'proleptic_gregorian':
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- * elif calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * leap[(year % 100 == 0) & (year % 400 != 0) & (julian < 2299160.5)] = 0
- *
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_1 = __pyx_v_calendar;
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
- if (!__pyx_t_5) {
- } else {
- __pyx_t_14 = __pyx_t_5;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
- __pyx_t_14 = __pyx_t_5;
- __pyx_L10_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = (__pyx_t_14 != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":335
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- * elif calendar in ['standard', 'gregorian']:
- * leap[(year % 100 == 0) & (year % 400 != 0) & (julian < 2299160.5)] = 0 # <<<<<<<<<<<<<<
- *
- * inc_idx = np.where((leap == 1) & (month > 2))[0]
- */
- __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_year, __pyx_int_100, 0x64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_year, __pyx_int_400, 0x190, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __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_t_2 = PyObject_RichCompare(__pyx_v_julian, __pyx_float_2299160_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
- __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __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_leap, __pyx_t_3, __pyx_int_0) < 0)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":334
- * if calendar == 'proleptic_gregorian':
- * leap[(year % 100 == 0) & (year % 400 != 0)] = 0
- * elif calendar in ['standard', 'gregorian']: # <<<<<<<<<<<<<<
- * leap[(year % 100 == 0) & (year % 400 != 0) & (julian < 2299160.5)] = 0
- *
- */
- }
- __pyx_L9:;
-
- /* "netcdftime/_netcdftime.pyx":337
- * leap[(year % 100 == 0) & (year % 400 != 0) & (julian < 2299160.5)] = 0
- *
- * inc_idx = np.where((leap == 1) & (month > 2))[0] # <<<<<<<<<<<<<<
- * dayofyr[inc_idx] = dayofyr[inc_idx] + leap[inc_idx]
- *
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_leap, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
- __pyx_t_8 = PyNumber_And(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __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_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __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_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_inc_idx = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":338
- *
- * inc_idx = np.where((leap == 1) & (month > 2))[0]
- * dayofyr[inc_idx] = dayofyr[inc_idx] + leap[inc_idx] # <<<<<<<<<<<<<<
- *
- * # Subtract the offset from JulianDayFromDate from the microseconds (pull
- */
- __pyx_t_1 = PyObject_GetItem(__pyx_v_dayofyr, __pyx_v_inc_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_leap, __pyx_v_inc_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __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;
- if (unlikely(PyObject_SetItem(__pyx_v_dayofyr, __pyx_v_inc_idx, __pyx_t_2) < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":342
- * # Subtract the offset from JulianDayFromDate from the microseconds (pull
- * # request #433).
- * eps = np.finfo(float).eps # <<<<<<<<<<<<<<
- * eps = np.maximum(eps*julian, eps)
- * hour = np.clip((F * 24.).astype(np.int64), 0, 23)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_finfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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 *)(&PyFloat_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)(&PyFloat_Type))};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)(&PyFloat_Type))};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __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 = NULL;
- __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)(&PyFloat_Type)));
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_eps = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":343
- * # request #433).
- * eps = np.finfo(float).eps
- * eps = np.maximum(eps*julian, eps) # <<<<<<<<<<<<<<
- * hour = np.clip((F * 24.).astype(np.int64), 0, 23)
- * F -= hour / 24.
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Multiply(__pyx_v_eps, __pyx_v_julian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_eps};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_eps};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_t_2);
- __Pyx_INCREF(__pyx_v_eps);
- __Pyx_GIVEREF(__pyx_v_eps);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_v_eps);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF_SET(__pyx_v_eps, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":344
- * eps = np.finfo(float).eps
- * eps = np.maximum(eps*julian, eps)
- * hour = np.clip((F * 24.).astype(np.int64), 0, 23) # <<<<<<<<<<<<<<
- * F -= hour / 24.
- * minute = np.clip((F * 1440.).astype(np.int64), 0, 59)
- */
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_clip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_2 = PyNumber_Multiply(__pyx_v_F, __pyx_float_24_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_9};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_9};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_8, __pyx_int_0, __pyx_int_23};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_8, __pyx_int_0, __pyx_int_23};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_13, __pyx_t_8);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_13, __pyx_int_0);
- __Pyx_INCREF(__pyx_int_23);
- __Pyx_GIVEREF(__pyx_int_23);
- PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_13, __pyx_int_23);
- __pyx_t_8 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_hour = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":345
- * eps = np.maximum(eps*julian, eps)
- * hour = np.clip((F * 24.).astype(np.int64), 0, 23)
- * F -= hour / 24. # <<<<<<<<<<<<<<
- * minute = np.clip((F * 1440.).astype(np.int64), 0, 59)
- * # this is an overestimation due to added offset in JulianDayFromDate
- */
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_hour, __pyx_float_24_, 24., 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_v_F, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_F, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":346
- * hour = np.clip((F * 24.).astype(np.int64), 0, 23)
- * F -= hour / 24.
- * minute = np.clip((F * 1440.).astype(np.int64), 0, 59) # <<<<<<<<<<<<<<
- * # this is an overestimation due to added offset in JulianDayFromDate
- * second = np.clip((F - minute / 1440.) * 86400., 0, None)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clip); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = PyNumber_Multiply(__pyx_v_F, __pyx_float_1440_); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_9};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_9};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_1, __pyx_int_0, __pyx_int_59};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_1, __pyx_int_0, __pyx_int_59};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_13, __pyx_t_1);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_13, __pyx_int_0);
- __Pyx_INCREF(__pyx_int_59);
- __Pyx_GIVEREF(__pyx_int_59);
- PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_13, __pyx_int_59);
- __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_minute = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":348
- * minute = np.clip((F * 1440.).astype(np.int64), 0, 59)
- * # this is an overestimation due to added offset in JulianDayFromDate
- * second = np.clip((F - minute / 1440.) * 86400., 0, None) # <<<<<<<<<<<<<<
- * microsecond = (second % 1)*1.e6
- * # remove the offset from the microsecond calculation.
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_clip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyFloat_DivideObjC(__pyx_v_minute, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_F, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_float_86400_); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_7, __pyx_int_0, Py_None};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_7, __pyx_int_0, Py_None};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_13, __pyx_t_7);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_13, __pyx_int_0);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_13, Py_None);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_second = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":349
- * # this is an overestimation due to added offset in JulianDayFromDate
- * second = np.clip((F - minute / 1440.) * 86400., 0, None)
- * microsecond = (second % 1)*1.e6 # <<<<<<<<<<<<<<
- * # remove the offset from the microsecond calculation.
- * microsecond = np.clip(microsecond - eps*86400.*1e6, 0, 999999)
- */
- __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_second, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_float_1_e6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_microsecond = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":351
- * microsecond = (second % 1)*1.e6
- * # remove the offset from the microsecond calculation.
- * microsecond = np.clip(microsecond - eps*86400.*1e6, 0, 999999) # <<<<<<<<<<<<<<
- *
- * # convert year, month, day, hour, minute, second to int32
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_eps, __pyx_float_86400_); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_float_1e6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_microsecond, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_int_0, __pyx_int_999999};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_int_0, __pyx_int_999999};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_13, __pyx_t_6);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_13, __pyx_int_0);
- __Pyx_INCREF(__pyx_int_999999);
- __Pyx_GIVEREF(__pyx_int_999999);
- PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_13, __pyx_int_999999);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __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_DECREF_SET(__pyx_v_microsecond, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":354
- *
- * # convert year, month, day, hour, minute, second to int32
- * year = year.astype(np.int32) # <<<<<<<<<<<<<<
- * month = month.astype(np.int32)
- * day = day.astype(np.int32)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_year, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":355
- * # convert year, month, day, hour, minute, second to int32
- * year = year.astype(np.int32)
- * month = month.astype(np.int32) # <<<<<<<<<<<<<<
- * day = day.astype(np.int32)
- * hour = hour.astype(np.int32)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_month, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __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_DECREF_SET(__pyx_v_month, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":356
- * year = year.astype(np.int32)
- * month = month.astype(np.int32)
- * day = day.astype(np.int32) # <<<<<<<<<<<<<<
- * hour = hour.astype(np.int32)
- * minute = minute.astype(np.int32)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_day, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_day, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":357
- * month = month.astype(np.int32)
- * day = day.astype(np.int32)
- * hour = hour.astype(np.int32) # <<<<<<<<<<<<<<
- * minute = minute.astype(np.int32)
- * second = second.astype(np.int32)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_hour, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __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_DECREF_SET(__pyx_v_hour, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":358
- * day = day.astype(np.int32)
- * hour = hour.astype(np.int32)
- * minute = minute.astype(np.int32) # <<<<<<<<<<<<<<
- * second = second.astype(np.int32)
- * microsecond = microsecond.astype(np.int32)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_minute, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_minute, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":359
- * hour = hour.astype(np.int32)
- * minute = minute.astype(np.int32)
- * second = second.astype(np.int32) # <<<<<<<<<<<<<<
- * microsecond = microsecond.astype(np.int32)
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_second, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __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_DECREF_SET(__pyx_v_second, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":360
- * minute = minute.astype(np.int32)
- * second = second.astype(np.int32)
- * microsecond = microsecond.astype(np.int32) # <<<<<<<<<<<<<<
- *
- * # check if input was scalar and change return accordingly
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_microsecond, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_microsecond, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":363
- *
- * # check if input was scalar and change return accordingly
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * JD[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netcdftime/_netcdftime.pyx":364
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * JD[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":365
- * isscalar = False
- * try:
- * JD[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_JD, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L12_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":364
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * JD[0]
- * except:
- */
- }
- __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_L19_try_end;
- __pyx_L12_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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_6); __pyx_t_6 = 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;
-
- /* "netcdftime/_netcdftime.pyx":366
- * try:
- * JD[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- *
- */
- /*except:*/ {
- __Pyx_AddTraceback("netcdftime._netcdftime.DateFromJulianDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(0, 366, __pyx_L14_except_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":367
- * JD[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- *
- * if calendar in 'proleptic_gregorian':
- */
- __pyx_v_isscalar = 1;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L13_exception_handled;
- }
- __pyx_L14_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":364
- * # check if input was scalar and change return accordingly
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * JD[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __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_L1_error;
- __pyx_L13_exception_handled:;
- __Pyx_PyThreadState_assign
- __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);
- __pyx_L19_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":369
- * isscalar = True
- *
- * if calendar in 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * # FIXME: datetime.datetime does not support years < 1
- * if (year < 0).any():
- */
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_calendar, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
- __pyx_t_14 = (__pyx_t_5 != 0);
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":371
- * if calendar in 'proleptic_gregorian':
- * # FIXME: datetime.datetime does not support years < 1
- * if (year < 0).any(): # <<<<<<<<<<<<<<
- * datetime_type = DatetimeProlepticGregorian
- * else:
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_year, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_14) {
-
- /* "netcdftime/_netcdftime.pyx":372
- * # FIXME: datetime.datetime does not support years < 1
- * if (year < 0).any():
- * datetime_type = DatetimeProlepticGregorian # <<<<<<<<<<<<<<
- * else:
- * datetime_type = real_datetime
- */
- __Pyx_INCREF(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeProlepticGregorian));
- __pyx_v_datetime_type = ((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeProlepticGregorian);
-
- /* "netcdftime/_netcdftime.pyx":371
- * if calendar in 'proleptic_gregorian':
- * # FIXME: datetime.datetime does not support years < 1
- * if (year < 0).any(): # <<<<<<<<<<<<<<
- * datetime_type = DatetimeProlepticGregorian
- * else:
- */
- goto __pyx_L23;
- }
-
- /* "netcdftime/_netcdftime.pyx":374
- * datetime_type = DatetimeProlepticGregorian
- * else:
- * datetime_type = real_datetime # <<<<<<<<<<<<<<
- * elif calendar in ('standard', 'gregorian'):
- * # return a 'real' datetime instance if calendar is proleptic
- */
- /*else*/ {
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_datetime_type = __pyx_t_7;
- __pyx_t_7 = 0;
- }
- __pyx_L23:;
-
- /* "netcdftime/_netcdftime.pyx":369
- * isscalar = True
- *
- * if calendar in 'proleptic_gregorian': # <<<<<<<<<<<<<<
- * # FIXME: datetime.datetime does not support years < 1
- * if (year < 0).any():
- */
- goto __pyx_L22;
- }
-
- /* "netcdftime/_netcdftime.pyx":375
- * else:
- * datetime_type = real_datetime
- * elif calendar in ('standard', 'gregorian'): # <<<<<<<<<<<<<<
- * # return a 'real' datetime instance if calendar is proleptic
- * # Gregorian or Gregorian and all dates are after the
- */
- __Pyx_INCREF(__pyx_v_calendar);
- __pyx_t_7 = __pyx_v_calendar;
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
- if (!__pyx_t_5) {
- } else {
- __pyx_t_14 = __pyx_t_5;
- goto __pyx_L24_bool_binop_done;
- }
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
- __pyx_t_14 = __pyx_t_5;
- __pyx_L24_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_5 = (__pyx_t_14 != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":379
- * # Gregorian or Gregorian and all dates are after the
- * # Julian/Gregorian transition
- * if len(ind_before) == 0: # <<<<<<<<<<<<<<
- * datetime_type = real_datetime
- * else:
- */
- if (unlikely(!__pyx_v_ind_before)) { __Pyx_RaiseUnboundLocalError("ind_before"); __PYX_ERR(0, 379, __pyx_L1_error) }
- __pyx_t_15 = PyObject_Length(__pyx_v_ind_before); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 379, __pyx_L1_error)
- __pyx_t_5 = ((__pyx_t_15 == 0) != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":380
- * # Julian/Gregorian transition
- * if len(ind_before) == 0:
- * datetime_type = real_datetime # <<<<<<<<<<<<<<
- * else:
- * datetime_type = DatetimeGregorian
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_datetime_type = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":379
- * # Gregorian or Gregorian and all dates are after the
- * # Julian/Gregorian transition
- * if len(ind_before) == 0: # <<<<<<<<<<<<<<
- * datetime_type = real_datetime
- * else:
- */
- goto __pyx_L26;
- }
-
- /* "netcdftime/_netcdftime.pyx":382
- * datetime_type = real_datetime
- * else:
- * datetime_type = DatetimeGregorian # <<<<<<<<<<<<<<
- * elif calendar == "julian":
- * datetime_type = DatetimeJulian
- */
- /*else*/ {
- __Pyx_INCREF(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeGregorian));
- __pyx_v_datetime_type = ((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeGregorian);
- }
- __pyx_L26:;
-
- /* "netcdftime/_netcdftime.pyx":375
- * else:
- * datetime_type = real_datetime
- * elif calendar in ('standard', 'gregorian'): # <<<<<<<<<<<<<<
- * # return a 'real' datetime instance if calendar is proleptic
- * # Gregorian or Gregorian and all dates are after the
- */
- goto __pyx_L22;
- }
-
- /* "netcdftime/_netcdftime.pyx":383
- * else:
- * datetime_type = DatetimeGregorian
- * elif calendar == "julian": # <<<<<<<<<<<<<<
- * datetime_type = DatetimeJulian
- * else:
- */
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_calendar, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":384
- * datetime_type = DatetimeGregorian
- * elif calendar == "julian":
- * datetime_type = DatetimeJulian # <<<<<<<<<<<<<<
- * else:
- * raise ValueError("unsupported calendar: {0}".format(calendar))
- */
- __Pyx_INCREF(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeJulian));
- __pyx_v_datetime_type = ((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeJulian);
-
- /* "netcdftime/_netcdftime.pyx":383
- * else:
- * datetime_type = DatetimeGregorian
- * elif calendar == "julian": # <<<<<<<<<<<<<<
- * datetime_type = DatetimeJulian
- * else:
- */
- goto __pyx_L22;
- }
-
- /* "netcdftime/_netcdftime.pyx":386
- * datetime_type = DatetimeJulian
- * else:
- * raise ValueError("unsupported calendar: {0}".format(calendar)) # <<<<<<<<<<<<<<
- *
- * if not isscalar:
- */
- /*else*/ {
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unsupported_calendar_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_calendar); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_calendar};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_calendar};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __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_calendar);
- __Pyx_GIVEREF(__pyx_v_calendar);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_calendar);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 386, __pyx_L1_error)
- }
- __pyx_L22:;
-
- /* "netcdftime/_netcdftime.pyx":388
- * raise ValueError("unsupported calendar: {0}".format(calendar))
- *
- * if not isscalar: # <<<<<<<<<<<<<<
- * return np.array([datetime_type(*args)
- * for args in
- */
- __pyx_t_5 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":389
- *
- * if not isscalar:
- * return np.array([datetime_type(*args) # <<<<<<<<<<<<<<
- * for args in
- * zip(year, month, day, hour, minute, second,
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "netcdftime/_netcdftime.pyx":391
- * return np.array([datetime_type(*args)
- * for args in
- * zip(year, month, day, hour, minute, second, # <<<<<<<<<<<<<<
- * microsecond)])
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":392
- * for args in
- * zip(year, month, day, hour, minute, second,
- * microsecond)]) # <<<<<<<<<<<<<<
- *
- * else:
- */
- __pyx_t_9 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[8] = {__pyx_t_9, __pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 7+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[8] = {__pyx_t_9, __pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 7+__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(7+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_9) {
- __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
- }
- __Pyx_INCREF(__pyx_v_year);
- __Pyx_GIVEREF(__pyx_v_year);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_13, __pyx_v_year);
- __Pyx_INCREF(__pyx_v_month);
- __Pyx_GIVEREF(__pyx_v_month);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_v_month);
- __Pyx_INCREF(__pyx_v_day);
- __Pyx_GIVEREF(__pyx_v_day);
- PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_13, __pyx_v_day);
- __Pyx_INCREF(__pyx_v_hour);
- __Pyx_GIVEREF(__pyx_v_hour);
- PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_13, __pyx_v_hour);
- __Pyx_INCREF(__pyx_v_minute);
- __Pyx_GIVEREF(__pyx_v_minute);
- PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_13, __pyx_v_minute);
- __Pyx_INCREF(__pyx_v_second);
- __Pyx_GIVEREF(__pyx_v_second);
- PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_13, __pyx_v_second);
- __Pyx_INCREF(__pyx_v_microsecond);
- __Pyx_GIVEREF(__pyx_v_microsecond);
- PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_13, __pyx_v_microsecond);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":391
- * return np.array([datetime_type(*args)
- * for args in
- * zip(year, month, day, hour, minute, second, # <<<<<<<<<<<<<<
- * microsecond)])
- *
- */
- 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_15 = 0;
- __pyx_t_19 = NULL;
- } else {
- __pyx_t_15 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_19 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 391, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (likely(!__pyx_t_19)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_19(__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_ERR(0, 391, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":389
- *
- * if not isscalar:
- * return np.array([datetime_type(*args) # <<<<<<<<<<<<<<
- * for args in
- * zip(year, month, day, hour, minute, second,
- */
- __pyx_t_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_datetime_type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":390
- * if not isscalar:
- * return np.array([datetime_type(*args)
- * for args in # <<<<<<<<<<<<<<
- * zip(year, month, day, hour, minute, second,
- * microsecond)])
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __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_r = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":388
- * raise ValueError("unsupported calendar: {0}".format(calendar))
- *
- * if not isscalar: # <<<<<<<<<<<<<<
- * return np.array([datetime_type(*args)
- * for args in
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":395
- *
- * else:
- * return datetime_type(year[0], month[0], day[0], hour[0], # <<<<<<<<<<<<<<
- * minute[0], second[0], microsecond[0])
- *
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_year, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_month, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_day, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_hour, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":396
- * else:
- * return datetime_type(year[0], month[0], day[0], hour[0],
- * minute[0], second[0], microsecond[0]) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_minute, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_second, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_microsecond, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_INCREF(__pyx_v_datetime_type);
- __pyx_t_4 = __pyx_v_datetime_type; __pyx_t_10 = NULL;
- __pyx_t_13 = 0;
- if (CYTHON_UNPACK_METHODS && 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_13 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_6, __pyx_t_8, __pyx_t_2, __pyx_t_1, __pyx_t_3, __pyx_t_9, __pyx_t_12};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 7+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __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_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(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_6, __pyx_t_8, __pyx_t_2, __pyx_t_1, __pyx_t_3, __pyx_t_9, __pyx_t_12};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 7+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __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_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(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(7+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 395, __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_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_13, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_13, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_13, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_13, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_11, 6+__pyx_t_13, __pyx_t_12);
- __pyx_t_6 = 0;
- __pyx_t_8 = 0;
- __pyx_t_2 = 0;
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_t_9 = 0;
- __pyx_t_12 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":236
- *
- *
- * def DateFromJulianDay(JD, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* 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_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("netcdftime._netcdftime.DateFromJulianDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_julian);
- __Pyx_XDECREF(__pyx_v_dayofwk);
- __Pyx_XDECREF(__pyx_v_Z);
- __Pyx_XDECREF(__pyx_v_F);
- __Pyx_XDECREF(__pyx_v_alpha);
- __Pyx_XDECREF(__pyx_v_A);
- __Pyx_XDECREF(__pyx_v_ind_before);
- __Pyx_XDECREF(__pyx_v_B);
- __Pyx_XDECREF(__pyx_v_C);
- __Pyx_XDECREF(__pyx_v_D);
- __Pyx_XDECREF(__pyx_v_E);
- __Pyx_XDECREF(__pyx_v_day);
- __Pyx_XDECREF(__pyx_v_nday);
- __Pyx_XDECREF(__pyx_v_dayofyr);
- __Pyx_XDECREF(__pyx_v_ind_nday_before);
- __Pyx_XDECREF(__pyx_v_month);
- __Pyx_XDECREF(__pyx_v_year);
- __Pyx_XDECREF(__pyx_v_leap);
- __Pyx_XDECREF(__pyx_v_inc_idx);
- __Pyx_XDECREF(__pyx_v_eps);
- __Pyx_XDECREF(__pyx_v_hour);
- __Pyx_XDECREF(__pyx_v_minute);
- __Pyx_XDECREF(__pyx_v_second);
- __Pyx_XDECREF(__pyx_v_microsecond);
- __Pyx_XDECREF(__pyx_v_datetime_type);
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":399
- *
- *
- * cdef _DateFromNoLeapDay(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFromNoLeapDay(PyObject *__pyx_v_JD) {
- PyObject *__pyx_v_year_offset = NULL;
- PyObject *__pyx_v_dayofwk = NULL;
- PyObject *__pyx_v_F = NULL;
- PyObject *__pyx_v_Z = NULL;
- PyObject *__pyx_v_A = NULL;
- PyObject *__pyx_v_B = NULL;
- PyObject *__pyx_v_C = NULL;
- PyObject *__pyx_v_D = NULL;
- PyObject *__pyx_v_E = NULL;
- PyObject *__pyx_v_day = NULL;
- PyObject *__pyx_v_nday = NULL;
- PyObject *__pyx_v_dayofyr = NULL;
- PyObject *__pyx_v_month = NULL;
- PyObject *__pyx_v_year = NULL;
- PyObject *__pyx_v_dfrac = NULL;
- PyObject *__pyx_v_days = NULL;
- PyObject *__pyx_v_hfrac = NULL;
- PyObject *__pyx_v_hours = NULL;
- PyObject *__pyx_v_mfrac = NULL;
- PyObject *__pyx_v_minutes = NULL;
- PyObject *__pyx_v_sfrac = NULL;
- PyObject *__pyx_v_seconds = NULL;
- PyObject *__pyx_v_microseconds = 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;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- __Pyx_RefNannySetupContext("_DateFromNoLeapDay", 0);
- __Pyx_INCREF(__pyx_v_JD);
-
- /* "netcdftime/_netcdftime.pyx":409
- * # based on redate.py by David Finlayson.
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * year_offset = int(-JD) // 365 + 1
- * JD += year_offset * 365
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_JD, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":410
- *
- * if JD < 0:
- * year_offset = int(-JD) // 365 + 1 # <<<<<<<<<<<<<<
- * JD += year_offset * 365
- * else:
- */
- __pyx_t_1 = PyNumber_Negative(__pyx_v_JD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_3, __pyx_int_365, 0x16D, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_year_offset = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":411
- * if JD < 0:
- * year_offset = int(-JD) // 365 + 1
- * JD += year_offset * 365 # <<<<<<<<<<<<<<
- * else:
- * year_offset = 0
- */
- __pyx_t_3 = PyNumber_Multiply(__pyx_v_year_offset, __pyx_int_365); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_JD, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_JD, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":409
- * # based on redate.py by David Finlayson.
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * year_offset = int(-JD) // 365 + 1
- * JD += year_offset * 365
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":413
- * JD += year_offset * 365
- * else:
- * year_offset = 0 # <<<<<<<<<<<<<<
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- */
- /*else*/ {
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_year_offset = __pyx_int_0;
- }
- __pyx_L3:;
-
- /* "netcdftime/_netcdftime.pyx":415
- * year_offset = 0
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7)) # <<<<<<<<<<<<<<
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyFloat_AddObjC(__pyx_v_JD, __pyx_float_1_5, 1.5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_int_7};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_int_7};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
- __Pyx_INCREF(__pyx_int_7);
- __Pyx_GIVEREF(__pyx_int_7);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_7);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __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_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_dayofwk = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":416
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- * (F, Z) = math.modf(JD + 0.5) # <<<<<<<<<<<<<<
- * Z = int(Z)
- * A = Z
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_AddObjC(__pyx_v_JD, __pyx_float_0_5, 0.5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 416, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 416, __pyx_L1_error)
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_F = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_v_Z = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":417
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z) # <<<<<<<<<<<<<<
- * A = Z
- * B = A + 1524
- */
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_Z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_Z, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":418
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z)
- * A = Z # <<<<<<<<<<<<<<
- * B = A + 1524
- * C = int((B - 122.1) / 365.)
- */
- __Pyx_INCREF(__pyx_v_Z);
- __pyx_v_A = __pyx_v_Z;
-
- /* "netcdftime/_netcdftime.pyx":419
- * Z = int(Z)
- * A = Z
- * B = A + 1524 # <<<<<<<<<<<<<<
- * C = int((B - 122.1) / 365.)
- * D = int(365. * C)
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_A, __pyx_int_1524, 0x5F4, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_B = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":420
- * A = Z
- * B = A + 1524
- * C = int((B - 122.1) / 365.) # <<<<<<<<<<<<<<
- * D = int(365. * C)
- * E = int((B - D) / 30.6001)
- */
- __pyx_t_4 = __Pyx_PyFloat_SubtractObjC(__pyx_v_B, __pyx_float_122_1, 122.1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_365_, 365., 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_C = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":421
- * B = A + 1524
- * C = int((B - 122.1) / 365.)
- * D = int(365. * C) # <<<<<<<<<<<<<<
- * E = int((B - D) / 30.6001)
- *
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_float_365_, __pyx_v_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_D = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":422
- * C = int((B - 122.1) / 365.)
- * D = int(365. * C)
- * E = int((B - D) / 30.6001) # <<<<<<<<<<<<<<
- *
- * # Convert to date
- */
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_3, __pyx_float_30_6001, 30.6001, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_E = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":425
- *
- * # Convert to date
- * day = B - D - int(30.6001 * E) + F # <<<<<<<<<<<<<<
- * nday = B - D - 123
- * if nday <= 305:
- */
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_v_E); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_v_F); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_day = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":426
- * # Convert to date
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123 # <<<<<<<<<<<<<<
- * if nday <= 305:
- * dayofyr = nday + 60
- */
- __pyx_t_7 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_123, 0x7B, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_nday = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":427
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123
- * if nday <= 305: # <<<<<<<<<<<<<<
- * dayofyr = nday + 60
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_nday, __pyx_int_305, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":428
- * nday = B - D - 123
- * if nday <= 305:
- * dayofyr = nday + 60 # <<<<<<<<<<<<<<
- * else:
- * dayofyr = nday - 305
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_nday, __pyx_int_60, 60, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_dayofyr = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":427
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123
- * if nday <= 305: # <<<<<<<<<<<<<<
- * dayofyr = nday + 60
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "netcdftime/_netcdftime.pyx":430
- * dayofyr = nday + 60
- * else:
- * dayofyr = nday - 305 # <<<<<<<<<<<<<<
- * if E < 14:
- * month = E - 1
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_nday, __pyx_int_305, 0x131, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_dayofyr = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L6:;
-
- /* "netcdftime/_netcdftime.pyx":431
- * else:
- * dayofyr = nday - 305
- * if E < 14: # <<<<<<<<<<<<<<
- * month = E - 1
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_E, __pyx_int_14, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":432
- * dayofyr = nday - 305
- * if E < 14:
- * month = E - 1 # <<<<<<<<<<<<<<
- * else:
- * month = E - 13
- */
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_E, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_month = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":431
- * else:
- * dayofyr = nday - 305
- * if E < 14: # <<<<<<<<<<<<<<
- * month = E - 1
- * else:
- */
- goto __pyx_L7;
- }
-
- /* "netcdftime/_netcdftime.pyx":434
- * month = E - 1
- * else:
- * month = E - 13 # <<<<<<<<<<<<<<
- *
- * if month > 2:
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_E, __pyx_int_13, 13, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_month = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L7:;
-
- /* "netcdftime/_netcdftime.pyx":436
- * month = E - 13
- *
- * if month > 2: # <<<<<<<<<<<<<<
- * year = C - 4716
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 436, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":437
- *
- * if month > 2:
- * year = C - 4716 # <<<<<<<<<<<<<<
- * else:
- * year = C - 4715
- */
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_C, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_year = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":436
- * month = E - 13
- *
- * if month > 2: # <<<<<<<<<<<<<<
- * year = C - 4716
- * else:
- */
- goto __pyx_L8;
- }
-
- /* "netcdftime/_netcdftime.pyx":439
- * year = C - 4716
- * else:
- * year = C - 4715 # <<<<<<<<<<<<<<
- *
- * # Convert fractions of a day to time
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_C, __pyx_int_4715, 0x126B, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_year = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L8:;
-
- /* "netcdftime/_netcdftime.pyx":442
- *
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0) # <<<<<<<<<<<<<<
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyFloat_DivideObjC(__pyx_v_day, __pyx_float_1_0, 1.0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 442, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L10_unpacking_done;
- __pyx_L9_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 442, __pyx_L1_error)
- __pyx_L10_unpacking_done:;
- }
- __pyx_v_dfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_days = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":443
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0) # <<<<<<<<<<<<<<
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Multiply(__pyx_v_dfrac, __pyx_float_24_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __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;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 443, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L12_unpacking_done;
- __pyx_L11_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 443, __pyx_L1_error)
- __pyx_L12_unpacking_done:;
- }
- __pyx_v_hfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_hours = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":444
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0) # <<<<<<<<<<<<<<
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Multiply(__pyx_v_hfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __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_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __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;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 444, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L13_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 444, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L14_unpacking_done;
- __pyx_L13_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 444, __pyx_L1_error)
- __pyx_L14_unpacking_done:;
- }
- __pyx_v_mfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_minutes = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":445
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0) # <<<<<<<<<<<<<<
- * microseconds = sfrac*1.e6
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_v_mfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 445, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L15_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L16_unpacking_done;
- __pyx_L15_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 445, __pyx_L1_error)
- __pyx_L16_unpacking_done:;
- }
- __pyx_v_sfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_seconds = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":446
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6 # <<<<<<<<<<<<<<
- *
- * if year_offset > 0:
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_sfrac, __pyx_float_1_e6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_microseconds = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":448
- * microseconds = sfrac*1.e6
- *
- * if year_offset > 0: # <<<<<<<<<<<<<<
- * # correct dayofwk
- *
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_year_offset, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 448, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":453
- * # 365 mod 7 = 1, so the day of the week changes by one day for
- * # every year in year_offset
- * dayofwk -= int(math.fmod(year_offset, 7)) # <<<<<<<<<<<<<<
- *
- * if dayofwk < 0:
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fmod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_year_offset, __pyx_int_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_year_offset, __pyx_int_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 453, __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_year_offset);
- __Pyx_GIVEREF(__pyx_v_year_offset);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_year_offset);
- __Pyx_INCREF(__pyx_int_7);
- __Pyx_GIVEREF(__pyx_int_7);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_7);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __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_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_dayofwk, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_dayofwk, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":455
- * dayofwk -= int(math.fmod(year_offset, 7))
- *
- * if dayofwk < 0: # <<<<<<<<<<<<<<
- * dayofwk += 7
- *
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_dayofwk, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":456
- *
- * if dayofwk < 0:
- * dayofwk += 7 # <<<<<<<<<<<<<<
- *
- * return DatetimeNoLeap(year - year_offset, month, int(days), int(hours), int(minutes),
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_dayofwk, __pyx_int_7, 7, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_dayofwk, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":455
- * dayofwk -= int(math.fmod(year_offset, 7))
- *
- * if dayofwk < 0: # <<<<<<<<<<<<<<
- * dayofwk += 7
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":448
- * microseconds = sfrac*1.e6
- *
- * if year_offset > 0: # <<<<<<<<<<<<<<
- * # correct dayofwk
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":458
- * dayofwk += 7
- *
- * return DatetimeNoLeap(year - year_offset, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds),dayofwk, dayofyr)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_year, __pyx_v_year_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_hours); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_minutes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netcdftime/_netcdftime.pyx":459
- *
- * return DatetimeNoLeap(year - year_offset, month, int(days), int(hours), int(minutes),
- * int(seconds), int(microseconds),dayofwk, dayofyr) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_v_microseconds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 459, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
-
- /* "netcdftime/_netcdftime.pyx":458
- * dayofwk += 7
- *
- * return DatetimeNoLeap(year - year_offset, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds),dayofwk, dayofyr)
- *
- */
- __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
- __Pyx_INCREF(__pyx_v_month);
- __Pyx_GIVEREF(__pyx_v_month);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_month);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9);
- __Pyx_INCREF(__pyx_v_dayofwk);
- __Pyx_GIVEREF(__pyx_v_dayofwk);
- PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_v_dayofwk);
- __Pyx_INCREF(__pyx_v_dayofyr);
- __Pyx_GIVEREF(__pyx_v_dayofyr);
- PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_v_dayofyr);
- __pyx_t_4 = 0;
- __pyx_t_3 = 0;
- __pyx_t_7 = 0;
- __pyx_t_5 = 0;
- __pyx_t_1 = 0;
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeNoLeap), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_r = __pyx_t_9;
- __pyx_t_9 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":399
- *
- *
- * cdef _DateFromNoLeapDay(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* 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_7);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("netcdftime._netcdftime._DateFromNoLeapDay", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_year_offset);
- __Pyx_XDECREF(__pyx_v_dayofwk);
- __Pyx_XDECREF(__pyx_v_F);
- __Pyx_XDECREF(__pyx_v_Z);
- __Pyx_XDECREF(__pyx_v_A);
- __Pyx_XDECREF(__pyx_v_B);
- __Pyx_XDECREF(__pyx_v_C);
- __Pyx_XDECREF(__pyx_v_D);
- __Pyx_XDECREF(__pyx_v_E);
- __Pyx_XDECREF(__pyx_v_day);
- __Pyx_XDECREF(__pyx_v_nday);
- __Pyx_XDECREF(__pyx_v_dayofyr);
- __Pyx_XDECREF(__pyx_v_month);
- __Pyx_XDECREF(__pyx_v_year);
- __Pyx_XDECREF(__pyx_v_dfrac);
- __Pyx_XDECREF(__pyx_v_days);
- __Pyx_XDECREF(__pyx_v_hfrac);
- __Pyx_XDECREF(__pyx_v_hours);
- __Pyx_XDECREF(__pyx_v_mfrac);
- __Pyx_XDECREF(__pyx_v_minutes);
- __Pyx_XDECREF(__pyx_v_sfrac);
- __Pyx_XDECREF(__pyx_v_seconds);
- __Pyx_XDECREF(__pyx_v_microseconds);
- __Pyx_XDECREF(__pyx_v_JD);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":462
- *
- *
- * cdef _DateFromAllLeap(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFromAllLeap(PyObject *__pyx_v_JD) {
- PyObject *__pyx_v_dayofwk = NULL;
- PyObject *__pyx_v_F = NULL;
- PyObject *__pyx_v_Z = NULL;
- PyObject *__pyx_v_A = NULL;
- PyObject *__pyx_v_B = NULL;
- PyObject *__pyx_v_C = NULL;
- PyObject *__pyx_v_D = NULL;
- PyObject *__pyx_v_E = NULL;
- PyObject *__pyx_v_day = NULL;
- PyObject *__pyx_v_nday = NULL;
- PyObject *__pyx_v_dayofyr = NULL;
- PyObject *__pyx_v_month = NULL;
- PyObject *__pyx_v_year = NULL;
- PyObject *__pyx_v_dfrac = NULL;
- PyObject *__pyx_v_days = NULL;
- PyObject *__pyx_v_hfrac = NULL;
- PyObject *__pyx_v_hours = NULL;
- PyObject *__pyx_v_mfrac = NULL;
- PyObject *__pyx_v_minutes = NULL;
- PyObject *__pyx_v_sfrac = NULL;
- PyObject *__pyx_v_seconds = NULL;
- PyObject *__pyx_v_microseconds = 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;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- __Pyx_RefNannySetupContext("_DateFromAllLeap", 0);
-
- /* "netcdftime/_netcdftime.pyx":473
- * # based on redate.py by David Finlayson.
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * raise ValueError('Julian Day must be positive')
- *
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_JD, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":474
- *
- * if JD < 0:
- * raise ValueError('Julian Day must be positive') # <<<<<<<<<<<<<<
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __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_ERR(0, 474, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":473
- * # based on redate.py by David Finlayson.
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * raise ValueError('Julian Day must be positive')
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":476
- * raise ValueError('Julian Day must be positive')
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7)) # <<<<<<<<<<<<<<
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyFloat_AddObjC(__pyx_v_JD, __pyx_float_1_5, 1.5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_int_7};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_int_7};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
- __Pyx_INCREF(__pyx_int_7);
- __Pyx_GIVEREF(__pyx_int_7);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_7);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __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_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_dayofwk = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":477
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- * (F, Z) = math.modf(JD + 0.5) # <<<<<<<<<<<<<<
- * Z = int(Z)
- * A = Z
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_AddObjC(__pyx_v_JD, __pyx_float_0_5, 0.5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 477, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 477, __pyx_L1_error)
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_F = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_v_Z = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":478
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z) # <<<<<<<<<<<<<<
- * A = Z
- * B = A + 1524
- */
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_Z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_Z, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":479
- * (F, Z) = math.modf(JD + 0.5)
- * Z = int(Z)
- * A = Z # <<<<<<<<<<<<<<
- * B = A + 1524
- * C = int((B - 122.1) / 366.)
- */
- __Pyx_INCREF(__pyx_v_Z);
- __pyx_v_A = __pyx_v_Z;
-
- /* "netcdftime/_netcdftime.pyx":480
- * Z = int(Z)
- * A = Z
- * B = A + 1524 # <<<<<<<<<<<<<<
- * C = int((B - 122.1) / 366.)
- * D = int(366. * C)
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_A, __pyx_int_1524, 0x5F4, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_B = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":481
- * A = Z
- * B = A + 1524
- * C = int((B - 122.1) / 366.) # <<<<<<<<<<<<<<
- * D = int(366. * C)
- * E = int((B - D) / 30.6001)
- */
- __pyx_t_4 = __Pyx_PyFloat_SubtractObjC(__pyx_v_B, __pyx_float_122_1, 122.1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_366_, 366., 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_C = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":482
- * B = A + 1524
- * C = int((B - 122.1) / 366.)
- * D = int(366. * C) # <<<<<<<<<<<<<<
- * E = int((B - D) / 30.6001)
- *
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_float_366_, __pyx_v_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_D = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":483
- * C = int((B - 122.1) / 366.)
- * D = int(366. * C)
- * E = int((B - D) / 30.6001) # <<<<<<<<<<<<<<
- *
- * # Convert to date
- */
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_3, __pyx_float_30_6001, 30.6001, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_E = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":486
- *
- * # Convert to date
- * day = B - D - int(30.6001 * E) + F # <<<<<<<<<<<<<<
- * nday = B - D - 123
- * if nday <= 305:
- */
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Multiply(__pyx_float_30_6001, __pyx_v_E); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_v_F); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_day = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":487
- * # Convert to date
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123 # <<<<<<<<<<<<<<
- * if nday <= 305:
- * dayofyr = nday + 60
- */
- __pyx_t_7 = PyNumber_Subtract(__pyx_v_B, __pyx_v_D); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_123, 0x7B, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_nday = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":488
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123
- * if nday <= 305: # <<<<<<<<<<<<<<
- * dayofyr = nday + 60
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_nday, __pyx_int_305, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":489
- * nday = B - D - 123
- * if nday <= 305:
- * dayofyr = nday + 60 # <<<<<<<<<<<<<<
- * else:
- * dayofyr = nday - 305
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_nday, __pyx_int_60, 60, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_dayofyr = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":488
- * day = B - D - int(30.6001 * E) + F
- * nday = B - D - 123
- * if nday <= 305: # <<<<<<<<<<<<<<
- * dayofyr = nday + 60
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "netcdftime/_netcdftime.pyx":491
- * dayofyr = nday + 60
- * else:
- * dayofyr = nday - 305 # <<<<<<<<<<<<<<
- * if E < 14:
- * month = E - 1
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_nday, __pyx_int_305, 0x131, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_dayofyr = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L6:;
-
- /* "netcdftime/_netcdftime.pyx":492
- * else:
- * dayofyr = nday - 305
- * if E < 14: # <<<<<<<<<<<<<<
- * month = E - 1
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_E, __pyx_int_14, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":493
- * dayofyr = nday - 305
- * if E < 14:
- * month = E - 1 # <<<<<<<<<<<<<<
- * else:
- * month = E - 13
- */
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_E, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_month = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":492
- * else:
- * dayofyr = nday - 305
- * if E < 14: # <<<<<<<<<<<<<<
- * month = E - 1
- * else:
- */
- goto __pyx_L7;
- }
-
- /* "netcdftime/_netcdftime.pyx":495
- * month = E - 1
- * else:
- * month = E - 13 # <<<<<<<<<<<<<<
- * if month > 2:
- * dayofyr = dayofyr + 1
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_E, __pyx_int_13, 13, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_month = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L7:;
-
- /* "netcdftime/_netcdftime.pyx":496
- * else:
- * month = E - 13
- * if month > 2: # <<<<<<<<<<<<<<
- * dayofyr = dayofyr + 1
- *
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 496, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":497
- * month = E - 13
- * if month > 2:
- * dayofyr = dayofyr + 1 # <<<<<<<<<<<<<<
- *
- * if month > 2:
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_dayofyr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_dayofyr, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":496
- * else:
- * month = E - 13
- * if month > 2: # <<<<<<<<<<<<<<
- * dayofyr = dayofyr + 1
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":499
- * dayofyr = dayofyr + 1
- *
- * if month > 2: # <<<<<<<<<<<<<<
- * year = C - 4716
- * else:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 499, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":500
- *
- * if month > 2:
- * year = C - 4716 # <<<<<<<<<<<<<<
- * else:
- * year = C - 4715
- */
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_C, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_year = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":499
- * dayofyr = dayofyr + 1
- *
- * if month > 2: # <<<<<<<<<<<<<<
- * year = C - 4716
- * else:
- */
- goto __pyx_L9;
- }
-
- /* "netcdftime/_netcdftime.pyx":502
- * year = C - 4716
- * else:
- * year = C - 4715 # <<<<<<<<<<<<<<
- *
- * # Convert fractions of a day to time
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_C, __pyx_int_4715, 0x126B, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_year = __pyx_t_4;
- __pyx_t_4 = 0;
- }
- __pyx_L9:;
-
- /* "netcdftime/_netcdftime.pyx":505
- *
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0) # <<<<<<<<<<<<<<
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyFloat_DivideObjC(__pyx_v_day, __pyx_float_1_0, 1.0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 505, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L11_unpacking_done;
- __pyx_L10_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 505, __pyx_L1_error)
- __pyx_L11_unpacking_done:;
- }
- __pyx_v_dfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_days = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":506
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0) # <<<<<<<<<<<<<<
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Multiply(__pyx_v_dfrac, __pyx_float_24_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __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;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 506, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L13_unpacking_done;
- __pyx_L12_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 506, __pyx_L1_error)
- __pyx_L13_unpacking_done:;
- }
- __pyx_v_hfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_hours = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":507
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0) # <<<<<<<<<<<<<<
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Multiply(__pyx_v_hfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __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_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __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;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 507, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L15_unpacking_done;
- __pyx_L14_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 507, __pyx_L1_error)
- __pyx_L15_unpacking_done:;
- }
- __pyx_v_mfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_minutes = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":508
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0) # <<<<<<<<<<<<<<
- * microseconds = sfrac*1.e6
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_v_mfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
- PyObject* sequence = __pyx_t_4;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 508, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L16_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 508, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L17_unpacking_done;
- __pyx_L16_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 508, __pyx_L1_error)
- __pyx_L17_unpacking_done:;
- }
- __pyx_v_sfrac = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_seconds = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":509
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6 # <<<<<<<<<<<<<<
- *
- * return DatetimeAllLeap(year, month, int(days), int(hours), int(minutes),
- */
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_sfrac, __pyx_float_1_e6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_microseconds = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":511
- * microseconds = sfrac*1.e6
- *
- * return DatetimeAllLeap(year, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds),dayofwk, dayofyr)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_days); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_hours); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_minutes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netcdftime/_netcdftime.pyx":512
- *
- * return DatetimeAllLeap(year, month, int(days), int(hours), int(minutes),
- * int(seconds), int(microseconds),dayofwk, dayofyr) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_seconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":511
- * microseconds = sfrac*1.e6
- *
- * return DatetimeAllLeap(year, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds),dayofwk, dayofyr)
- *
- */
- __pyx_t_9 = PyTuple_New(9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_v_year);
- __Pyx_GIVEREF(__pyx_v_year);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_year);
- __Pyx_INCREF(__pyx_v_month);
- __Pyx_GIVEREF(__pyx_v_month);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_month);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_dayofwk);
- __Pyx_GIVEREF(__pyx_v_dayofwk);
- PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_v_dayofwk);
- __Pyx_INCREF(__pyx_v_dayofyr);
- __Pyx_GIVEREF(__pyx_v_dayofyr);
- PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_v_dayofyr);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_3 = 0;
- __pyx_t_7 = 0;
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeAllLeap), __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":462
- *
- *
- * cdef _DateFromAllLeap(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* 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_7);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("netcdftime._netcdftime._DateFromAllLeap", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_dayofwk);
- __Pyx_XDECREF(__pyx_v_F);
- __Pyx_XDECREF(__pyx_v_Z);
- __Pyx_XDECREF(__pyx_v_A);
- __Pyx_XDECREF(__pyx_v_B);
- __Pyx_XDECREF(__pyx_v_C);
- __Pyx_XDECREF(__pyx_v_D);
- __Pyx_XDECREF(__pyx_v_E);
- __Pyx_XDECREF(__pyx_v_day);
- __Pyx_XDECREF(__pyx_v_nday);
- __Pyx_XDECREF(__pyx_v_dayofyr);
- __Pyx_XDECREF(__pyx_v_month);
- __Pyx_XDECREF(__pyx_v_year);
- __Pyx_XDECREF(__pyx_v_dfrac);
- __Pyx_XDECREF(__pyx_v_days);
- __Pyx_XDECREF(__pyx_v_hfrac);
- __Pyx_XDECREF(__pyx_v_hours);
- __Pyx_XDECREF(__pyx_v_mfrac);
- __Pyx_XDECREF(__pyx_v_minutes);
- __Pyx_XDECREF(__pyx_v_sfrac);
- __Pyx_XDECREF(__pyx_v_seconds);
- __Pyx_XDECREF(__pyx_v_microseconds);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":515
- *
- *
- * cdef _DateFrom360Day(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__DateFrom360Day(PyObject *__pyx_v_JD) {
- PyObject *__pyx_v_year_offset = NULL;
- PyObject *__pyx_v_F = NULL;
- PyObject *__pyx_v_Z = NULL;
- PyObject *__pyx_v_year = NULL;
- PyObject *__pyx_v_dayofyr = NULL;
- PyObject *__pyx_v_month = NULL;
- PyObject *__pyx_v_day = NULL;
- PyObject *__pyx_v_dfrac = NULL;
- PyObject *__pyx_v_days = NULL;
- PyObject *__pyx_v_hfrac = NULL;
- PyObject *__pyx_v_hours = NULL;
- PyObject *__pyx_v_mfrac = NULL;
- PyObject *__pyx_v_minutes = NULL;
- PyObject *__pyx_v_sfrac = NULL;
- PyObject *__pyx_v_seconds = NULL;
- PyObject *__pyx_v_microseconds = 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;
- PyObject *__pyx_t_5 = NULL;
- PyObject *(*__pyx_t_6)(PyObject *);
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- __Pyx_RefNannySetupContext("_DateFrom360Day", 0);
- __Pyx_INCREF(__pyx_v_JD);
-
- /* "netcdftime/_netcdftime.pyx":524
- * """
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * year_offset = int(-JD) // 360 + 1
- * JD += year_offset * 360
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_JD, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":525
- *
- * if JD < 0:
- * year_offset = int(-JD) // 360 + 1 # <<<<<<<<<<<<<<
- * JD += year_offset * 360
- * else:
- */
- __pyx_t_1 = PyNumber_Negative(__pyx_v_JD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_3, __pyx_int_360, 0x168, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_year_offset = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":526
- * if JD < 0:
- * year_offset = int(-JD) // 360 + 1
- * JD += year_offset * 360 # <<<<<<<<<<<<<<
- * else:
- * year_offset = 0
- */
- __pyx_t_3 = PyNumber_Multiply(__pyx_v_year_offset, __pyx_int_360); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_JD, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_JD, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":524
- * """
- *
- * if JD < 0: # <<<<<<<<<<<<<<
- * year_offset = int(-JD) // 360 + 1
- * JD += year_offset * 360
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":528
- * JD += year_offset * 360
- * else:
- * year_offset = 0 # <<<<<<<<<<<<<<
- *
- * #jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day
- */
- /*else*/ {
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_year_offset = __pyx_int_0;
- }
- __pyx_L3:;
-
- /* "netcdftime/_netcdftime.pyx":531
- *
- * #jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day
- * (F, Z) = math.modf(JD) # <<<<<<<<<<<<<<
- * year = int((Z - 0.5) / 360.) - 4716
- * dayofyr = Z - (year + 4716) * 360
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_modf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_JD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_JD};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_JD};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __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_JD);
- __Pyx_GIVEREF(__pyx_v_JD);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_JD);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __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(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 531, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #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_ERR(0, 531, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 531, __pyx_L1_error)
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_F = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_Z = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":532
- * #jd = int(360. * (year + 4716)) + int(30. * (month - 1)) + day
- * (F, Z) = math.modf(JD)
- * year = int((Z - 0.5) / 360.) - 4716 # <<<<<<<<<<<<<<
- * dayofyr = Z - (year + 4716) * 360
- * month = int((dayofyr - 0.5) / 30) + 1
- */
- __pyx_t_1 = __Pyx_PyFloat_SubtractObjC(__pyx_v_Z, __pyx_float_0_5, 0.5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_360_, 360., 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_year = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":533
- * (F, Z) = math.modf(JD)
- * year = int((Z - 0.5) / 360.) - 4716
- * dayofyr = Z - (year + 4716) * 360 # <<<<<<<<<<<<<<
- * month = int((dayofyr - 0.5) / 30) + 1
- * day = dayofyr - (month - 1) * 30 + F
- */
- __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_4716, 0x126C, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_int_360); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_Z, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_dayofyr = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":534
- * year = int((Z - 0.5) / 360.) - 4716
- * dayofyr = Z - (year + 4716) * 360
- * month = int((dayofyr - 0.5) / 30) + 1 # <<<<<<<<<<<<<<
- * day = dayofyr - (month - 1) * 30 + F
- *
- */
- __pyx_t_5 = __Pyx_PyFloat_SubtractObjC(__pyx_v_dayofyr, __pyx_float_0_5, 0.5, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_30); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_month = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":535
- * dayofyr = Z - (year + 4716) * 360
- * month = int((dayofyr - 0.5) / 30) + 1
- * day = dayofyr - (month - 1) * 30 + F # <<<<<<<<<<<<<<
- *
- * # Convert fractions of a day to time
- */
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_month, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_int_30); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_dayofyr, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_F); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_day = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":538
- *
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0) # <<<<<<<<<<<<<<
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_day, __pyx_float_1_0, 1.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 538, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- 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_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L7_unpacking_done;
- __pyx_L6_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 538, __pyx_L1_error)
- __pyx_L7_unpacking_done:;
- }
- __pyx_v_dfrac = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_days = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":539
- * # Convert fractions of a day to time
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0) # <<<<<<<<<<<<<<
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Multiply(__pyx_v_dfrac, __pyx_float_24_0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __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 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 539, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L9_unpacking_done;
- __pyx_L8_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 539, __pyx_L1_error)
- __pyx_L9_unpacking_done:;
- }
- __pyx_v_hfrac = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_hours = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":540
- * (dfrac, days) = math.modf(day / 1.0)
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0) # <<<<<<<<<<<<<<
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_modf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Multiply(__pyx_v_hfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __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_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __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;
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 540, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_1);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L11_unpacking_done;
- __pyx_L10_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 540, __pyx_L1_error)
- __pyx_L11_unpacking_done:;
- }
- __pyx_v_mfrac = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_minutes = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":541
- * (hfrac, hours) = math.modf(dfrac * 24.0)
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0) # <<<<<<<<<<<<<<
- * microseconds = sfrac*1.e6
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Multiply(__pyx_v_mfrac, __pyx_float_60_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 541, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- 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_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L13_unpacking_done;
- __pyx_L12_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 541, __pyx_L1_error)
- __pyx_L13_unpacking_done:;
- }
- __pyx_v_sfrac = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_seconds = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":542
- * (mfrac, minutes) = math.modf(hfrac * 60.0)
- * (sfrac, seconds) = math.modf(mfrac * 60.0)
- * microseconds = sfrac*1.e6 # <<<<<<<<<<<<<<
- *
- * return Datetime360Day(year - year_offset, month, int(days), int(hours), int(minutes),
- */
- __pyx_t_5 = PyNumber_Multiply(__pyx_v_sfrac, __pyx_float_1_e6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_microseconds = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":544
- * microseconds = sfrac*1.e6
- *
- * return Datetime360Day(year - year_offset, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds), -1, dayofyr)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_year, __pyx_v_year_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_days); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_hours); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_minutes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":545
- *
- * return Datetime360Day(year - year_offset, month, int(days), int(hours), int(minutes),
- * int(seconds), int(microseconds), -1, dayofyr) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_microseconds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netcdftime/_netcdftime.pyx":544
- * microseconds = sfrac*1.e6
- *
- * return Datetime360Day(year - year_offset, month, int(days), int(hours), int(minutes), # <<<<<<<<<<<<<<
- * int(seconds), int(microseconds), -1, dayofyr)
- *
- */
- __pyx_t_9 = PyTuple_New(9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
- __Pyx_INCREF(__pyx_v_month);
- __Pyx_GIVEREF(__pyx_v_month);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_month);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_v_dayofyr);
- __Pyx_GIVEREF(__pyx_v_dayofyr);
- PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_v_dayofyr);
- __pyx_t_5 = 0;
- __pyx_t_7 = 0;
- __pyx_t_4 = 0;
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_Datetime360Day), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":515
- *
- *
- * cdef _DateFrom360Day(JD): # <<<<<<<<<<<<<<
- * """
- *
- */
-
- /* 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_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("netcdftime._netcdftime._DateFrom360Day", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_year_offset);
- __Pyx_XDECREF(__pyx_v_F);
- __Pyx_XDECREF(__pyx_v_Z);
- __Pyx_XDECREF(__pyx_v_year);
- __Pyx_XDECREF(__pyx_v_dayofyr);
- __Pyx_XDECREF(__pyx_v_month);
- __Pyx_XDECREF(__pyx_v_day);
- __Pyx_XDECREF(__pyx_v_dfrac);
- __Pyx_XDECREF(__pyx_v_days);
- __Pyx_XDECREF(__pyx_v_hfrac);
- __Pyx_XDECREF(__pyx_v_hours);
- __Pyx_XDECREF(__pyx_v_mfrac);
- __Pyx_XDECREF(__pyx_v_minutes);
- __Pyx_XDECREF(__pyx_v_sfrac);
- __Pyx_XDECREF(__pyx_v_seconds);
- __Pyx_XDECREF(__pyx_v_microseconds);
- __Pyx_XDECREF(__pyx_v_JD);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":548
- *
- *
- * cdef _dateparse(timestr): # <<<<<<<<<<<<<<
- * """parse a string of the form time-units since yyyy-mm-dd hh:mm:ss
- * return a tuple (units,utc_offset, datetimeinstance)"""
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__dateparse(PyObject *__pyx_v_timestr) {
- PyObject *__pyx_v_timestr_split = NULL;
- PyObject *__pyx_v_units = NULL;
- PyObject *__pyx_v_n = 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_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- 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 = NULL;
- PyObject *(*__pyx_t_12)(PyObject *);
- __Pyx_RefNannySetupContext("_dateparse", 0);
-
- /* "netcdftime/_netcdftime.pyx":551
- * """parse a string of the form time-units since yyyy-mm-dd hh:mm:ss
- * return a tuple (units,utc_offset, datetimeinstance)"""
- * timestr_split = timestr.split() # <<<<<<<<<<<<<<
- * units = timestr_split[0].lower()
- * if units not in _units:
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timestr, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 551, __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_ERR(0, 551, __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;
-
- /* "netcdftime/_netcdftime.pyx":552
- * return a tuple (units,utc_offset, datetimeinstance)"""
- * timestr_split = timestr.split()
- * units = timestr_split[0].lower() # <<<<<<<<<<<<<<
- * if units not in _units:
- * raise ValueError(
- */
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_timestr_split, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __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_ERR(0, 552, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 552, __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_ERR(0, 552, __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;
-
- /* "netcdftime/_netcdftime.pyx":553
- * timestr_split = timestr.split()
- * units = timestr_split[0].lower()
- * if units not in _units: # <<<<<<<<<<<<<<
- * raise ValueError(
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_units, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = (__pyx_t_4 != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":555
- * if units not in _units:
- * raise ValueError(
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units) # <<<<<<<<<<<<<<
- * if timestr_split[1].lower() != 'since':
- * raise ValueError("no 'since' in unit_string")
- */
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_units_must_be_one_of_seconds_min, __pyx_v_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":554
- * units = timestr_split[0].lower()
- * if units not in _units:
- * raise ValueError( # <<<<<<<<<<<<<<
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- * if timestr_split[1].lower() != 'since':
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 554, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":553
- * timestr_split = timestr.split()
- * units = timestr_split[0].lower()
- * if units not in _units: # <<<<<<<<<<<<<<
- * raise ValueError(
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":556
- * raise ValueError(
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- * 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)) __PYX_ERR(0, 556, __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_ERR(0, 556, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 556, __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_ERR(0, 556, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_since, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 556, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":557
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- * 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__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __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_ERR(0, 557, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":556
- * raise ValueError(
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- * if timestr_split[1].lower() != 'since': # <<<<<<<<<<<<<<
- * raise ValueError("no 'since' in unit_string")
- * # parse the date string.
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":559
- * raise ValueError("no 'since' in unit_string")
- * # parse the date string.
- * n = timestr.find('since') + 6 # <<<<<<<<<<<<<<
- * year, month, day, hour, minute, second, utc_offset = _parse_date(
- * timestr[n:].strip())
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timestr, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __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_ERR(0, 559, __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;
-
- /* "netcdftime/_netcdftime.pyx":561
- * n = timestr.find('since') + 6
- * year, month, day, hour, minute, second, utc_offset = _parse_date(
- * timestr[n:].strip()) # <<<<<<<<<<<<<<
- * return units, utc_offset, datetime(year, month, day, hour, minute, second)
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_timestr, 0, 0, &__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 561, __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_ERR(0, 561, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":560
- * # parse the date string.
- * n = timestr.find('since') + 6
- * year, month, day, hour, minute, second, utc_offset = _parse_date( # <<<<<<<<<<<<<<
- * timestr[n:].strip())
- * return units, utc_offset, datetime(year, month, day, hour, minute, second)
- */
- __pyx_t_3 = __pyx_f_10netcdftime_11_netcdftime__parse_date(__pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 560, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5);
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6);
- } else {
- __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 3);
- __pyx_t_8 = PyList_GET_ITEM(sequence, 4);
- __pyx_t_9 = PyList_GET_ITEM(sequence, 5);
- __pyx_t_10 = PyList_GET_ITEM(sequence, 6);
- }
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_10);
- #else
- {
- Py_ssize_t i;
- PyObject** temps[7] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
- for (i=0; i < 7; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 560, __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[7] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
- __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 560, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
- for (index=0; index < 7; index++) {
- PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(item);
- *(temps[index]) = item;
- }
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 7) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
- __pyx_t_12 = NULL;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- goto __pyx_L6_unpacking_done;
- __pyx_L5_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_12 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 560, __pyx_L1_error)
- __pyx_L6_unpacking_done:;
- }
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
- __pyx_v_month = __pyx_t_2;
- __pyx_t_2 = 0;
- __pyx_v_day = __pyx_t_6;
- __pyx_t_6 = 0;
- __pyx_v_hour = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_v_minute = __pyx_t_8;
- __pyx_t_8 = 0;
- __pyx_v_second = __pyx_t_9;
- __pyx_t_9 = 0;
- __pyx_v_utc_offset = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "netcdftime/_netcdftime.pyx":562
- * year, month, day, hour, minute, second, utc_offset = _parse_date(
- * timestr[n:].strip())
- * return units, utc_offset, datetime(year, month, day, hour, minute, second) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_year);
- __Pyx_GIVEREF(__pyx_v_year);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_year);
- __Pyx_INCREF(__pyx_v_month);
- __Pyx_GIVEREF(__pyx_v_month);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_month);
- __Pyx_INCREF(__pyx_v_day);
- __Pyx_GIVEREF(__pyx_v_day);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_day);
- __Pyx_INCREF(__pyx_v_hour);
- __Pyx_GIVEREF(__pyx_v_hour);
- PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_hour);
- __Pyx_INCREF(__pyx_v_minute);
- __Pyx_GIVEREF(__pyx_v_minute);
- PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_minute);
- __Pyx_INCREF(__pyx_v_second);
- __Pyx_GIVEREF(__pyx_v_second);
- PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_second);
- __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 562, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_units);
- __Pyx_GIVEREF(__pyx_v_units);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_units);
- __Pyx_INCREF(__pyx_v_utc_offset);
- __Pyx_GIVEREF(__pyx_v_utc_offset);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_utc_offset);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":548
- *
- *
- * cdef _dateparse(timestr): # <<<<<<<<<<<<<<
- * """parse a string of the form time-units since yyyy-mm-dd hh:mm:ss
- * return a tuple (units,utc_offset, datetimeinstance)"""
- */
-
- /* 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_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("netcdftime._netcdftime._dateparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_timestr_split);
- __Pyx_XDECREF(__pyx_v_units);
- __Pyx_XDECREF(__pyx_v_n);
- __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_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":666
- * """
- *
- * def __init__(self, unit_string, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * @param unit_string: a string of the form
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_5utime___init__[] = "\n at param unit_string: a string of the form\nC{'time-units since <time-origin>'} defining the time units.\n\nValid time-units are days, hours, minutes and seconds (the singular forms\nare also accepted). An example unit_string would be C{'hours\nsince 0001-01-01 00:00:00'}.\n\n at keyword calendar: describes the calendar used in the time calculations.\nAll the values currently defined in the U{CF metadata convention\n<http [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_5utime_1__init__ = {"__init__", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_5utime_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_5utime___init__};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_unit_string = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit_string,&__pyx_n_s_calendar,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)((PyObject*)__pyx_n_s_standard));
- 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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit_string)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 666, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 666, __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_self = values[0];
- __pyx_v_unit_string = values[1];
- __pyx_v_calendar = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_5utime___init__(__pyx_self, __pyx_v_self, __pyx_v_unit_string, __pyx_v_calendar);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit_string, PyObject *__pyx_v_calendar) {
- PyObject *__pyx_v_units = NULL;
- PyObject *__pyx_v_tzoffset = NULL;
- 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;
- int __pyx_t_4;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- int __pyx_t_9;
- __Pyx_RefNannySetupContext("__init__", 0);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netcdftime/_netcdftime.pyx":701
- * units to datetime objects.
- * """
- * calendar = calendar.lower() # <<<<<<<<<<<<<<
- * if calendar in _calendars:
- * self.calendar = calendar
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_calendar, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 701, __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_ERR(0, 701, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":702
- * """
- * calendar = calendar.lower()
- * if calendar in _calendars: # <<<<<<<<<<<<<<
- * self.calendar = calendar
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_calendar, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = (__pyx_t_4 != 0);
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":703
- * calendar = calendar.lower()
- * if calendar in _calendars:
- * self.calendar = calendar # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":702
- * """
- * calendar = calendar.lower()
- * if calendar in _calendars: # <<<<<<<<<<<<<<
- * self.calendar = calendar
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":705
- * self.calendar = calendar
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * "calendar must be one of %s, got '%s'" % (str(_calendars), calendar))
- * units, tzoffset, self.origin = _dateparse(unit_string)
- */
- /*else*/ {
-
- /* "netcdftime/_netcdftime.pyx":706
- * else:
- * raise ValueError(
- * "calendar must be one of %s, got '%s'" % (str(_calendars), calendar)) # <<<<<<<<<<<<<<
- * units, tzoffset, self.origin = _dateparse(unit_string)
- * # real-world calendars limited to positive reference years.
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_calendar);
- __Pyx_GIVEREF(__pyx_v_calendar);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_calendar);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_calendar_must_be_one_of_s_got_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":705
- * self.calendar = calendar
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * "calendar must be one of %s, got '%s'" % (str(_calendars), calendar))
- * units, tzoffset, self.origin = _dateparse(unit_string)
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __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_ERR(0, 705, __pyx_L1_error)
- }
- __pyx_L3:;
-
- /* "netcdftime/_netcdftime.pyx":707
- * raise ValueError(
- * "calendar must be one of %s, got '%s'" % (str(_calendars), calendar))
- * units, tzoffset, self.origin = _dateparse(unit_string) # <<<<<<<<<<<<<<
- * # real-world calendars limited to positive reference years.
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime__dateparse(__pyx_v_unit_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __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_PYPY
- 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_ERR(0, 707, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
- } else {
- __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 2);
- }
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_6);
- #else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __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_ERR(0, 707, __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_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_2);
- index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 2; __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), 3) < 0) __PYX_ERR(0, 707, __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_ERR(0, 707, __pyx_L1_error)
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_units = __pyx_t_2;
- __pyx_t_2 = 0;
- __pyx_v_tzoffset = __pyx_t_3;
- __pyx_t_3 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_origin, __pyx_t_6) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":709
- * units, tzoffset, self.origin = _dateparse(unit_string)
- * # real-world calendars limited to positive reference years.
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if self.origin.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __pyx_t_5 = __pyx_t_4;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __pyx_t_5 = __pyx_t_4;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __pyx_t_5 = __pyx_t_4;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_4;
- __pyx_L7_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = (__pyx_t_5 != 0);
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":710
- * # real-world calendars limited to positive reference years.
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if self.origin.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 710, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":711
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if self.origin.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * elif self.origin.year < 0:
- */
- __Pyx_INCREF(__pyx_kp_s_zero_not_allowed_as_a_reference);
- __pyx_v_msg = __pyx_kp_s_zero_not_allowed_as_a_reference;
-
- /* "netcdftime/_netcdftime.pyx":712
- * if self.origin.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * elif self.origin.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __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_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 712, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":710
- * # real-world calendars limited to positive reference years.
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if self.origin.year == 0: # <<<<<<<<<<<<<<
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":713
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif self.origin.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 713, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":714
- * raise ValueError(msg)
- * elif self.origin.year < 0:
- * msg='negative reference year in time units, must be >= 1' # <<<<<<<<<<<<<<
- * raise ValueError(msg)
- * self.tzoffset = tzoffset # time zone offset in minutes
- */
- __Pyx_INCREF(__pyx_kp_s_negative_reference_year_in_time);
- __pyx_v_msg = __pyx_kp_s_negative_reference_year_in_time;
-
- /* "netcdftime/_netcdftime.pyx":715
- * elif self.origin.year < 0:
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg) # <<<<<<<<<<<<<<
- * self.tzoffset = tzoffset # time zone offset in minutes
- * self.units = units
- */
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 715, __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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __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_ERR(0, 715, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":713
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- * raise ValueError(msg)
- * elif self.origin.year < 0: # <<<<<<<<<<<<<<
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":709
- * units, tzoffset, self.origin = _dateparse(unit_string)
- * # real-world calendars limited to positive reference years.
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if self.origin.year == 0:
- * msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":716
- * msg='negative reference year in time units, must be >= 1'
- * raise ValueError(msg)
- * self.tzoffset = tzoffset # time zone offset in minutes # <<<<<<<<<<<<<<
- * self.units = units
- * self.unit_string = unit_string
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset, __pyx_v_tzoffset) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":717
- * raise ValueError(msg)
- * self.tzoffset = tzoffset # time zone offset in minutes
- * self.units = units # <<<<<<<<<<<<<<
- * self.unit_string = unit_string
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29:
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_units_2, __pyx_v_units) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":718
- * self.tzoffset = tzoffset # time zone offset in minutes
- * self.units = units
- * self.unit_string = unit_string # <<<<<<<<<<<<<<
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29:
- * raise ValueError(
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_unit_string, __pyx_v_unit_string) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":719
- * self.units = units
- * self.unit_string = unit_string
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_noleap, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_5 = __pyx_t_9;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_365_day, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
- __pyx_t_5 = __pyx_t_9;
- __pyx_L15_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_9 = (__pyx_t_5 != 0);
- if (__pyx_t_9) {
- } else {
- __pyx_t_4 = __pyx_t_9;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_month); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_9) {
- } else {
- __pyx_t_4 = __pyx_t_9;
- goto __pyx_L13_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_29, 29, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __pyx_t_9;
- __pyx_L13_bool_binop_done:;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":720
- * self.unit_string = unit_string
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30:
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __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_ERR(0, 720, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":719
- * self.units = units
- * self.unit_string = unit_string
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":722
- * raise ValueError(
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_360_day, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_9) {
- } else {
- __pyx_t_4 = __pyx_t_9;
- goto __pyx_L19_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_30, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __pyx_t_9;
- __pyx_L19_bool_binop_done:;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":723
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * if self.calendar in ['noleap', '365_day']:
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __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_ERR(0, 723, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":722
- * raise ValueError(
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":725
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- * if self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * self._jd0 = _NoLeapDayFromDate(self.origin)
- * elif self.calendar in ['all_leap', '366_day']:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_noleap, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_4 = __pyx_t_9;
- goto __pyx_L22_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_365_day, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
- __pyx_t_4 = __pyx_t_9;
- __pyx_L22_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_9 = (__pyx_t_4 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":726
- * 'there are only 30 days in every month with the 360_day calendar')
- * if self.calendar in ['noleap', '365_day']:
- * self._jd0 = _NoLeapDayFromDate(self.origin) # <<<<<<<<<<<<<<
- * elif self.calendar in ['all_leap', '366_day']:
- * self._jd0 = _AllLeapFromDate(self.origin)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__NoLeapDayFromDate(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_jd0, __pyx_t_6) < 0) __PYX_ERR(0, 726, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":725
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- * if self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * self._jd0 = _NoLeapDayFromDate(self.origin)
- * elif self.calendar in ['all_leap', '366_day']:
- */
- goto __pyx_L21;
- }
-
- /* "netcdftime/_netcdftime.pyx":727
- * if self.calendar in ['noleap', '365_day']:
- * self._jd0 = _NoLeapDayFromDate(self.origin)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * self._jd0 = _AllLeapFromDate(self.origin)
- * elif self.calendar == '360_day':
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_all_leap, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
- if (!__pyx_t_4) {
- } else {
- __pyx_t_9 = __pyx_t_4;
- goto __pyx_L24_bool_binop_done;
- }
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_kp_s_366_day, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_4;
- __pyx_L24_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = (__pyx_t_9 != 0);
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":728
- * self._jd0 = _NoLeapDayFromDate(self.origin)
- * elif self.calendar in ['all_leap', '366_day']:
- * self._jd0 = _AllLeapFromDate(self.origin) # <<<<<<<<<<<<<<
- * elif self.calendar == '360_day':
- * self._jd0 = _360DayFromDate(self.origin)
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime__AllLeapFromDate(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_jd0, __pyx_t_1) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":727
- * if self.calendar in ['noleap', '365_day']:
- * self._jd0 = _NoLeapDayFromDate(self.origin)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * self._jd0 = _AllLeapFromDate(self.origin)
- * elif self.calendar == '360_day':
- */
- goto __pyx_L21;
- }
-
- /* "netcdftime/_netcdftime.pyx":729
- * elif self.calendar in ['all_leap', '366_day']:
- * self._jd0 = _AllLeapFromDate(self.origin)
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * self._jd0 = _360DayFromDate(self.origin)
- * else:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_360_day, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 729, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":730
- * self._jd0 = _AllLeapFromDate(self.origin)
- * elif self.calendar == '360_day':
- * self._jd0 = _360DayFromDate(self.origin) # <<<<<<<<<<<<<<
- * else:
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__360DayFromDate(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_jd0, __pyx_t_6) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":729
- * elif self.calendar in ['all_leap', '366_day']:
- * self._jd0 = _AllLeapFromDate(self.origin)
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * self._jd0 = _360DayFromDate(self.origin)
- * else:
- */
- goto __pyx_L21;
- }
-
- /* "netcdftime/_netcdftime.pyx":732
- * self._jd0 = _360DayFromDate(self.origin)
- * else:
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar) # <<<<<<<<<<<<<<
- *
- * def date2num(self, date):
- */
- /*else*/ {
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_JulianDayFromDate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_origin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_calendar, __pyx_t_2) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __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;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_jd0, __pyx_t_2) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __pyx_L21:;
-
- /* "netcdftime/_netcdftime.pyx":666
- * """
- *
- * def __init__(self, unit_string, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * @param unit_string: a string of the form
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.utime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_units);
- __Pyx_XDECREF(__pyx_v_tzoffset);
- __Pyx_XDECREF(__pyx_v_msg);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":734
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar)
- *
- * def date2num(self, date): # <<<<<<<<<<<<<<
- * """
- * Returns C{time_value} in units described by L{unit_string}, using
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_3date2num(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_5utime_2date2num[] = "\n Returns C{time_value} in units described by L{unit_string}, using\n the specified L{calendar}, given a 'datetime-like' object.\n\n The datetime object must represent UTC with no time-zone offset.\n If there is a time-zone offset implied by L{unit_string}, it will\n be applied to the returned numeric values.\n\n Resolution is approximately a millisecond.\n\n If C{cale [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_5utime_3date2num = {"date2num", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_5utime_3date2num, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_5utime_2date2num};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_3date2num(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_date = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("date2num (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_date,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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_date)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("date2num", 1, 2, 2, 1); __PYX_ERR(0, 734, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date2num") < 0)) __PYX_ERR(0, 734, __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_self = values[0];
- __pyx_v_date = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("date2num", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 734, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_5utime_2date2num(__pyx_self, __pyx_v_self, __pyx_v_date);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime_2date2num(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_date) {
- int __pyx_v_isscalar;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_jdelta = NULL;
- PyObject *__pyx_v_d = 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 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- int __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- PyObject *(*__pyx_t_14)(PyObject *);
- int __pyx_t_15;
- __Pyx_RefNannySetupContext("date2num", 0);
- __Pyx_INCREF(__pyx_v_date);
-
- /* "netcdftime/_netcdftime.pyx":753
- * Returns a scalar if input is a scalar, else returns a numpy array.
- * """
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * date[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netcdftime/_netcdftime.pyx":754
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":755
- * isscalar = False
- * try:
- * date[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_date, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":754
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":756
- * try:
- * date[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- * if not isscalar:
- */
- /*except:*/ {
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 756, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "netcdftime/_netcdftime.pyx":757
- * date[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = numpy.array(date)
- */
- __pyx_v_isscalar = 1;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L4_exception_handled;
- }
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":754
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * date[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __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_L4_exception_handled:;
- __Pyx_PyThreadState_assign
- __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);
- __pyx_L10_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":758
- * except:
- * isscalar = True
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = numpy.array(date)
- * shape = date.shape
- */
- __pyx_t_7 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":759
- * isscalar = True
- * if not isscalar:
- * date = numpy.array(date) # <<<<<<<<<<<<<<
- * shape = date.shape
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_date); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_date};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_date};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_date);
- __Pyx_GIVEREF(__pyx_v_date);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_date);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":760
- * if not isscalar:
- * date = numpy.array(date)
- * shape = date.shape # <<<<<<<<<<<<<<
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if isscalar:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 760, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_shape = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":758
- * except:
- * isscalar = True
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = numpy.array(date)
- * shape = date.shape
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":761
- * date = numpy.array(date)
- * shape = date.shape
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if isscalar:
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 761, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L15_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
- __pyx_t_7 = __pyx_t_9;
- __pyx_L15_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = (__pyx_t_7 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":762
- * shape = date.shape
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if isscalar: # <<<<<<<<<<<<<<
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0
- * else:
- */
- __pyx_t_9 = (__pyx_v_isscalar != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":763
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if isscalar:
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0 # <<<<<<<<<<<<<<
- * else:
- * jdelta = JulianDayFromDate(
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JulianDayFromDate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = NULL;
- __pyx_t_10 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_10 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_date, __pyx_t_8};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_date, __pyx_t_8};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_5) {
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
- }
- __Pyx_INCREF(__pyx_v_date);
- __Pyx_GIVEREF(__pyx_v_date);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_date);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":762
- * shape = date.shape
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if isscalar: # <<<<<<<<<<<<<<
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0
- * else:
- */
- goto __pyx_L19;
- }
-
- /* "netcdftime/_netcdftime.pyx":766
- * else:
- * jdelta = JulianDayFromDate(
- * date.flat, self.calendar) - self._jd0 # <<<<<<<<<<<<<<
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar:
- */
- /*else*/ {
-
- /* "netcdftime/_netcdftime.pyx":765
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0
- * else:
- * jdelta = JulianDayFromDate( # <<<<<<<<<<<<<<
- * date.flat, self.calendar) - self._jd0
- * elif self.calendar in ['noleap', '365_day']:
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_JulianDayFromDate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "netcdftime/_netcdftime.pyx":766
- * else:
- * jdelta = JulianDayFromDate(
- * date.flat, self.calendar) - self._jd0 # <<<<<<<<<<<<<<
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_flat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = NULL;
- __pyx_t_10 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_10 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_8};
- __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 765, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_8};
- __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 765, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 765, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_5) {
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_10, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_10, __pyx_t_8);
- __pyx_t_6 = 0;
- __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 765, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = PyNumber_Subtract(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_12;
- __pyx_t_12 = 0;
- }
- __pyx_L19:;
-
- /* "netcdftime/_netcdftime.pyx":761
- * date = numpy.array(date)
- * shape = date.shape
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if isscalar:
- * jdelta = JulianDayFromDate(date, self.calendar) - self._jd0
- */
- goto __pyx_L14;
- }
-
- /* "netcdftime/_netcdftime.pyx":767
- * jdelta = JulianDayFromDate(
- * date.flat, self.calendar) - self._jd0
- * elif self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * if isscalar:
- * if date.month == 2 and date.day == 29:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 767, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_12, __pyx_n_s_noleap, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 767, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_9 = __pyx_t_7;
- goto __pyx_L20_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_12, __pyx_kp_s_365_day, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 767, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_7;
- __pyx_L20_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_7 = (__pyx_t_9 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":768
- * date.flat, self.calendar) - self._jd0
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar: # <<<<<<<<<<<<<<
- * if date.month == 2 and date.day == 29:
- * raise ValueError(
- */
- __pyx_t_7 = (__pyx_v_isscalar != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":769
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar:
- * if date.month == 2 and date.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_12, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L24_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_29, 29, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 769, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_7 = __pyx_t_9;
- __pyx_L24_bool_binop_done:;
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":770
- * if isscalar:
- * if date.month == 2 and date.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there is no leap day in the noleap calendar')
- * jdelta = _NoLeapDayFromDate(date) - self._jd0
- */
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 770, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_Raise(__pyx_t_12, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __PYX_ERR(0, 770, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":769
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar:
- * if date.month == 2 and date.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":772
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- * jdelta = _NoLeapDayFromDate(date) - self._jd0 # <<<<<<<<<<<<<<
- * else:
- * jdelta = []
- */
- __pyx_t_12 = __pyx_f_10netcdftime_11_netcdftime__NoLeapDayFromDate(__pyx_v_date); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 772, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyNumber_Subtract(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 772, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":768
- * date.flat, self.calendar) - self._jd0
- * elif self.calendar in ['noleap', '365_day']:
- * if isscalar: # <<<<<<<<<<<<<<
- * if date.month == 2 and date.day == 29:
- * raise ValueError(
- */
- goto __pyx_L22;
- }
-
- /* "netcdftime/_netcdftime.pyx":774
- * jdelta = _NoLeapDayFromDate(date) - self._jd0
- * else:
- * jdelta = [] # <<<<<<<<<<<<<<
- * for d in date.flat:
- * if d.month == 2 and d.day == 29:
- */
- /*else*/ {
- __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 774, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_v_jdelta = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":775
- * else:
- * jdelta = []
- * for d in date.flat: # <<<<<<<<<<<<<<
- * if d.month == 2 and d.day == 29:
- * raise ValueError(
- */
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_flat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
- __pyx_t_4 = __pyx_t_11; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 775, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 775, __pyx_L1_error)
- #else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 775, __pyx_L1_error)
- #else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 775, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- #endif
- }
- } else {
- __pyx_t_11 = __pyx_t_14(__pyx_t_4);
- if (unlikely(!__pyx_t_11)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 775, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_11);
- }
- __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_11);
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":776
- * jdelta = []
- * for d in date.flat:
- * if d.month == 2 and d.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- */
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_month); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_PyInt_EqObjC(__pyx_t_11, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L29_bool_binop_done;
- }
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_11 = __Pyx_PyInt_EqObjC(__pyx_t_12, __pyx_int_29, 29, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_7 = __pyx_t_9;
- __pyx_L29_bool_binop_done:;
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":777
- * for d in date.flat:
- * if d.month == 2 and d.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there is no leap day in the noleap calendar')
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- */
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_Raise(__pyx_t_11, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __PYX_ERR(0, 777, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":776
- * jdelta = []
- * for d in date.flat:
- * if d.month == 2 and d.day == 29: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":779
- * raise ValueError(
- * 'there is no leap day in the noleap calendar')
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0) # <<<<<<<<<<<<<<
- * elif self.calendar in ['all_leap', '366_day']:
- * if isscalar:
- */
- __pyx_t_11 = __pyx_f_10netcdftime_11_netcdftime__NoLeapDayFromDate(__pyx_v_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_8 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_jdelta, __pyx_t_8); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 779, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":775
- * else:
- * jdelta = []
- * for d in date.flat: # <<<<<<<<<<<<<<
- * if d.month == 2 and d.day == 29:
- * raise ValueError(
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_L22:;
-
- /* "netcdftime/_netcdftime.pyx":767
- * jdelta = JulianDayFromDate(
- * date.flat, self.calendar) - self._jd0
- * elif self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * if isscalar:
- * if date.month == 2 and date.day == 29:
- */
- goto __pyx_L14;
- }
-
- /* "netcdftime/_netcdftime.pyx":780
- * 'there is no leap day in the noleap calendar')
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * if isscalar:
- * jdelta = _AllLeapFromDate(date) - self._jd0
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_all_leap, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
- if (!__pyx_t_9) {
- } else {
- __pyx_t_7 = __pyx_t_9;
- goto __pyx_L31_bool_binop_done;
- }
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_366_day, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
- __pyx_t_7 = __pyx_t_9;
- __pyx_L31_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = (__pyx_t_7 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":781
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- * elif self.calendar in ['all_leap', '366_day']:
- * if isscalar: # <<<<<<<<<<<<<<
- * jdelta = _AllLeapFromDate(date) - self._jd0
- * else:
- */
- __pyx_t_9 = (__pyx_v_isscalar != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":782
- * elif self.calendar in ['all_leap', '366_day']:
- * if isscalar:
- * jdelta = _AllLeapFromDate(date) - self._jd0 # <<<<<<<<<<<<<<
- * else:
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat]
- */
- __pyx_t_4 = __pyx_f_10netcdftime_11_netcdftime__AllLeapFromDate(__pyx_v_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_12 = PyNumber_Subtract(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 782, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_jdelta = __pyx_t_12;
- __pyx_t_12 = 0;
-
- /* "netcdftime/_netcdftime.pyx":781
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- * elif self.calendar in ['all_leap', '366_day']:
- * if isscalar: # <<<<<<<<<<<<<<
- * jdelta = _AllLeapFromDate(date) - self._jd0
- * else:
- */
- goto __pyx_L33;
- }
-
- /* "netcdftime/_netcdftime.pyx":784
- * jdelta = _AllLeapFromDate(date) - self._jd0
- * else:
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat] # <<<<<<<<<<<<<<
- * elif self.calendar == '360_day':
- * if isscalar:
- */
- /*else*/ {
- __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_flat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
- __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 784, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- }
- } else {
- __pyx_t_8 = __pyx_t_14(__pyx_t_4);
- 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_ERR(0, 784, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_8);
- }
- __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = __pyx_f_10netcdftime_11_netcdftime__AllLeapFromDate(__pyx_v_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 784, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_12;
- __pyx_t_12 = 0;
- }
- __pyx_L33:;
-
- /* "netcdftime/_netcdftime.pyx":780
- * 'there is no leap day in the noleap calendar')
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * if isscalar:
- * jdelta = _AllLeapFromDate(date) - self._jd0
- */
- goto __pyx_L14;
- }
-
- /* "netcdftime/_netcdftime.pyx":785
- * else:
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat]
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * if isscalar:
- * if date.day > 30:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 785, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_12, __pyx_kp_s_360_day, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":786
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat]
- * elif self.calendar == '360_day':
- * if isscalar: # <<<<<<<<<<<<<<
- * if date.day > 30:
- * raise ValueError(
- */
- __pyx_t_9 = (__pyx_v_isscalar != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":787
- * elif self.calendar == '360_day':
- * if isscalar:
- * if date.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_day); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 787, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_12, __pyx_int_30, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 787, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":788
- * if isscalar:
- * if date.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta = _360DayFromDate(date) - self._jd0
- */
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __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_ERR(0, 788, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":787
- * elif self.calendar == '360_day':
- * if isscalar:
- * if date.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":790
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta = _360DayFromDate(date) - self._jd0 # <<<<<<<<<<<<<<
- * else:
- * jdelta = []
- */
- __pyx_t_4 = __pyx_f_10netcdftime_11_netcdftime__360DayFromDate(__pyx_v_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 790, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_jdelta = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":786
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat]
- * elif self.calendar == '360_day':
- * if isscalar: # <<<<<<<<<<<<<<
- * if date.day > 30:
- * raise ValueError(
- */
- goto __pyx_L36;
- }
-
- /* "netcdftime/_netcdftime.pyx":792
- * jdelta = _360DayFromDate(date) - self._jd0
- * else:
- * jdelta = [] # <<<<<<<<<<<<<<
- * for d in date.flat:
- * if d.day > 30:
- */
- /*else*/ {
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 792, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_jdelta = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":793
- * else:
- * jdelta = []
- * for d in date.flat: # <<<<<<<<<<<<<<
- * if d.day > 30:
- * raise ValueError(
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_flat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_12 = __pyx_t_6; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_14 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 793, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_12))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_12)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 793, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 793, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_14(__pyx_t_12);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 793, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":794
- * jdelta = []
- * for d in date.flat:
- * if d.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_int_30, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":795
- * for d in date.flat:
- * if d.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta.append(_360DayFromDate(d) - self._jd0)
- */
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __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_ERR(0, 795, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":794
- * jdelta = []
- * for d in date.flat:
- * if d.day > 30: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":797
- * raise ValueError(
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta.append(_360DayFromDate(d) - self._jd0) # <<<<<<<<<<<<<<
- * if not isscalar:
- * jdelta = numpy.array(jdelta)
- */
- __pyx_t_4 = __pyx_f_10netcdftime_11_netcdftime__360DayFromDate(__pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 797, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_11 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 797, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_jdelta, __pyx_t_11); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 797, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":793
- * else:
- * jdelta = []
- * for d in date.flat: # <<<<<<<<<<<<<<
- * if d.day > 30:
- * raise ValueError(
- */
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __pyx_L36:;
-
- /* "netcdftime/_netcdftime.pyx":785
- * else:
- * jdelta = [_AllLeapFromDate(d) - self._jd0 for d in date.flat]
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * if isscalar:
- * if date.day > 30:
- */
- }
- __pyx_L14:;
-
- /* "netcdftime/_netcdftime.pyx":798
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta.append(_360DayFromDate(d) - self._jd0)
- * if not isscalar: # <<<<<<<<<<<<<<
- * jdelta = numpy.array(jdelta)
- * # convert to desired units, subtract time zone offset.
- */
- __pyx_t_9 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":799
- * jdelta.append(_360DayFromDate(d) - self._jd0)
- * if not isscalar:
- * jdelta = numpy.array(jdelta) # <<<<<<<<<<<<<<
- * # convert to desired units, subtract time zone offset.
- * if self.units in microsec_units:
- */
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 799, __pyx_L1_error) }
- __pyx_t_11 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_jdelta); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_jdelta};
- __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_jdelta};
- __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_12);
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
- __Pyx_INCREF(__pyx_v_jdelta);
- __Pyx_GIVEREF(__pyx_v_jdelta);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_jdelta);
- __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_12);
- __pyx_t_12 = 0;
-
- /* "netcdftime/_netcdftime.pyx":798
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta.append(_360DayFromDate(d) - self._jd0)
- * if not isscalar: # <<<<<<<<<<<<<<
- * jdelta = numpy.array(jdelta)
- * # convert to desired units, subtract time zone offset.
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":801
- * jdelta = numpy.array(jdelta)
- * # convert to desired units, subtract time zone offset.
- * if self.units in microsec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6
- * elif self.units in millisec_units:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 801, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_microsec_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_12, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 801, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = (__pyx_t_9 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":802
- * # convert to desired units, subtract time zone offset.
- * if self.units in microsec_units:
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6 # <<<<<<<<<<<<<<
- * elif self.units in millisec_units:
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 802, __pyx_L1_error) }
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_jdelta, __pyx_float_86400_); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = PyNumber_Multiply(__pyx_t_6, __pyx_float_1_e6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_float_60_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_float_1_e6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_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_XDECREF_SET(__pyx_v_jdelta, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":801
- * jdelta = numpy.array(jdelta)
- * # convert to desired units, subtract time zone offset.
- * if self.units in microsec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6
- * elif self.units in millisec_units:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":803
- * if self.units in microsec_units:
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6
- * elif self.units in millisec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- * elif self.units in sec_units:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_millisec_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 803, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 803, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = (__pyx_t_7 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":804
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6
- * elif self.units in millisec_units:
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3 # <<<<<<<<<<<<<<
- * elif self.units in sec_units:
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 804, __pyx_L1_error) }
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_jdelta, __pyx_float_86400_); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_float_1_e3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = PyNumber_Multiply(__pyx_t_6, __pyx_float_60_); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_t_12, __pyx_float_1_e3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 804, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_12);
- __pyx_t_12 = 0;
-
- /* "netcdftime/_netcdftime.pyx":803
- * if self.units in microsec_units:
- * jdelta = jdelta * 86400. * 1.e6 - self.tzoffset * 60. * 1.e6
- * elif self.units in millisec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- * elif self.units in sec_units:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":805
- * elif self.units in millisec_units:
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- * elif self.units in sec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- * elif self.units in min_units:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 805, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sec_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_12, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = (__pyx_t_9 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":806
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- * elif self.units in sec_units:
- * jdelta = jdelta * 86400. - self.tzoffset * 60. # <<<<<<<<<<<<<<
- * elif self.units in min_units:
- * jdelta = jdelta * 1440. - self.tzoffset
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 806, __pyx_L1_error) }
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_jdelta, __pyx_float_86400_); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 806, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = PyNumber_Multiply(__pyx_t_12, __pyx_float_60_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 806, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_12);
- __pyx_t_12 = 0;
-
- /* "netcdftime/_netcdftime.pyx":805
- * elif self.units in millisec_units:
- * jdelta = jdelta * 86400. * 1.e3 - self.tzoffset * 60. * 1.e3
- * elif self.units in sec_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- * elif self.units in min_units:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":807
- * elif self.units in sec_units:
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- * elif self.units in min_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 1440. - self.tzoffset
- * elif self.units in hr_units:
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_12, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 807, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = (__pyx_t_7 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":808
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- * elif self.units in min_units:
- * jdelta = jdelta * 1440. - self.tzoffset # <<<<<<<<<<<<<<
- * elif self.units in hr_units:
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 808, __pyx_L1_error) }
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_jdelta, __pyx_float_1440_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":807
- * elif self.units in sec_units:
- * jdelta = jdelta * 86400. - self.tzoffset * 60.
- * elif self.units in min_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 1440. - self.tzoffset
- * elif self.units in hr_units:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":809
- * elif self.units in min_units:
- * jdelta = jdelta * 1440. - self.tzoffset
- * elif self.units in hr_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- * elif self.units in day_units:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_hr_units); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 809, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_t_12, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 809, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_7 = (__pyx_t_9 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":810
- * jdelta = jdelta * 1440. - self.tzoffset
- * elif self.units in hr_units:
- * jdelta = jdelta * 24. - self.tzoffset / 60. # <<<<<<<<<<<<<<
- * elif self.units in day_units:
- * jdelta = jdelta - self.tzoffset / 1440.
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 810, __pyx_L1_error) }
- __pyx_t_12 = PyNumber_Multiply(__pyx_v_jdelta, __pyx_float_24_); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_6, __pyx_float_60_, 60., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 810, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":809
- * elif self.units in min_units:
- * jdelta = jdelta * 1440. - self.tzoffset
- * elif self.units in hr_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- * elif self.units in day_units:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":811
- * elif self.units in hr_units:
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- * elif self.units in day_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta - self.tzoffset / 1440.
- * else:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_day_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 811, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = (__pyx_t_7 != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":812
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- * elif self.units in day_units:
- * jdelta = jdelta - self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * else:
- * raise ValueError('unsupported time units')
- */
- if (unlikely(!__pyx_v_jdelta)) { __Pyx_RaiseUnboundLocalError("jdelta"); __PYX_ERR(0, 812, __pyx_L1_error) }
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_t_4, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_jdelta, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_jdelta, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":811
- * elif self.units in hr_units:
- * jdelta = jdelta * 24. - self.tzoffset / 60.
- * elif self.units in day_units: # <<<<<<<<<<<<<<
- * jdelta = jdelta - self.tzoffset / 1440.
- * else:
- */
- goto __pyx_L42;
- }
-
- /* "netcdftime/_netcdftime.pyx":814
- * jdelta = jdelta - self.tzoffset / 1440.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * if isscalar:
- * return jdelta
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __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_ERR(0, 814, __pyx_L1_error)
- }
- __pyx_L42:;
-
- /* "netcdftime/_netcdftime.pyx":815
- * else:
- * raise ValueError('unsupported time units')
- * if isscalar: # <<<<<<<<<<<<<<
- * return jdelta
- * else:
- */
- __pyx_t_9 = (__pyx_v_isscalar != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":816
- * raise ValueError('unsupported time units')
- * if isscalar:
- * return jdelta # <<<<<<<<<<<<<<
- * else:
- * return numpy.reshape(jdelta, shape)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_jdelta);
- __pyx_r = __pyx_v_jdelta;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":815
- * else:
- * raise ValueError('unsupported time units')
- * if isscalar: # <<<<<<<<<<<<<<
- * return jdelta
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":818
- * return jdelta
- * else:
- * return numpy.reshape(jdelta, shape) # <<<<<<<<<<<<<<
- *
- * def num2date(self, time_value):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_v_shape)) { __Pyx_RaiseUnboundLocalError("shape"); __PYX_ERR(0, 818, __pyx_L1_error) }
- __pyx_t_6 = NULL;
- __pyx_t_10 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_12, function);
- __pyx_t_10 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_jdelta, __pyx_v_shape};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_jdelta, __pyx_v_shape};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
- }
- __Pyx_INCREF(__pyx_v_jdelta);
- __Pyx_GIVEREF(__pyx_v_jdelta);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_jdelta);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_shape);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":734
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar)
- *
- * def date2num(self, date): # <<<<<<<<<<<<<<
- * """
- * Returns C{time_value} in units described by L{unit_string}, using
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.date2num", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_jdelta);
- __Pyx_XDECREF(__pyx_v_d);
- __Pyx_XDECREF(__pyx_v_date);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":820
- * return numpy.reshape(jdelta, shape)
- *
- * def num2date(self, time_value): # <<<<<<<<<<<<<<
- * """
- * Return a 'datetime-like' object given a C{time_value} in units
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_5num2date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_5utime_4num2date[] = "\n Return a 'datetime-like' object given a C{time_value} in units\n described by L{unit_string}, using L{calendar}.\n\n dates are in UTC with no offset, even if L{unit_string} contains\n a time zone offset from UTC.\n\n Resolution is approximately a millisecond.\n\n Works for scalars, sequences and numpy arrays.\n Returns a scalar if input is a scalar, else returns a nu [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_5utime_5num2date = {"num2date", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_5utime_5num2date, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_5utime_4num2date};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5utime_5num2date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_self = 0;
- PyObject *__pyx_v_time_value = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("num2date (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_time_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_self)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_time_value)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("num2date", 1, 2, 2, 1); __PYX_ERR(0, 820, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "num2date") < 0)) __PYX_ERR(0, 820, __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_self = values[0];
- __pyx_v_time_value = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("num2date", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_5utime_4num2date(__pyx_self, __pyx_v_self, __pyx_v_time_value);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_5utime_4num2date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_time_value) {
- int __pyx_v_isscalar;
- int __pyx_v_ismasked;
- PyObject *__pyx_v_mask = NULL;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_jdelta = NULL;
- PyObject *__pyx_v_jd = NULL;
- PyObject *__pyx_v_date = NULL;
- PyObject *__pyx_v_j = NULL;
- PyObject *__pyx_v_m = 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 = NULL;
- int __pyx_t_7;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- PyObject *(*__pyx_t_14)(PyObject *);
- PyObject *(*__pyx_t_15)(PyObject *);
- int __pyx_t_16;
- __Pyx_RefNannySetupContext("num2date", 0);
- __Pyx_INCREF(__pyx_v_time_value);
-
- /* "netcdftime/_netcdftime.pyx":842
- * do not exist in any real world calendar.
- * """
- * isscalar = False # <<<<<<<<<<<<<<
- * try:
- * time_value[0]
- */
- __pyx_v_isscalar = 0;
-
- /* "netcdftime/_netcdftime.pyx":843
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * time_value[0]
- * except:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":844
- * isscalar = False
- * try:
- * time_value[0] # <<<<<<<<<<<<<<
- * except:
- * isscalar = True
- */
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_time_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":843
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * time_value[0]
- * except:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":845
- * try:
- * time_value[0]
- * except: # <<<<<<<<<<<<<<
- * isscalar = True
- * ismasked = False
- */
- /*except:*/ {
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 845, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "netcdftime/_netcdftime.pyx":846
- * time_value[0]
- * except:
- * isscalar = True # <<<<<<<<<<<<<<
- * ismasked = False
- * if hasattr(time_value, 'mask'):
- */
- __pyx_v_isscalar = 1;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L4_exception_handled;
- }
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":843
- * """
- * isscalar = False
- * try: # <<<<<<<<<<<<<<
- * time_value[0]
- * except:
- */
- __Pyx_PyThreadState_assign
- __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_L4_exception_handled:;
- __Pyx_PyThreadState_assign
- __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);
- __pyx_L10_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":847
- * except:
- * isscalar = True
- * ismasked = False # <<<<<<<<<<<<<<
- * if hasattr(time_value, 'mask'):
- * mask = time_value.mask
- */
- __pyx_v_ismasked = 0;
-
- /* "netcdftime/_netcdftime.pyx":848
- * isscalar = True
- * ismasked = False
- * if hasattr(time_value, 'mask'): # <<<<<<<<<<<<<<
- * mask = time_value.mask
- * ismasked = True
- */
- __pyx_t_7 = PyObject_HasAttr(__pyx_v_time_value, __pyx_n_s_mask); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 848, __pyx_L1_error)
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":849
- * ismasked = False
- * if hasattr(time_value, 'mask'):
- * mask = time_value.mask # <<<<<<<<<<<<<<
- * ismasked = True
- * if not isscalar:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_time_value, __pyx_n_s_mask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 849, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_mask = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":850
- * if hasattr(time_value, 'mask'):
- * mask = time_value.mask
- * ismasked = True # <<<<<<<<<<<<<<
- * if not isscalar:
- * time_value = numpy.array(time_value, dtype='d')
- */
- __pyx_v_ismasked = 1;
-
- /* "netcdftime/_netcdftime.pyx":848
- * isscalar = True
- * ismasked = False
- * if hasattr(time_value, 'mask'): # <<<<<<<<<<<<<<
- * mask = time_value.mask
- * ismasked = True
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":851
- * mask = time_value.mask
- * ismasked = True
- * if not isscalar: # <<<<<<<<<<<<<<
- * time_value = numpy.array(time_value, dtype='d')
- * shape = time_value.shape
- */
- __pyx_t_8 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":852
- * ismasked = True
- * if not isscalar:
- * time_value = numpy.array(time_value, dtype='d') # <<<<<<<<<<<<<<
- * shape = time_value.shape
- * # convert to desired units, add time zone offset.
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_time_value);
- __Pyx_GIVEREF(__pyx_v_time_value);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_time_value);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_d) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 852, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_time_value, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":853
- * if not isscalar:
- * time_value = numpy.array(time_value, dtype='d')
- * shape = time_value.shape # <<<<<<<<<<<<<<
- * # convert to desired units, add time zone offset.
- * if self.units in microsec_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_time_value, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 853, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_v_shape = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":851
- * mask = time_value.mask
- * ismasked = True
- * if not isscalar: # <<<<<<<<<<<<<<
- * time_value = numpy.array(time_value, dtype='d')
- * shape = time_value.shape
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":855
- * shape = time_value.shape
- * # convert to desired units, add time zone offset.
- * if self.units in microsec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440.
- * elif self.units in millisec_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 855, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_microsec_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 855, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":856
- * # convert to desired units, add time zone offset.
- * if self.units in microsec_units:
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * elif self.units in millisec_units:
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- */
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_v_time_value, __pyx_float_86400000000_, 86400000000., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_t_9, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_jdelta = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":855
- * shape = time_value.shape
- * # convert to desired units, add time zone offset.
- * if self.units in microsec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440.
- * elif self.units in millisec_units:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":857
- * if self.units in microsec_units:
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440.
- * elif self.units in millisec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- * elif self.units in sec_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 857, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_millisec_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 857, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":858
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440.
- * elif self.units in millisec_units:
- * jdelta = time_value / 86400000. + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * elif self.units in sec_units:
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- */
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_v_time_value, __pyx_float_86400000_, 86400000., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 858, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_9, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 858, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":857
- * if self.units in microsec_units:
- * jdelta = time_value / 86400000000. + self.tzoffset / 1440.
- * elif self.units in millisec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- * elif self.units in sec_units:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":859
- * elif self.units in millisec_units:
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- * elif self.units in sec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- * elif self.units in min_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 859, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sec_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 859, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":860
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- * elif self.units in sec_units:
- * jdelta = time_value / 86400. + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * elif self.units in min_units:
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- */
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_v_time_value, __pyx_float_86400_, 86400., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_t_9, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 860, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_jdelta = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":859
- * elif self.units in millisec_units:
- * jdelta = time_value / 86400000. + self.tzoffset / 1440.
- * elif self.units in sec_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- * elif self.units in min_units:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":861
- * elif self.units in sec_units:
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- * elif self.units in min_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- * elif self.units in hr_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 861, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 861, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":862
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- * elif self.units in min_units:
- * jdelta = time_value / 1440. + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * elif self.units in hr_units:
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- */
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_v_time_value, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_t_9, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_jdelta = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":861
- * elif self.units in sec_units:
- * jdelta = time_value / 86400. + self.tzoffset / 1440.
- * elif self.units in min_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- * elif self.units in hr_units:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":863
- * elif self.units in min_units:
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- * elif self.units in hr_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- * elif self.units in day_units:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hr_units); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 863, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":864
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- * elif self.units in hr_units:
- * jdelta = time_value / 24. + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * elif self.units in day_units:
- * jdelta = time_value + self.tzoffset / 1440.
- */
- __pyx_t_4 = __Pyx_PyFloat_DivideObjC(__pyx_v_time_value, __pyx_float_24_, 24., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 864, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyFloat_DivideObjC(__pyx_t_9, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 864, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 864, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_jdelta = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":863
- * elif self.units in min_units:
- * jdelta = time_value / 1440. + self.tzoffset / 1440.
- * elif self.units in hr_units: # <<<<<<<<<<<<<<
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- * elif self.units in day_units:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":865
- * elif self.units in hr_units:
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- * elif self.units in day_units: # <<<<<<<<<<<<<<
- * jdelta = time_value + self.tzoffset / 1440.
- * else:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_units_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_day_units); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 865, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":866
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- * elif self.units in day_units:
- * jdelta = time_value + self.tzoffset / 1440. # <<<<<<<<<<<<<<
- * else:
- * raise ValueError('unsupported time units')
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyFloat_DivideObjC(__pyx_t_6, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_v_time_value, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_jdelta = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":865
- * elif self.units in hr_units:
- * jdelta = time_value / 24. + self.tzoffset / 1440.
- * elif self.units in day_units: # <<<<<<<<<<<<<<
- * jdelta = time_value + self.tzoffset / 1440.
- * else:
- */
- goto __pyx_L15;
- }
-
- /* "netcdftime/_netcdftime.pyx":868
- * jdelta = time_value + self.tzoffset / 1440.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- /*else*/ {
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 868, __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_ERR(0, 868, __pyx_L1_error)
- }
- __pyx_L15:;
-
- /* "netcdftime/_netcdftime.pyx":869
- * else:
- * raise ValueError('unsupported time units')
- * jd = self._jd0 + jdelta # <<<<<<<<<<<<<<
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if not isscalar:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_jd0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 869, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_v_jdelta); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_jd = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":870
- * raise ValueError('unsupported time units')
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * if ismasked:
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_julian, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 870, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_8 = __pyx_t_7;
- goto __pyx_L17_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_standard, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 870, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_8 = __pyx_t_7;
- goto __pyx_L17_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_gregorian, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 870, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_8 = __pyx_t_7;
- goto __pyx_L17_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_proleptic_gregorian, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 870, __pyx_L1_error)
- __pyx_t_8 = __pyx_t_7;
- __pyx_L17_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":871
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * if ismasked:
- * date = []
- */
- __pyx_t_7 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":872
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if not isscalar:
- * if ismasked: # <<<<<<<<<<<<<<
- * date = []
- * for j, m in zip(jd.flat, mask.flat):
- */
- __pyx_t_7 = (__pyx_v_ismasked != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":873
- * if not isscalar:
- * if ismasked:
- * date = [] # <<<<<<<<<<<<<<
- * for j, m in zip(jd.flat, mask.flat):
- * if not m:
- */
- __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 873, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_v_date = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":874
- * if ismasked:
- * date = []
- * for j, m in zip(jd.flat, mask.flat): # <<<<<<<<<<<<<<
- * if not m:
- * date.append(DateFromJulianDay(j, self.calendar))
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_jd, __pyx_n_s_flat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_v_mask)) { __Pyx_RaiseUnboundLocalError("mask"); __PYX_ERR(0, 874, __pyx_L1_error) }
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_flat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && 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_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, __pyx_t_5};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, __pyx_t_5};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_5);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
- __pyx_t_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_14(__pyx_t_6);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 874, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
- PyObject* sequence = __pyx_t_9;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 874, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_12 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
- index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_12)) goto __pyx_L25_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_12);
- index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L25_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) __PYX_ERR(0, 874, __pyx_L1_error)
- __pyx_t_15 = NULL;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L26_unpacking_done;
- __pyx_L25_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_15 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 874, __pyx_L1_error)
- __pyx_L26_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_12);
- __pyx_t_12 = 0;
- __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "netcdftime/_netcdftime.pyx":875
- * date = []
- * for j, m in zip(jd.flat, mask.flat):
- * if not m: # <<<<<<<<<<<<<<
- * date.append(DateFromJulianDay(j, self.calendar))
- * else:
- */
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 875, __pyx_L1_error)
- __pyx_t_8 = ((!__pyx_t_7) != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":876
- * for j, m in zip(jd.flat, mask.flat):
- * if not m:
- * date.append(DateFromJulianDay(j, self.calendar)) # <<<<<<<<<<<<<<
- * else:
- * date.append(None)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DateFromJulianDay); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_j, __pyx_t_12};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_j, __pyx_t_12};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- } else
- #endif
- {
- __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 876, __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_j);
- __Pyx_GIVEREF(__pyx_v_j);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_v_j);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_16 = __Pyx_PyObject_Append(__pyx_v_date, __pyx_t_9); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 876, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":875
- * date = []
- * for j, m in zip(jd.flat, mask.flat):
- * if not m: # <<<<<<<<<<<<<<
- * date.append(DateFromJulianDay(j, self.calendar))
- * else:
- */
- goto __pyx_L27;
- }
-
- /* "netcdftime/_netcdftime.pyx":878
- * date.append(DateFromJulianDay(j, self.calendar))
- * else:
- * date.append(None) # <<<<<<<<<<<<<<
- * else:
- * date = DateFromJulianDay(jd.flat, self.calendar)
- */
- /*else*/ {
- __pyx_t_16 = __Pyx_PyObject_Append(__pyx_v_date, Py_None); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 878, __pyx_L1_error)
- }
- __pyx_L27:;
-
- /* "netcdftime/_netcdftime.pyx":874
- * if ismasked:
- * date = []
- * for j, m in zip(jd.flat, mask.flat): # <<<<<<<<<<<<<<
- * if not m:
- * date.append(DateFromJulianDay(j, self.calendar))
- */
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":872
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if not isscalar:
- * if ismasked: # <<<<<<<<<<<<<<
- * date = []
- * for j, m in zip(jd.flat, mask.flat):
- */
- goto __pyx_L22;
- }
-
- /* "netcdftime/_netcdftime.pyx":880
- * date.append(None)
- * else:
- * date = DateFromJulianDay(jd.flat, self.calendar) # <<<<<<<<<<<<<<
- * else:
- * if ismasked and mask.item():
- */
- /*else*/ {
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DateFromJulianDay); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_jd, __pyx_n_s_flat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_10};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_10};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (__pyx_t_12) {
- __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_11, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_t_10);
- __pyx_t_5 = 0;
- __pyx_t_10 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
- }
- __pyx_L22:;
-
- /* "netcdftime/_netcdftime.pyx":871
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * if ismasked:
- * date = []
- */
- goto __pyx_L21;
- }
-
- /* "netcdftime/_netcdftime.pyx":882
- * date = DateFromJulianDay(jd.flat, self.calendar)
- * else:
- * if ismasked and mask.item(): # <<<<<<<<<<<<<<
- * date = None
- * else:
- */
- /*else*/ {
- __pyx_t_7 = (__pyx_v_ismasked != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_8 = __pyx_t_7;
- goto __pyx_L29_bool_binop_done;
- }
- if (unlikely(!__pyx_v_mask)) { __Pyx_RaiseUnboundLocalError("mask"); __PYX_ERR(0, 882, __pyx_L1_error) }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_item); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (__pyx_t_4) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = __pyx_t_7;
- __pyx_L29_bool_binop_done:;
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":883
- * else:
- * if ismasked and mask.item():
- * date = None # <<<<<<<<<<<<<<
- * else:
- * date = DateFromJulianDay(jd, self.calendar)
- */
- __Pyx_INCREF(Py_None);
- __pyx_v_date = Py_None;
-
- /* "netcdftime/_netcdftime.pyx":882
- * date = DateFromJulianDay(jd.flat, self.calendar)
- * else:
- * if ismasked and mask.item(): # <<<<<<<<<<<<<<
- * date = None
- * else:
- */
- goto __pyx_L28;
- }
-
- /* "netcdftime/_netcdftime.pyx":885
- * date = None
- * else:
- * date = DateFromJulianDay(jd, self.calendar) # <<<<<<<<<<<<<<
- * elif self.calendar in ['noleap', '365_day']:
- * if not isscalar:
- */
- /*else*/ {
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DateFromJulianDay); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && 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_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_jd, __pyx_t_4};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_jd, __pyx_t_4};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_INCREF(__pyx_v_jd);
- __Pyx_GIVEREF(__pyx_v_jd);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, __pyx_v_jd);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
- }
- __pyx_L28:;
- }
- __pyx_L21:;
-
- /* "netcdftime/_netcdftime.pyx":870
- * raise ValueError('unsupported time units')
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * if ismasked:
- */
- goto __pyx_L16;
- }
-
- /* "netcdftime/_netcdftime.pyx":886
- * else:
- * date = DateFromJulianDay(jd, self.calendar)
- * elif self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFromNoLeapDay(j) for j in jd.flat]
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_noleap, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 886, __pyx_L1_error)
- if (!__pyx_t_7) {
- } else {
- __pyx_t_8 = __pyx_t_7;
- goto __pyx_L31_bool_binop_done;
- }
- __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_kp_s_365_day, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 886, __pyx_L1_error)
- __pyx_t_8 = __pyx_t_7;
- __pyx_L31_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = (__pyx_t_8 != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":887
- * date = DateFromJulianDay(jd, self.calendar)
- * elif self.calendar in ['noleap', '365_day']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFromNoLeapDay(j) for j in jd.flat]
- * else:
- */
- __pyx_t_7 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_7) {
-
- /* "netcdftime/_netcdftime.pyx":888
- * elif self.calendar in ['noleap', '365_day']:
- * if not isscalar:
- * date = [_DateFromNoLeapDay(j) for j in jd.flat] # <<<<<<<<<<<<<<
- * else:
- * date = _DateFromNoLeapDay(jd)
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_jd, __pyx_n_s_flat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
- __pyx_t_5 = __pyx_t_9; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 888, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_14(__pyx_t_5);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 888, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __pyx_f_10netcdftime_11_netcdftime__DateFromNoLeapDay(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 888, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":887
- * date = DateFromJulianDay(jd, self.calendar)
- * elif self.calendar in ['noleap', '365_day']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFromNoLeapDay(j) for j in jd.flat]
- * else:
- */
- goto __pyx_L33;
- }
-
- /* "netcdftime/_netcdftime.pyx":890
- * date = [_DateFromNoLeapDay(j) for j in jd.flat]
- * else:
- * date = _DateFromNoLeapDay(jd) # <<<<<<<<<<<<<<
- * elif self.calendar in ['all_leap', '366_day']:
- * if not isscalar:
- */
- /*else*/ {
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__DateFromNoLeapDay(__pyx_v_jd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
- }
- __pyx_L33:;
-
- /* "netcdftime/_netcdftime.pyx":886
- * else:
- * date = DateFromJulianDay(jd, self.calendar)
- * elif self.calendar in ['noleap', '365_day']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFromNoLeapDay(j) for j in jd.flat]
- */
- goto __pyx_L16;
- }
-
- /* "netcdftime/_netcdftime.pyx":891
- * else:
- * date = _DateFromNoLeapDay(jd)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFromAllLeap(j) for j in jd.flat]
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 891, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_all_leap, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error)
- if (!__pyx_t_8) {
- } else {
- __pyx_t_7 = __pyx_t_8;
- goto __pyx_L36_bool_binop_done;
- }
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_kp_s_366_day, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error)
- __pyx_t_7 = __pyx_t_8;
- __pyx_L36_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = (__pyx_t_7 != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":892
- * date = _DateFromNoLeapDay(jd)
- * elif self.calendar in ['all_leap', '366_day']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFromAllLeap(j) for j in jd.flat]
- * else:
- */
- __pyx_t_8 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":893
- * elif self.calendar in ['all_leap', '366_day']:
- * if not isscalar:
- * date = [_DateFromAllLeap(j) for j in jd.flat] # <<<<<<<<<<<<<<
- * else:
- * date = _DateFromAllLeap(jd)
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_jd, __pyx_n_s_flat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_9 = __pyx_t_5; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 893, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_9))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 893, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 893, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_14(__pyx_t_9);
- 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_ERR(0, 893, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_f_10netcdftime_11_netcdftime__DateFromAllLeap(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 893, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":892
- * date = _DateFromNoLeapDay(jd)
- * elif self.calendar in ['all_leap', '366_day']:
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFromAllLeap(j) for j in jd.flat]
- * else:
- */
- goto __pyx_L38;
- }
-
- /* "netcdftime/_netcdftime.pyx":895
- * date = [_DateFromAllLeap(j) for j in jd.flat]
- * else:
- * date = _DateFromAllLeap(jd) # <<<<<<<<<<<<<<
- * elif self.calendar == '360_day':
- * if not isscalar:
- */
- /*else*/ {
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__DateFromAllLeap(__pyx_v_jd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 895, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
- }
- __pyx_L38:;
-
- /* "netcdftime/_netcdftime.pyx":891
- * else:
- * date = _DateFromNoLeapDay(jd)
- * elif self.calendar in ['all_leap', '366_day']: # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFromAllLeap(j) for j in jd.flat]
- */
- goto __pyx_L16;
- }
-
- /* "netcdftime/_netcdftime.pyx":896
- * else:
- * date = _DateFromAllLeap(jd)
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFrom360Day(j) for j in jd.flat]
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calendar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_kp_s_360_day, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 896, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":897
- * date = _DateFromAllLeap(jd)
- * elif self.calendar == '360_day':
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFrom360Day(j) for j in jd.flat]
- * else:
- */
- __pyx_t_8 = ((!(__pyx_v_isscalar != 0)) != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":898
- * elif self.calendar == '360_day':
- * if not isscalar:
- * date = [_DateFrom360Day(j) for j in jd.flat] # <<<<<<<<<<<<<<
- * else:
- * date = _DateFrom360Day(jd)
- */
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_jd, __pyx_n_s_flat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
- __pyx_t_5 = __pyx_t_9; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0;
- __pyx_t_14 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 898, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- for (;;) {
- if (likely(!__pyx_t_14)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_14(__pyx_t_5);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 898, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __pyx_f_10netcdftime_11_netcdftime__DateFrom360Day(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 898, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":897
- * date = _DateFromAllLeap(jd)
- * elif self.calendar == '360_day':
- * if not isscalar: # <<<<<<<<<<<<<<
- * date = [_DateFrom360Day(j) for j in jd.flat]
- * else:
- */
- goto __pyx_L41;
- }
-
- /* "netcdftime/_netcdftime.pyx":900
- * date = [_DateFrom360Day(j) for j in jd.flat]
- * else:
- * date = _DateFrom360Day(jd) # <<<<<<<<<<<<<<
- * if isscalar:
- * return date
- */
- /*else*/ {
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__DateFrom360Day(__pyx_v_jd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_date = __pyx_t_6;
- __pyx_t_6 = 0;
- }
- __pyx_L41:;
-
- /* "netcdftime/_netcdftime.pyx":896
- * else:
- * date = _DateFromAllLeap(jd)
- * elif self.calendar == '360_day': # <<<<<<<<<<<<<<
- * if not isscalar:
- * date = [_DateFrom360Day(j) for j in jd.flat]
- */
- }
- __pyx_L16:;
-
- /* "netcdftime/_netcdftime.pyx":901
- * else:
- * date = _DateFrom360Day(jd)
- * if isscalar: # <<<<<<<<<<<<<<
- * return date
- * else:
- */
- __pyx_t_8 = (__pyx_v_isscalar != 0);
- if (__pyx_t_8) {
-
- /* "netcdftime/_netcdftime.pyx":902
- * date = _DateFrom360Day(jd)
- * if isscalar:
- * return date # <<<<<<<<<<<<<<
- * else:
- * return numpy.reshape(numpy.array(date), shape)
- */
- __Pyx_XDECREF(__pyx_r);
- if (unlikely(!__pyx_v_date)) { __Pyx_RaiseUnboundLocalError("date"); __PYX_ERR(0, 902, __pyx_L1_error) }
- __Pyx_INCREF(__pyx_v_date);
- __pyx_r = __pyx_v_date;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":901
- * else:
- * date = _DateFrom360Day(jd)
- * if isscalar: # <<<<<<<<<<<<<<
- * return date
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":904
- * return date
- * else:
- * return numpy.reshape(numpy.array(date), shape) # <<<<<<<<<<<<<<
- *
- *
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_v_date)) { __Pyx_RaiseUnboundLocalError("date"); __PYX_ERR(0, 904, __pyx_L1_error) }
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_date};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_date};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_date);
- __Pyx_GIVEREF(__pyx_v_date);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_date);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(!__pyx_v_shape)) { __Pyx_RaiseUnboundLocalError("shape"); __PYX_ERR(0, 904, __pyx_L1_error) }
- __pyx_t_10 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && 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_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_shape};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_shape};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_5);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_shape);
- __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":820
- * return numpy.reshape(jdelta, shape)
- *
- * def num2date(self, time_value): # <<<<<<<<<<<<<<
- * """
- * Return a 'datetime-like' object given a C{time_value} in units
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("netcdftime._netcdftime.utime.num2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_mask);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_jdelta);
- __Pyx_XDECREF(__pyx_v_jd);
- __Pyx_XDECREF(__pyx_v_date);
- __Pyx_XDECREF(__pyx_v_j);
- __Pyx_XDECREF(__pyx_v_m);
- __Pyx_XDECREF(__pyx_v_time_value);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":907
- *
- *
- * cdef _parse_timezone(tzstring): # <<<<<<<<<<<<<<
- * """Parses ISO 8601 time zone specs into tzinfo offsets
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__parse_timezone(PyObject *__pyx_v_tzstring) {
- PyObject *__pyx_v_m = NULL;
- PyObject *__pyx_v_prefix = NULL;
- PyObject *__pyx_v_hours = NULL;
- PyObject *__pyx_v_minutes = NULL;
- 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)(PyObject *);
- __Pyx_RefNannySetupContext("_parse_timezone", 0);
-
- /* "netcdftime/_netcdftime.pyx":912
- * Adapted from pyiso8601 (http://code.google.com/p/pyiso8601/)
- * """
- * if tzstring == "Z": # <<<<<<<<<<<<<<
- * return 0
- * # This isn't strictly correct, but it's common to encounter dates without
- */
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_tzstring, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":913
- * """
- * if tzstring == "Z":
- * return 0 # <<<<<<<<<<<<<<
- * # This isn't strictly correct, but it's common to encounter dates without
- * # time zones so I'll assume the default (which defaults to UTC).
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_int_0);
- __pyx_r = __pyx_int_0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":912
- * Adapted from pyiso8601 (http://code.google.com/p/pyiso8601/)
- * """
- * if tzstring == "Z": # <<<<<<<<<<<<<<
- * return 0
- * # This isn't strictly correct, but it's common to encounter dates without
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":916
- * # This isn't strictly correct, but it's common to encounter dates without
- * # time zones so I'll assume the default (which defaults to UTC).
- * if tzstring is None: # <<<<<<<<<<<<<<
- * return 0
- * m = TIMEZONE_REGEX.match(tzstring)
- */
- __pyx_t_1 = (__pyx_v_tzstring == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":917
- * # time zones so I'll assume the default (which defaults to UTC).
- * if tzstring is None:
- * return 0 # <<<<<<<<<<<<<<
- * m = TIMEZONE_REGEX.match(tzstring)
- * prefix, hours, minutes = m.groups()
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_int_0);
- __pyx_r = __pyx_int_0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":916
- * # This isn't strictly correct, but it's common to encounter dates without
- * # time zones so I'll assume the default (which defaults to UTC).
- * if tzstring is None: # <<<<<<<<<<<<<<
- * return 0
- * m = TIMEZONE_REGEX.match(tzstring)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":918
- * if tzstring is None:
- * return 0
- * m = TIMEZONE_REGEX.match(tzstring) # <<<<<<<<<<<<<<
- * prefix, hours, minutes = m.groups()
- * hours, minutes = int(hours), int(minutes)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TIMEZONE_REGEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tzstring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_tzstring};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_tzstring};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __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_tzstring);
- __Pyx_GIVEREF(__pyx_v_tzstring);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_tzstring);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __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_v_m = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":919
- * return 0
- * m = TIMEZONE_REGEX.match(tzstring)
- * prefix, hours, minutes = m.groups() # <<<<<<<<<<<<<<
- * hours, minutes = int(hours), int(minutes)
- * if prefix == "-":
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_groups); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_ERR(0, 919, __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_ERR(0, 919, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if !CYTHON_COMPILING_IN_PYPY
- 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_ERR(0, 919, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
- } else {
- __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
- }
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #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_ERR(0, 919, __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_L5_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_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 919, __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_ERR(0, 919, __pyx_L1_error)
- __pyx_L6_unpacking_done:;
- }
- __pyx_v_prefix = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_hours = __pyx_t_6;
- __pyx_t_6 = 0;
- __pyx_v_minutes = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":920
- * m = TIMEZONE_REGEX.match(tzstring)
- * prefix, hours, minutes = m.groups()
- * hours, minutes = int(hours), int(minutes) # <<<<<<<<<<<<<<
- * if prefix == "-":
- * hours = -hours
- */
- __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_hours); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_minutes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_hours, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_minutes, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":921
- * prefix, hours, minutes = m.groups()
- * hours, minutes = int(hours), int(minutes)
- * if prefix == "-": # <<<<<<<<<<<<<<
- * hours = -hours
- * minutes = -minutes
- */
- __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_prefix, __pyx_kp_s__14, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":922
- * hours, minutes = int(hours), int(minutes)
- * if prefix == "-":
- * hours = -hours # <<<<<<<<<<<<<<
- * minutes = -minutes
- * return minutes + hours * 60.
- */
- __pyx_t_4 = PyNumber_Negative(__pyx_v_hours); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_hours, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":923
- * if prefix == "-":
- * hours = -hours
- * minutes = -minutes # <<<<<<<<<<<<<<
- * return minutes + hours * 60.
- *
- */
- __pyx_t_4 = PyNumber_Negative(__pyx_v_minutes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_minutes, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":921
- * prefix, hours, minutes = m.groups()
- * hours, minutes = int(hours), int(minutes)
- * if prefix == "-": # <<<<<<<<<<<<<<
- * hours = -hours
- * minutes = -minutes
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":924
- * hours = -hours
- * minutes = -minutes
- * return minutes + hours * 60. # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyNumber_Multiply(__pyx_v_hours, __pyx_float_60_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyNumber_Add(__pyx_v_minutes, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __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;
-
- /* "netcdftime/_netcdftime.pyx":907
- *
- *
- * cdef _parse_timezone(tzstring): # <<<<<<<<<<<<<<
- * """Parses ISO 8601 time zone specs into tzinfo offsets
- *
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime._parse_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_m);
- __Pyx_XDECREF(__pyx_v_prefix);
- __Pyx_XDECREF(__pyx_v_hours);
- __Pyx_XDECREF(__pyx_v_minutes);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":927
- *
- *
- * cpdef _parse_date(datestring): # <<<<<<<<<<<<<<
- * """Parses ISO 8601 dates into datetime objects
- *
- */
-
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_datestring); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__parse_date(PyObject *__pyx_v_datestring, CYTHON_UNUSED int __pyx_skip_dispatch) {
- PyObject *__pyx_v_m = NULL;
- PyObject *__pyx_v_groups = NULL;
- PyObject *__pyx_v_tzoffset_mins = NULL;
- PyObject *__pyx_v_iyear = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __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;
- PyObject *__pyx_t_9 = NULL;
- __Pyx_RefNannySetupContext("_parse_date", 0);
-
- /* "netcdftime/_netcdftime.pyx":935
- * Adapted from pyiso8601 (http://code.google.com/p/pyiso8601/)
- * """
- * if not isinstance(datestring, str) and not isinstance(datestring, unicode): # <<<<<<<<<<<<<<
- * raise ValueError("Expecting a string %r" % datestring)
- * m = ISO8601_REGEX.match(datestring.strip())
- */
- __pyx_t_2 = PyString_Check(__pyx_v_datestring);
- __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_1 = __pyx_t_3;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_3 = PyUnicode_Check(__pyx_v_datestring);
- __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L4_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":936
- * """
- * if not isinstance(datestring, str) and not isinstance(datestring, unicode):
- * raise ValueError("Expecting a string %r" % datestring) # <<<<<<<<<<<<<<
- * m = ISO8601_REGEX.match(datestring.strip())
- * if not m:
- */
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expecting_a_string_r, __pyx_v_datestring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __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_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __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_ERR(0, 936, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":935
- * Adapted from pyiso8601 (http://code.google.com/p/pyiso8601/)
- * """
- * if not isinstance(datestring, str) and not isinstance(datestring, unicode): # <<<<<<<<<<<<<<
- * raise ValueError("Expecting a string %r" % datestring)
- * m = ISO8601_REGEX.match(datestring.strip())
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":937
- * if not isinstance(datestring, str) and not isinstance(datestring, unicode):
- * raise ValueError("Expecting a string %r" % datestring)
- * m = ISO8601_REGEX.match(datestring.strip()) # <<<<<<<<<<<<<<
- * if not m:
- * raise ValueError("Unable to parse date string %r" % datestring)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ISO8601_REGEX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datestring, __pyx_n_s_strip); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else {
- __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 937, __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_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_m = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":938
- * raise ValueError("Expecting a string %r" % datestring)
- * m = ISO8601_REGEX.match(datestring.strip())
- * if not m: # <<<<<<<<<<<<<<
- * raise ValueError("Unable to parse date string %r" % datestring)
- * groups = m.groupdict()
- */
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 938, __pyx_L1_error)
- __pyx_t_2 = ((!__pyx_t_1) != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":939
- * m = ISO8601_REGEX.match(datestring.strip())
- * if not m:
- * raise ValueError("Unable to parse date string %r" % datestring) # <<<<<<<<<<<<<<
- * groups = m.groupdict()
- * tzoffset_mins = _parse_timezone(groups["timezone"])
- */
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_date_string_r, __pyx_v_datestring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 939, __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 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __PYX_ERR(0, 939, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":938
- * raise ValueError("Expecting a string %r" % datestring)
- * m = ISO8601_REGEX.match(datestring.strip())
- * if not m: # <<<<<<<<<<<<<<
- * raise ValueError("Unable to parse date string %r" % datestring)
- * groups = m.groupdict()
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":940
- * if not m:
- * raise ValueError("Unable to parse date string %r" % datestring)
- * groups = m.groupdict() # <<<<<<<<<<<<<<
- * tzoffset_mins = _parse_timezone(groups["timezone"])
- * if groups["hour"] is None:
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_groupdict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 940, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (__pyx_t_8) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 940, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 940, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_groups = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":941
- * raise ValueError("Unable to parse date string %r" % datestring)
- * groups = m.groupdict()
- * tzoffset_mins = _parse_timezone(groups["timezone"]) # <<<<<<<<<<<<<<
- * if groups["hour"] is None:
- * groups["hour"] = 0
- */
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_timezone); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __pyx_f_10netcdftime_11_netcdftime__parse_timezone(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 941, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_tzoffset_mins = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":942
- * groups = m.groupdict()
- * tzoffset_mins = _parse_timezone(groups["timezone"])
- * if groups["hour"] is None: # <<<<<<<<<<<<<<
- * groups["hour"] = 0
- * if groups["minute"] is None:
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_hour); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = (__pyx_t_6 == Py_None);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":943
- * tzoffset_mins = _parse_timezone(groups["timezone"])
- * if groups["hour"] is None:
- * groups["hour"] = 0 # <<<<<<<<<<<<<<
- * if groups["minute"] is None:
- * groups["minute"] = 0
- */
- if (unlikely(PyObject_SetItem(__pyx_v_groups, __pyx_n_s_hour, __pyx_int_0) < 0)) __PYX_ERR(0, 943, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":942
- * groups = m.groupdict()
- * tzoffset_mins = _parse_timezone(groups["timezone"])
- * if groups["hour"] is None: # <<<<<<<<<<<<<<
- * groups["hour"] = 0
- * if groups["minute"] is None:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":944
- * if groups["hour"] is None:
- * groups["hour"] = 0
- * if groups["minute"] is None: # <<<<<<<<<<<<<<
- * groups["minute"] = 0
- * if groups["second"] is None:
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_minute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = (__pyx_t_6 == Py_None);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":945
- * groups["hour"] = 0
- * if groups["minute"] is None:
- * groups["minute"] = 0 # <<<<<<<<<<<<<<
- * if groups["second"] is None:
- * groups["second"] = 0
- */
- if (unlikely(PyObject_SetItem(__pyx_v_groups, __pyx_n_s_minute, __pyx_int_0) < 0)) __PYX_ERR(0, 945, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":944
- * if groups["hour"] is None:
- * groups["hour"] = 0
- * if groups["minute"] is None: # <<<<<<<<<<<<<<
- * groups["minute"] = 0
- * if groups["second"] is None:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":946
- * if groups["minute"] is None:
- * groups["minute"] = 0
- * if groups["second"] is None: # <<<<<<<<<<<<<<
- * groups["second"] = 0
- * # if groups["fraction"] is None:
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = (__pyx_t_6 == Py_None);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":947
- * groups["minute"] = 0
- * if groups["second"] is None:
- * groups["second"] = 0 # <<<<<<<<<<<<<<
- * # if groups["fraction"] is None:
- * # groups["fraction"] = 0
- */
- if (unlikely(PyObject_SetItem(__pyx_v_groups, __pyx_n_s_second, __pyx_int_0) < 0)) __PYX_ERR(0, 947, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":946
- * if groups["minute"] is None:
- * groups["minute"] = 0
- * if groups["second"] is None: # <<<<<<<<<<<<<<
- * groups["second"] = 0
- * # if groups["fraction"] is None:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":952
- * # else:
- * # groups["fraction"] = int(float("0.%s" % groups["fraction"]) * 1e6)
- * iyear = int(groups["year"]) # <<<<<<<<<<<<<<
- * return iyear, int(groups["month"]), int(groups["day"]),\
- * int(groups["hour"]), int(groups["minute"]), int(groups["second"]),\
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_iyear = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":953
- * # groups["fraction"] = int(float("0.%s" % groups["fraction"]) * 1e6)
- * iyear = int(groups["year"])
- * return iyear, int(groups["month"]), int(groups["day"]),\ # <<<<<<<<<<<<<<
- * int(groups["hour"]), int(groups["minute"]), int(groups["second"]),\
- * tzoffset_mins
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":954
- * iyear = int(groups["year"])
- * return iyear, int(groups["month"]), int(groups["day"]),\
- * int(groups["hour"]), int(groups["minute"]), int(groups["second"]),\ # <<<<<<<<<<<<<<
- * tzoffset_mins
- *
- */
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_minute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_v_groups, __pyx_n_s_second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 954, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":953
- * # groups["fraction"] = int(float("0.%s" % groups["fraction"]) * 1e6)
- * iyear = int(groups["year"])
- * return iyear, int(groups["month"]), int(groups["day"]),\ # <<<<<<<<<<<<<<
- * int(groups["hour"]), int(groups["minute"]), int(groups["second"]),\
- * tzoffset_mins
- */
- __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_iyear);
- __Pyx_GIVEREF(__pyx_v_iyear);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_iyear);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_9);
- __Pyx_INCREF(__pyx_v_tzoffset_mins);
- __Pyx_GIVEREF(__pyx_v_tzoffset_mins);
- PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_tzoffset_mins);
- __pyx_t_6 = 0;
- __pyx_t_8 = 0;
- __pyx_t_5 = 0;
- __pyx_t_7 = 0;
- __pyx_t_9 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":927
- *
- *
- * cpdef _parse_date(datestring): # <<<<<<<<<<<<<<
- * """Parses ISO 8601 dates into datetime objects
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __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("netcdftime._netcdftime._parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_m);
- __Pyx_XDECREF(__pyx_v_groups);
- __Pyx_XDECREF(__pyx_v_tzoffset_mins);
- __Pyx_XDECREF(__pyx_v_iyear);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_datestring); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_4_parse_date[] = "Parses ISO 8601 dates into datetime objects\n\n The timezone is parsed from the date string, assuming UTC\n by default.\n\n Adapted from pyiso8601 (http://code.google.com/p/pyiso8601/)\n ";
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_5_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_datestring) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_parse_date (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_4_parse_date(__pyx_self, ((PyObject *)__pyx_v_datestring));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_4_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datestring) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("_parse_date", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime__parse_date(__pyx_v_datestring, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __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("netcdftime._netcdftime._parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":957
- * tzoffset_mins
- *
- * cdef _check_index(indices, times, nctime, calendar, select): # <<<<<<<<<<<<<<
- * """Return True if the time indices given correspond to the given times,
- * False otherwise.
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__check_index(PyObject *__pyx_v_indices, PyObject *__pyx_v_times, PyObject *__pyx_v_nctime, CYTHON_UNUSED PyObject *__pyx_v_calendar, PyObject *__pyx_v_select) {
- PyObject *__pyx_v_N = NULL;
- PyObject *__pyx_v_t = NULL;
- PyObject *__pyx_v_ta = NULL;
- PyObject *__pyx_v_tb = NULL;
- PyObject *__pyx_v_delta_after = NULL;
- PyObject *__pyx_v_delta_before = NULL;
- PyObject *__pyx_v_delta_check = 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;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- __Pyx_RefNannySetupContext("_check_index", 0);
- __Pyx_INCREF(__pyx_v_nctime);
-
- /* "netcdftime/_netcdftime.pyx":978
- * Index selection method.
- * """
- * N = nctime.shape[0] # <<<<<<<<<<<<<<
- * if (indices < 0).any():
- * return False
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_N = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":979
- * """
- * N = nctime.shape[0]
- * if (indices < 0).any(): # <<<<<<<<<<<<<<
- * return False
- *
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_indices, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __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_ERR(0, 979, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":980
- * N = nctime.shape[0]
- * if (indices < 0).any():
- * return False # <<<<<<<<<<<<<<
- *
- * if (indices >= N).any():
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":979
- * """
- * N = nctime.shape[0]
- * if (indices < 0).any(): # <<<<<<<<<<<<<<
- * return False
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":982
- * return False
- *
- * if (indices >= N).any(): # <<<<<<<<<<<<<<
- * return False
- *
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_indices, __pyx_v_N, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error)
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __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_ERR(0, 982, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":983
- *
- * if (indices >= N).any():
- * return False # <<<<<<<<<<<<<<
- *
- * try:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":982
- * return False
- *
- * if (indices >= N).any(): # <<<<<<<<<<<<<<
- * return False
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":985
- * return False
- *
- * try: # <<<<<<<<<<<<<<
- * t = nctime[indices]
- * nctime = nctime
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
- __Pyx_XGOTREF(__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_6);
- __Pyx_XGOTREF(__pyx_t_7);
- /*try:*/ {
-
- /* "netcdftime/_netcdftime.pyx":986
- *
- * try:
- * t = nctime[indices] # <<<<<<<<<<<<<<
- * nctime = nctime
- * # WORKAROUND TO CHANGES IN SLICING BEHAVIOUR in 1.1.2
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nctime, __pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L5_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_t = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":987
- * try:
- * t = nctime[indices]
- * nctime = nctime # <<<<<<<<<<<<<<
- * # WORKAROUND TO CHANGES IN SLICING BEHAVIOUR in 1.1.2
- * # this may be unacceptably slow...
- */
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_DECREF_SET(__pyx_v_nctime, __pyx_v_nctime);
-
- /* "netcdftime/_netcdftime.pyx":985
- * return False
- *
- * try: # <<<<<<<<<<<<<<
- * t = nctime[indices]
- * nctime = nctime
- */
- }
- __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;
- goto __pyx_L12_try_end;
- __pyx_L5_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":993
- * # values in indices, read entire time variable into numpy
- * # array so numpy slicing rules can be used.
- * except IndexError: # <<<<<<<<<<<<<<
- * nctime = nctime[:]
- * t = nctime[indices]
- */
- __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
- if (__pyx_t_8) {
- __Pyx_AddTraceback("netcdftime._netcdftime._check_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 993, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "netcdftime/_netcdftime.pyx":994
- * # array so numpy slicing rules can be used.
- * except IndexError:
- * nctime = nctime[:] # <<<<<<<<<<<<<<
- * t = nctime[indices]
- * # if fancy indexing not available, fall back on this.
- */
- __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_nctime, 0, 0, NULL, NULL, &__pyx_slice__15, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF_SET(__pyx_v_nctime, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":995
- * except IndexError:
- * nctime = nctime[:]
- * t = nctime[indices] # <<<<<<<<<<<<<<
- * # if fancy indexing not available, fall back on this.
- * # t=[]
- */
- __pyx_t_9 = PyObject_GetItem(__pyx_v_nctime, __pyx_v_indices); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 995, __pyx_L7_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_9);
- __pyx_t_9 = 0;
- __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;
- goto __pyx_L6_exception_handled;
- }
- goto __pyx_L7_except_error;
- __pyx_L7_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":985
- * return False
- *
- * try: # <<<<<<<<<<<<<<
- * t = nctime[indices]
- * nctime = nctime
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_XGIVEREF(__pyx_t_6);
- __Pyx_XGIVEREF(__pyx_t_7);
- __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
- goto __pyx_L1_error;
- __pyx_L6_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_XGIVEREF(__pyx_t_6);
- __Pyx_XGIVEREF(__pyx_t_7);
- __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
- __pyx_L12_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1001
- * # t.append(nctime[ind])
- *
- * if select == 'exact': # <<<<<<<<<<<<<<
- * return numpy.all(t == times)
- *
- */
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1001, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1002
- *
- * if select == 'exact':
- * return numpy.all(t == times) # <<<<<<<<<<<<<<
- *
- * elif select == 'before':
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, __pyx_v_times, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_9) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1002, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1001
- * # t.append(nctime[ind])
- *
- * if select == 'exact': # <<<<<<<<<<<<<<
- * return numpy.all(t == times)
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1004
- * return numpy.all(t == times)
- *
- * elif select == 'before': # <<<<<<<<<<<<<<
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * return numpy.all(t <= times) and numpy.all(ta > times)
- */
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_before, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1004, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1005
- *
- * elif select == 'before':
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)] # <<<<<<<<<<<<<<
- * return numpy.all(t <= times) and numpy.all(ta > times)
- *
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_indices, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_8 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_int_0, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_int_0, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_9) {
- __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_2);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_t_1);
- __pyx_t_2 = 0;
- __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __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;
- __pyx_t_10 = PyObject_GetItem(__pyx_v_nctime, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1005, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ta = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1006
- * elif select == 'before':
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * return numpy.all(t <= times) and numpy.all(ta > times) # <<<<<<<<<<<<<<
- *
- * elif select == 'after':
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_RichCompare(__pyx_v_t, __pyx_v_times, Py_LE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __pyx_t_2 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1006, __pyx_L1_error)
- if (__pyx_t_4) {
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_3);
- __pyx_t_10 = __pyx_t_3;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L16_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_times, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __pyx_t_11 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_1};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __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_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_t_3);
- __pyx_t_10 = __pyx_t_3;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_L16_bool_binop_done:;
- __pyx_r = __pyx_t_10;
- __pyx_t_10 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1004
- * return numpy.all(t == times)
- *
- * elif select == 'before': # <<<<<<<<<<<<<<
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * return numpy.all(t <= times) and numpy.all(ta > times)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1008
- * return numpy.all(t <= times) and numpy.all(ta > times)
- *
- * elif select == 'after': # <<<<<<<<<<<<<<
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * return numpy.all(t >= times) and numpy.all(tb < times)
- */
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_after, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1008, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1009
- *
- * elif select == 'after':
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)] # <<<<<<<<<<<<<<
- * return numpy.all(t >= times) and numpy.all(tb < times)
- *
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_clip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_indices, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_8 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_3, __pyx_int_0, __pyx_t_2};
- __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_3, __pyx_int_0, __pyx_t_2};
- __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_3);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_t_2);
- __pyx_t_3 = 0;
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_GetItem(__pyx_v_nctime, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_v_tb = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1010
- * elif select == 'after':
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * return numpy.all(t >= times) and numpy.all(tb < times) # <<<<<<<<<<<<<<
- *
- * elif select == 'nearest':
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_RichCompare(__pyx_v_t, __pyx_v_times, Py_GE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_11};
- __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_11};
- __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
- if (__pyx_t_4) {
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_10);
- __pyx_t_9 = __pyx_t_10;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L18_bool_binop_done;
- }
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_tb, __pyx_v_times, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __pyx_t_11 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- }
- }
- if (!__pyx_t_11) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_2};
- __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_2};
- __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __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_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_INCREF(__pyx_t_10);
- __pyx_t_9 = __pyx_t_10;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_L18_bool_binop_done:;
- __pyx_r = __pyx_t_9;
- __pyx_t_9 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1008
- * return numpy.all(t <= times) and numpy.all(ta > times)
- *
- * elif select == 'after': # <<<<<<<<<<<<<<
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * return numpy.all(t >= times) and numpy.all(tb < times)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1012
- * return numpy.all(t >= times) and numpy.all(tb < times)
- *
- * elif select == 'nearest': # <<<<<<<<<<<<<<
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- */
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_nearest, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1012, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1013
- *
- * elif select == 'nearest':
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)] # <<<<<<<<<<<<<<
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * delta_after = ta - t
- */
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_indices, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_8 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_t_10, __pyx_int_0, __pyx_t_3};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_t_10, __pyx_int_0, __pyx_t_3};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_11 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_2) {
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_10);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_t_3);
- __pyx_t_10 = 0;
- __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nctime, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_ta = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1014
- * elif select == 'nearest':
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)] # <<<<<<<<<<<<<<
- * delta_after = ta - t
- * delta_before = t - tb
- */
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_clip); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_indices, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_8 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_11)) {
- PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_9, __pyx_int_0, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
- PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_9, __pyx_int_0, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_2 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_t_9);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_8, __pyx_t_3);
- __pyx_t_9 = 0;
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_GetItem(__pyx_v_nctime, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1014, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_tb = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1015
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * delta_after = ta - t # <<<<<<<<<<<<<<
- * delta_before = t - tb
- * delta_check = numpy.abs(times - t)
- */
- __pyx_t_11 = PyNumber_Subtract(__pyx_v_ta, __pyx_v_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1015, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_v_delta_after = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1016
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- * delta_after = ta - t
- * delta_before = t - tb # <<<<<<<<<<<<<<
- * delta_check = numpy.abs(times - t)
- * return numpy.all(delta_check <= delta_after) and numpy.all(delta_check <= delta_before)
- */
- __pyx_t_11 = PyNumber_Subtract(__pyx_v_t, __pyx_v_tb); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1016, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_v_delta_before = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1017
- * delta_after = ta - t
- * delta_before = t - tb
- * delta_check = numpy.abs(times - t) # <<<<<<<<<<<<<<
- * return numpy.all(delta_check <= delta_after) and numpy.all(delta_check <= delta_before)
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_abs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_times, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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);
- }
- }
- if (!__pyx_t_3) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_11);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
- __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1017, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_delta_check = __pyx_t_11;
- __pyx_t_11 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1018
- * delta_before = t - tb
- * delta_check = numpy.abs(times - t)
- * return numpy.all(delta_check <= delta_after) and numpy.all(delta_check <= delta_before) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_v_delta_check, __pyx_v_delta_after, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && 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, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_9};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_9};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- }
- __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_ERR(0, 1018, __pyx_L1_error)
- if (__pyx_t_4) {
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_2);
- __pyx_t_11 = __pyx_t_2;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L20_bool_binop_done;
- }
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_delta_check, __pyx_v_delta_before, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __pyx_t_9 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
- PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_INCREF(__pyx_t_2);
- __pyx_t_11 = __pyx_t_2;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_L20_bool_binop_done:;
- __pyx_r = __pyx_t_11;
- __pyx_t_11 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1012
- * return numpy.all(t >= times) and numpy.all(tb < times)
- *
- * elif select == 'nearest': # <<<<<<<<<<<<<<
- * ta = nctime[numpy.clip(indices + 1, 0, N - 1)]
- * tb = nctime[numpy.clip(indices - 1, 0, N - 1)]
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":957
- * tzoffset_mins
- *
- * cdef _check_index(indices, times, nctime, calendar, select): # <<<<<<<<<<<<<<
- * """Return True if the time indices given correspond to the given times,
- * False otherwise.
- */
-
- /* 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_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("netcdftime._netcdftime._check_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_N);
- __Pyx_XDECREF(__pyx_v_t);
- __Pyx_XDECREF(__pyx_v_ta);
- __Pyx_XDECREF(__pyx_v_tb);
- __Pyx_XDECREF(__pyx_v_delta_after);
- __Pyx_XDECREF(__pyx_v_delta_before);
- __Pyx_XDECREF(__pyx_v_delta_check);
- __Pyx_XDECREF(__pyx_v_nctime);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1021
- *
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * date2index(dates, nctime, calendar=None, select='exact')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_7date2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_6date2index[] = "\n date2index(dates, nctime, calendar=None, select='exact')\n\n Return indices of a netCDF time variable corresponding to the given dates.\n\n @param dates: A datetime object or a sequence of datetime objects.\n The datetime objects should not include a time-zone offset.\n\n @param nctime: A netCDF time variable object. The nctime object must have a\n C{units} attribute. The entries are assumed to be stor [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_7date2index = {"date2index", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_7date2index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_6date2index};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_7date2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dates = 0;
- PyObject *__pyx_v_nctime = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_v_select = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("date2index (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dates,&__pyx_n_s_nctime,&__pyx_n_s_calendar,&__pyx_n_s_select,0};
- PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)Py_None);
- values[3] = ((PyObject *)__pyx_n_s_exact);
- 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_dates)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nctime)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("date2index", 0, 2, 4, 1); __PYX_ERR(0, 1021, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_select);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date2index") < 0)) __PYX_ERR(0, 1021, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_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);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_dates = values[0];
- __pyx_v_nctime = values[1];
- __pyx_v_calendar = values[2];
- __pyx_v_select = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("date2index", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1021, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_6date2index(__pyx_self, __pyx_v_dates, __pyx_v_nctime, __pyx_v_calendar, __pyx_v_select);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_6date2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dates, PyObject *__pyx_v_nctime, PyObject *__pyx_v_calendar, PyObject *__pyx_v_select) {
- PyObject *__pyx_v_cdftime = NULL;
- PyObject *__pyx_v_times = 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;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- __Pyx_RefNannySetupContext("date2index", 0);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netcdftime/_netcdftime.pyx":1048
- * correspond to the closest dates.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":1049
- * """
- * try:
- * nctime.units # <<<<<<<<<<<<<<
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1048
- * correspond to the closest dates.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1050
- * try:
- * nctime.units
- * except AttributeError: # <<<<<<<<<<<<<<
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- */
- __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
- if (__pyx_t_5) {
- __Pyx_AddTraceback("netcdftime._netcdftime.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1050, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1051
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * # Setting the calendar.
- * if calendar == None:
- */
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1051, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __PYX_ERR(0, 1051, __pyx_L5_except_error)
- }
- goto __pyx_L5_except_error;
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":1048
- * correspond to the closest dates.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- __Pyx_PyThreadState_assign
- __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:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1053
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- * cdftime = utime(nctime.units,calendar=calendar)
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_calendar, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1053, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1054
- * # Setting the calendar.
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard') # <<<<<<<<<<<<<<
- * cdftime = utime(nctime.units,calendar=calendar)
- * times = cdftime.date2num(dates)
- */
- __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_nctime, __pyx_n_s_calendar, __pyx_n_s_standard); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1054, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1053
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- * cdftime = utime(nctime.units,calendar=calendar)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1055
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard')
- * cdftime = utime(nctime.units,calendar=calendar) # <<<<<<<<<<<<<<
- * times = cdftime.date2num(dates)
- * return time2index(times, nctime, calendar=calendar, select=select)
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __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 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 1055, __pyx_L1_error)
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1055, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_cdftime = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1056
- * calendar = getattr(nctime, 'calendar', 'standard')
- * cdftime = utime(nctime.units,calendar=calendar)
- * times = cdftime.date2num(dates) # <<<<<<<<<<<<<<
- * return time2index(times, nctime, calendar=calendar, select=select)
- *
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdftime, __pyx_n_s_date2num); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dates); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dates};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dates};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1056, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_dates);
- __Pyx_GIVEREF(__pyx_v_dates);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_dates);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1056, __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_v_times = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1057
- * cdftime = utime(nctime.units,calendar=calendar)
- * times = cdftime.date2num(dates)
- * return time2index(times, nctime, calendar=calendar, select=select) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time2index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_times);
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_GIVEREF(__pyx_v_nctime);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_nctime);
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_calendar, __pyx_v_calendar) < 0) __PYX_ERR(0, 1057, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_select, __pyx_v_select) < 0) __PYX_ERR(0, 1057, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1057, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __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;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1021
- *
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * date2index(dates, nctime, calendar=None, select='exact')
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("netcdftime._netcdftime.date2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_cdftime);
- __Pyx_XDECREF(__pyx_v_times);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1060
- *
- *
- * def time2index(times, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * time2index(times, nctime, calendar=None, select='exact')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_9time2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_8time2index[] = "\n time2index(times, nctime, calendar=None, select='exact')\n\n Return indices of a netCDF time variable corresponding to the given times.\n\n @param times: A numeric time or a sequence of numeric times.\n\n @param nctime: A netCDF time variable object. The nctime object must have a\n C{units} attribute. The entries are assumed to be stored in increasing\n order.\n\n @param calendar: Describes the cale [...]
-static PyMethodDef __pyx_mdef_10netcdftime_11_netcdftime_9time2index = {"time2index", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_9time2index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_8time2index};
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_9time2index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_times = 0;
- PyObject *__pyx_v_nctime = 0;
- PyObject *__pyx_v_calendar = 0;
- PyObject *__pyx_v_select = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("time2index (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_times,&__pyx_n_s_nctime,&__pyx_n_s_calendar,&__pyx_n_s_select,0};
- PyObject* values[4] = {0,0,0,0};
- values[2] = ((PyObject *)Py_None);
- values[3] = ((PyObject *)__pyx_n_s_exact);
- 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_times)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nctime)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("time2index", 0, 2, 4, 1); __PYX_ERR(0, 1060, __pyx_L3_error)
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_calendar);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_select);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "time2index") < 0)) __PYX_ERR(0, 1060, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_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);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_times = values[0];
- __pyx_v_nctime = values[1];
- __pyx_v_calendar = values[2];
- __pyx_v_select = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("time2index", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1060, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.time2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8time2index(__pyx_self, __pyx_v_times, __pyx_v_nctime, __pyx_v_calendar, __pyx_v_select);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8time2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_times, PyObject *__pyx_v_nctime, PyObject *__pyx_v_calendar, PyObject *__pyx_v_select) {
- PyObject *__pyx_v_num = NULL;
- PyObject *__pyx_v_N = NULL;
- PyObject *__pyx_v_t0 = NULL;
- PyObject *__pyx_v_t1 = NULL;
- PyObject *__pyx_v_dt = NULL;
- PyObject *__pyx_v_index = NULL;
- PyObject *__pyx_v_bisect = NULL;
- PyObject *__pyx_v_before = NULL;
- PyObject *__pyx_v_after = NULL;
- PyObject *__pyx_v_ncnum = NULL;
- PyObject *__pyx_v_mismatch = NULL;
- PyObject *__pyx_v_nearest_to_left = NULL;
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_i = 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;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- PyObject *(*__pyx_t_16)(PyObject *);
- PyObject *__pyx_t_17 = NULL;
- int __pyx_t_18;
- double __pyx_t_19;
- double __pyx_t_20;
- __Pyx_RefNannySetupContext("time2index", 0);
- __Pyx_INCREF(__pyx_v_calendar);
-
- /* "netcdftime/_netcdftime.pyx":1086
- * correspond to the closest times.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":1087
- * """
- * try:
- * nctime.units # <<<<<<<<<<<<<<
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nctime, __pyx_n_s_units_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1086
- * correspond to the closest times.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1088
- * try:
- * nctime.units
- * except AttributeError: # <<<<<<<<<<<<<<
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- */
- __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
- if (__pyx_t_5) {
- __Pyx_AddTraceback("netcdftime._netcdftime.time2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1088, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1089
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * # Setting the calendar.
- * if calendar == None:
- */
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1089, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __PYX_ERR(0, 1089, __pyx_L5_except_error)
- }
- goto __pyx_L5_except_error;
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":1086
- * correspond to the closest times.
- * """
- * try: # <<<<<<<<<<<<<<
- * nctime.units
- * except AttributeError:
- */
- __Pyx_PyThreadState_assign
- __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:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1091
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- *
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_calendar, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1091, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1091, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1092
- * # Setting the calendar.
- * if calendar == None:
- * calendar = getattr(nctime, 'calendar', 'standard') # <<<<<<<<<<<<<<
- *
- * num = numpy.atleast_1d(times)
- */
- __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_nctime, __pyx_n_s_calendar, __pyx_n_s_standard); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1092, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_calendar, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1091
- * raise AttributeError("netcdf time variable is missing a 'units' attribute")
- * # Setting the calendar.
- * if calendar == None: # <<<<<<<<<<<<<<
- * calendar = getattr(nctime, 'calendar', 'standard')
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1094
- * calendar = getattr(nctime, 'calendar', 'standard')
- *
- * num = numpy.atleast_1d(times) # <<<<<<<<<<<<<<
- * N = len(nctime)
- *
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atleast_1d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_times); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_times};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_times};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_v_times);
- __Pyx_GIVEREF(__pyx_v_times);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_times);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1094, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_num = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1095
- *
- * num = numpy.atleast_1d(times)
- * N = len(nctime) # <<<<<<<<<<<<<<
- *
- * # Trying to infer the correct index from the starting time and the stride.
- */
- __pyx_t_10 = PyObject_Length(__pyx_v_nctime); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1095, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_N = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1099
- * # Trying to infer the correct index from the starting time and the stride.
- * # This assumes that the times are increasing uniformly.
- * if len(nctime) >= 2: # <<<<<<<<<<<<<<
- * t0, t1 = nctime[:2]
- * dt = t1 - t0
- */
- __pyx_t_10 = PyObject_Length(__pyx_v_nctime); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1099, __pyx_L1_error)
- __pyx_t_9 = ((__pyx_t_10 >= 2) != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1100
- * # This assumes that the times are increasing uniformly.
- * if len(nctime) >= 2:
- * t0, t1 = nctime[:2] # <<<<<<<<<<<<<<
- * dt = t1 - t0
- * else:
- */
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_nctime, 0, 2, NULL, NULL, &__pyx_slice__18, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L1_error)
- __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_PYPY
- 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_ERR(0, 1100, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_8);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1100, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1100, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L15_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1100, __pyx_L1_error)
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L16_unpacking_done;
- __pyx_L15_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 1100, __pyx_L1_error)
- __pyx_L16_unpacking_done:;
- }
- __pyx_v_t0 = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_t1 = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1101
- * if len(nctime) >= 2:
- * t0, t1 = nctime[:2]
- * dt = t1 - t0 # <<<<<<<<<<<<<<
- * else:
- * t0 = nctime[0]
- */
- __pyx_t_7 = PyNumber_Subtract(__pyx_v_t1, __pyx_v_t0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1101, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_dt = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1099
- * # Trying to infer the correct index from the starting time and the stride.
- * # This assumes that the times are increasing uniformly.
- * if len(nctime) >= 2: # <<<<<<<<<<<<<<
- * t0, t1 = nctime[:2]
- * dt = t1 - t0
- */
- goto __pyx_L14;
- }
-
- /* "netcdftime/_netcdftime.pyx":1103
- * dt = t1 - t0
- * else:
- * t0 = nctime[0] # <<<<<<<<<<<<<<
- * dt = 1.
- * if select in ['exact', 'before']:
- */
- /*else*/ {
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_nctime, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_t0 = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1104
- * else:
- * t0 = nctime[0]
- * dt = 1. # <<<<<<<<<<<<<<
- * if select in ['exact', 'before']:
- * index = numpy.array((num - t0) / dt, int)
- */
- __Pyx_INCREF(__pyx_float_1_);
- __pyx_v_dt = __pyx_float_1_;
- }
- __pyx_L14:;
-
- /* "netcdftime/_netcdftime.pyx":1105
- * t0 = nctime[0]
- * dt = 1.
- * if select in ['exact', 'before']: # <<<<<<<<<<<<<<
- * index = numpy.array((num - t0) / dt, int)
- * elif select == 'after':
- */
- __Pyx_INCREF(__pyx_v_select);
- __pyx_t_7 = __pyx_v_select;
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1105, __pyx_L1_error)
- if (!__pyx_t_12) {
- } else {
- __pyx_t_9 = __pyx_t_12;
- goto __pyx_L18_bool_binop_done;
- }
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_before, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1105, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_12;
- __pyx_L18_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = (__pyx_t_9 != 0);
- if (__pyx_t_12) {
-
- /* "netcdftime/_netcdftime.pyx":1106
- * dt = 1.
- * if select in ['exact', 'before']:
- * index = numpy.array((num - t0) / dt, int) # <<<<<<<<<<<<<<
- * elif select == 'after':
- * index = numpy.array(numpy.ceil((num - t0) / dt), int)
- */
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Subtract(__pyx_v_num, __pyx_v_t0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_8) {
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_t_6);
- __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, ((PyObject *)(&PyInt_Type)));
- __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1106, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_index = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1105
- * t0 = nctime[0]
- * dt = 1.
- * if select in ['exact', 'before']: # <<<<<<<<<<<<<<
- * index = numpy.array((num - t0) / dt, int)
- * elif select == 'after':
- */
- goto __pyx_L17;
- }
-
- /* "netcdftime/_netcdftime.pyx":1107
- * if select in ['exact', 'before']:
- * index = numpy.array((num - t0) / dt, int)
- * elif select == 'after': # <<<<<<<<<<<<<<
- * index = numpy.array(numpy.ceil((num - t0) / dt), int)
- * else:
- */
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_after, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1107, __pyx_L1_error)
- if (__pyx_t_12) {
-
- /* "netcdftime/_netcdftime.pyx":1108
- * index = numpy.array((num - t0) / dt, int)
- * elif select == 'after':
- * index = numpy.array(numpy.ceil((num - t0) / dt), int) # <<<<<<<<<<<<<<
- * else:
- * index = numpy.array(numpy.around((num - t0) / dt), int)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ceil); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_num, __pyx_v_t0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_dt); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_14};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_14};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- } else
- #endif
- {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else
- #endif
- {
- __pyx_t_15 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1108, __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_4);
- PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_5, __pyx_t_4);
- __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_5, ((PyObject *)(&PyInt_Type)));
- __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_v_index = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1107
- * if select in ['exact', 'before']:
- * index = numpy.array((num - t0) / dt, int)
- * elif select == 'after': # <<<<<<<<<<<<<<
- * index = numpy.array(numpy.ceil((num - t0) / dt), int)
- * else:
- */
- goto __pyx_L17;
- }
-
- /* "netcdftime/_netcdftime.pyx":1110
- * index = numpy.array(numpy.ceil((num - t0) / dt), int)
- * else:
- * index = numpy.array(numpy.around((num - t0) / dt), int) # <<<<<<<<<<<<<<
- *
- * # Checking that the index really corresponds to the given time.
- */
- /*else*/ {
- __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_array); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_around); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_num, __pyx_v_t0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dt); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14};
- __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14};
- __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1110, __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_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_15);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_15, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_15)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_13, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
- PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_13, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_8) {
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_13);
- __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)(&PyInt_Type)));
- __pyx_t_13 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1110, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_v_index = __pyx_t_7;
- __pyx_t_7 = 0;
- }
- __pyx_L17:;
-
- /* "netcdftime/_netcdftime.pyx":1115
- * # If the times do not correspond, then it means that the times
- * # are not increasing uniformly and we try the bisection method.
- * if not _check_index(index, times, nctime, calendar, select): # <<<<<<<<<<<<<<
- *
- * # Use the bisection method. Assumes nctime is ordered.
- */
- __pyx_t_7 = __pyx_f_10netcdftime_11_netcdftime__check_index(__pyx_v_index, __pyx_v_times, __pyx_v_nctime, __pyx_v_calendar, __pyx_v_select); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_9 = ((!__pyx_t_12) != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1118
- *
- * # Use the bisection method. Assumes nctime is ordered.
- * import bisect # <<<<<<<<<<<<<<
- * index = numpy.array([bisect.bisect_right(nctime, n) for n in num], int)
- * before = index == 0
- */
- __pyx_t_7 = __Pyx_Import(__pyx_n_s_bisect, 0, -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1118, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_bisect = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1119
- * # Use the bisection method. Assumes nctime is ordered.
- * import bisect
- * index = numpy.array([bisect.bisect_right(nctime, n) for n in num], int) # <<<<<<<<<<<<<<
- * before = index == 0
- *
- */
- __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- if (likely(PyList_CheckExact(__pyx_v_num)) || PyTuple_CheckExact(__pyx_v_num)) {
- __pyx_t_13 = __pyx_v_num; __Pyx_INCREF(__pyx_t_13); __pyx_t_10 = 0;
- __pyx_t_16 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_num); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1119, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_16)) {
- if (likely(PyList_CheckExact(__pyx_t_13))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_13, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_13, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- }
- } else {
- __pyx_t_8 = __pyx_t_16(__pyx_t_13);
- 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_ERR(0, 1119, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_8);
- }
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_bisect, __pyx_n_s_bisect_right); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_4 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_14, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_14)) {
- PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_nctime, __pyx_v_n};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
- PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_nctime, __pyx_v_n};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else
- #endif
- {
- __pyx_t_17 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
- if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_GIVEREF(__pyx_v_nctime);
- PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_5, __pyx_v_nctime);
- __Pyx_INCREF(__pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_5, __pyx_v_n);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- }
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_13) {
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13); __pyx_t_13 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_15);
- __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, ((PyObject *)(&PyInt_Type)));
- __pyx_t_15 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1119, __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_index, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1120
- * import bisect
- * index = numpy.array([bisect.bisect_right(nctime, n) for n in num], int)
- * before = index == 0 # <<<<<<<<<<<<<<
- *
- * index = numpy.array([bisect.bisect_left(nctime, n) for n in num], int)
- */
- __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_index, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1120, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_before = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1122
- * before = index == 0
- *
- * index = numpy.array([bisect.bisect_left(nctime, n) for n in num], int) # <<<<<<<<<<<<<<
- * after = index == N
- *
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_v_num)) || PyTuple_CheckExact(__pyx_v_num)) {
- __pyx_t_15 = __pyx_v_num; __Pyx_INCREF(__pyx_t_15); __pyx_t_10 = 0;
- __pyx_t_16 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_num); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1122, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_16)) {
- if (likely(PyList_CheckExact(__pyx_t_15))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_15)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_13 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_10); __Pyx_INCREF(__pyx_t_13); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1122, __pyx_L1_error)
- #else
- __pyx_t_13 = PySequence_ITEM(__pyx_t_15, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_10); __Pyx_INCREF(__pyx_t_13); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1122, __pyx_L1_error)
- #else
- __pyx_t_13 = PySequence_ITEM(__pyx_t_15, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- #endif
- }
- } else {
- __pyx_t_13 = __pyx_t_16(__pyx_t_15);
- if (unlikely(!__pyx_t_13)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 1122, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_13);
- }
- __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_13);
- __pyx_t_13 = 0;
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_bisect, __pyx_n_s_bisect_left); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_17 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_14);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
- __Pyx_INCREF(__pyx_t_17);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_14, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_14)) {
- PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_v_nctime, __pyx_v_n};
- __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
- PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_v_nctime, __pyx_v_n};
- __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (__pyx_t_17) {
- __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_17); __pyx_t_17 = NULL;
- }
- __Pyx_INCREF(__pyx_v_nctime);
- __Pyx_GIVEREF(__pyx_v_nctime);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_nctime);
- __Pyx_INCREF(__pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_n);
- __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_4, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = NULL;
- __pyx_t_5 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_15)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_15);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- __pyx_t_5 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_6, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_6, ((PyObject *)(&PyInt_Type))};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_15) {
- __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __pyx_t_15 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_t_6);
- __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
- __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, ((PyObject *)(&PyInt_Type)));
- __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1123
- *
- * index = numpy.array([bisect.bisect_left(nctime, n) for n in num], int)
- * after = index == N # <<<<<<<<<<<<<<
- *
- * if select in ['before', 'exact'] and numpy.any(before):
- */
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_index, __pyx_v_N, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L1_error)
- __pyx_v_after = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1125
- * after = index == N
- *
- * if select in ['before', 'exact'] and numpy.any(before): # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times given are before the first time in `nctime`.')
- */
- __Pyx_INCREF(__pyx_v_select);
- __pyx_t_7 = __pyx_v_select;
- __pyx_t_18 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_before, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
- if (!__pyx_t_18) {
- } else {
- __pyx_t_12 = __pyx_t_18;
- goto __pyx_L28_bool_binop_done;
- }
- __pyx_t_18 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __pyx_t_12 = __pyx_t_18;
- __pyx_L28_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_18 = (__pyx_t_12 != 0);
- if (__pyx_t_18) {
- } else {
- __pyx_t_9 = __pyx_t_18;
- goto __pyx_L26_bool_binop_done;
- }
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_any); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
- }
- }
- if (!__pyx_t_8) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_before); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_before};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_before};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_INCREF(__pyx_v_before);
- __Pyx_GIVEREF(__pyx_v_before);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_before);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_9 = __pyx_t_18;
- __pyx_L26_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1126
- *
- * if select in ['before', 'exact'] and numpy.any(before):
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times given are before the first time in `nctime`.')
- *
- */
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 1126, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1125
- * after = index == N
- *
- * if select in ['before', 'exact'] and numpy.any(before): # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times given are before the first time in `nctime`.')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1129
- * 'Some of the times given are before the first time in `nctime`.')
- *
- * if select in ['after', 'exact'] and numpy.any(after): # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times given are after the last time in `nctime`.')
- */
- __Pyx_INCREF(__pyx_v_select);
- __pyx_t_7 = __pyx_v_select;
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_after, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
- if (!__pyx_t_12) {
- } else {
- __pyx_t_18 = __pyx_t_12;
- goto __pyx_L33_bool_binop_done;
- }
- __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __pyx_t_18 = __pyx_t_12;
- __pyx_L33_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = (__pyx_t_18 != 0);
- if (__pyx_t_12) {
- } else {
- __pyx_t_9 = __pyx_t_12;
- goto __pyx_L31_bool_binop_done;
- }
- __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_any); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
- }
- }
- if (!__pyx_t_13) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_after); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_after};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_after};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13); __pyx_t_13 = NULL;
- __Pyx_INCREF(__pyx_v_after);
- __Pyx_GIVEREF(__pyx_v_after);
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_after);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __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_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_9 = __pyx_t_12;
- __pyx_L31_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1130
- *
- * if select in ['after', 'exact'] and numpy.any(after):
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times given are after the last time in `nctime`.')
- *
- */
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 1130, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1129
- * 'Some of the times given are before the first time in `nctime`.')
- *
- * if select in ['after', 'exact'] and numpy.any(after): # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times given are after the last time in `nctime`.')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1136
- * # Use list comprehension instead of the simpler `nctime[index]` since
- * # not all time objects support numpy integer indexing (eg dap).
- * index[after] = N - 1 # <<<<<<<<<<<<<<
- * ncnum = numpy.squeeze([nctime[i] for i in index])
- * mismatch = numpy.nonzero(ncnum != num)[0]
- */
- __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1136, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_v_after, __pyx_t_7) < 0)) __PYX_ERR(0, 1136, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1137
- * # not all time objects support numpy integer indexing (eg dap).
- * index[after] = N - 1
- * ncnum = numpy.squeeze([nctime[i] for i in index]) # <<<<<<<<<<<<<<
- * mismatch = numpy.nonzero(ncnum != num)[0]
- *
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
- __pyx_t_13 = __pyx_v_index; __Pyx_INCREF(__pyx_t_13); __pyx_t_10 = 0;
- __pyx_t_16 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1137, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_16)) {
- if (likely(PyList_CheckExact(__pyx_t_13))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_10); __Pyx_INCREF(__pyx_t_15); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
- #else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_13, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_10); __Pyx_INCREF(__pyx_t_15); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
- #else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_13, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- #endif
- }
- } else {
- __pyx_t_15 = __pyx_t_16(__pyx_t_13);
- 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_ERR(0, 1137, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_15);
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_15);
- __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetItem(__pyx_v_nctime, __pyx_v_i); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_15))) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_13) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_6};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_6};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1137, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1137, __pyx_L1_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_v_ncnum = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1138
- * index[after] = N - 1
- * ncnum = numpy.squeeze([nctime[i] for i in index])
- * mismatch = numpy.nonzero(ncnum != num)[0] # <<<<<<<<<<<<<<
- *
- * if select == 'exact':
- */
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_ncnum, __pyx_v_num, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_15);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_15, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_15)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_mismatch = __pyx_t_15;
- __pyx_t_15 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1140
- * mismatch = numpy.nonzero(ncnum != num)[0]
- *
- * if select == 'exact': # <<<<<<<<<<<<<<
- * if len(mismatch) > 0:
- * raise ValueError(
- */
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1140, __pyx_L1_error)
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1141
- *
- * if select == 'exact':
- * if len(mismatch) > 0: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times specified were not found in the `nctime` variable.')
- */
- __pyx_t_10 = PyObject_Length(__pyx_v_mismatch); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1141, __pyx_L1_error)
- __pyx_t_9 = ((__pyx_t_10 > 0) != 0);
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1142
- * if select == 'exact':
- * if len(mismatch) > 0:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times specified were not found in the `nctime` variable.')
- *
- */
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_Raise(__pyx_t_15, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __PYX_ERR(0, 1142, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1141
- *
- * if select == 'exact':
- * if len(mismatch) > 0: # <<<<<<<<<<<<<<
- * raise ValueError(
- * 'Some of the times specified were not found in the `nctime` variable.')
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1140
- * mismatch = numpy.nonzero(ncnum != num)[0]
- *
- * if select == 'exact': # <<<<<<<<<<<<<<
- * if len(mismatch) > 0:
- * raise ValueError(
- */
- goto __pyx_L37;
- }
-
- /* "netcdftime/_netcdftime.pyx":1145
- * 'Some of the times specified were not found in the `nctime` variable.')
- *
- * elif select == 'before': # <<<<<<<<<<<<<<
- * index[after] = N
- * index[mismatch] -= 1
- */
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_before, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error)
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1146
- *
- * elif select == 'before':
- * index[after] = N # <<<<<<<<<<<<<<
- * index[mismatch] -= 1
- *
- */
- if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_v_after, __pyx_v_N) < 0)) __PYX_ERR(0, 1146, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1147
- * elif select == 'before':
- * index[after] = N
- * index[mismatch] -= 1 # <<<<<<<<<<<<<<
- *
- * elif select == 'after':
- */
- __Pyx_INCREF(__pyx_v_mismatch);
- __pyx_t_15 = __pyx_v_mismatch;
- __pyx_t_7 = PyObject_GetItem(__pyx_v_index, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1147, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1147, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_t_15, __pyx_t_13) < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1145
- * 'Some of the times specified were not found in the `nctime` variable.')
- *
- * elif select == 'before': # <<<<<<<<<<<<<<
- * index[after] = N
- * index[mismatch] -= 1
- */
- goto __pyx_L37;
- }
-
- /* "netcdftime/_netcdftime.pyx":1149
- * index[mismatch] -= 1
- *
- * elif select == 'after': # <<<<<<<<<<<<<<
- * pass
- *
- */
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_after, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1149, __pyx_L1_error)
- if (__pyx_t_9) {
- goto __pyx_L37;
- }
-
- /* "netcdftime/_netcdftime.pyx":1152
- * pass
- *
- * elif select == 'nearest': # <<<<<<<<<<<<<<
- * nearest_to_left = num[mismatch] < numpy.array(
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2.
- */
- __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_select, __pyx_n_s_nearest, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1152, __pyx_L1_error)
- if (__pyx_t_9) {
-
- /* "netcdftime/_netcdftime.pyx":1153
- *
- * elif select == 'nearest':
- * nearest_to_left = num[mismatch] < numpy.array( # <<<<<<<<<<<<<<
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2.
- * index[mismatch] = index[mismatch] - 1 * nearest_to_left
- */
- __pyx_t_15 = PyObject_GetItem(__pyx_v_num, __pyx_v_mismatch); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
-
- /* "netcdftime/_netcdftime.pyx":1154
- * elif select == 'nearest':
- * nearest_to_left = num[mismatch] < numpy.array(
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2. # <<<<<<<<<<<<<<
- * index[mismatch] = index[mismatch] - 1 * nearest_to_left
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1153
- *
- * elif select == 'nearest':
- * nearest_to_left = num[mismatch] < numpy.array( # <<<<<<<<<<<<<<
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2.
- * index[mismatch] = index[mismatch] - 1 * nearest_to_left
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1154
- * elif select == 'nearest':
- * nearest_to_left = num[mismatch] < numpy.array(
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2. # <<<<<<<<<<<<<<
- * index[mismatch] = index[mismatch] - 1 * nearest_to_left
- *
- */
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyObject_GetItem(__pyx_v_index, __pyx_v_mismatch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
- __pyx_t_14 = __pyx_t_6; __Pyx_INCREF(__pyx_t_14); __pyx_t_10 = 0;
- __pyx_t_16 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1154, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (likely(!__pyx_t_16)) {
- if (likely(PyList_CheckExact(__pyx_t_14))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_14)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1154, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1154, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- }
- } else {
- __pyx_t_6 = __pyx_t_16(__pyx_t_14);
- if (unlikely(!__pyx_t_6)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 1154, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_GetItem(__pyx_v_nctime, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_19 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_19 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_v_nctime, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_20 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_20 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble((__pyx_t_19 + __pyx_t_20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_14)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_14) {
- __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
- __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
- __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_14); __pyx_t_14 = NULL;
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_t_13, __pyx_float_2_, 2., 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1154, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_15, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_nearest_to_left = __pyx_t_13;
- __pyx_t_13 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1155
- * nearest_to_left = num[mismatch] < numpy.array(
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2.
- * index[mismatch] = index[mismatch] - 1 * nearest_to_left # <<<<<<<<<<<<<<
- *
- * else:
- */
- __pyx_t_13 = PyObject_GetItem(__pyx_v_index, __pyx_v_mismatch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1155, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_8 = PyNumber_Multiply(__pyx_int_1, __pyx_v_nearest_to_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyNumber_Subtract(__pyx_t_13, __pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1155, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_v_mismatch, __pyx_t_15) < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1152
- * pass
- *
- * elif select == 'nearest': # <<<<<<<<<<<<<<
- * nearest_to_left = num[mismatch] < numpy.array(
- * [float(nctime[i - 1]) + float(nctime[i]) for i in index[mismatch]]) / 2.
- */
- goto __pyx_L37;
- }
-
- /* "netcdftime/_netcdftime.pyx":1158
- *
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * "%s is not an option for the `select` argument." % select)
- *
- */
- /*else*/ {
-
- /* "netcdftime/_netcdftime.pyx":1159
- * else:
- * raise ValueError(
- * "%s is not an option for the `select` argument." % select) # <<<<<<<<<<<<<<
- *
- * # Correct for indices equal to -1
- */
- __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_s_is_not_an_option_for_the_sele, __pyx_v_select); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1159, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
-
- /* "netcdftime/_netcdftime.pyx":1158
- *
- * else:
- * raise ValueError( # <<<<<<<<<<<<<<
- * "%s is not an option for the `select` argument." % select)
- *
- */
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_15);
- __pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_Raise(__pyx_t_15, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __PYX_ERR(0, 1158, __pyx_L1_error)
- }
- __pyx_L37:;
-
- /* "netcdftime/_netcdftime.pyx":1162
- *
- * # Correct for indices equal to -1
- * index[before] = 0 # <<<<<<<<<<<<<<
- *
- * # convert numpy scalars or single element arrays to python ints.
- */
- if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_v_before, __pyx_int_0) < 0)) __PYX_ERR(0, 1162, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1115
- * # If the times do not correspond, then it means that the times
- * # are not increasing uniformly and we try the bisection method.
- * if not _check_index(index, times, nctime, calendar, select): # <<<<<<<<<<<<<<
- *
- * # Use the bisection method. Assumes nctime is ordered.
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1165
- *
- * # convert numpy scalars or single element arrays to python ints.
- * return _toscalar(index) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_15 = __pyx_f_10netcdftime_11_netcdftime__toscalar(__pyx_v_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_r = __pyx_t_15;
- __pyx_t_15 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1060
- *
- *
- * def time2index(times, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * time2index(times, nctime, calendar=None, select='exact')
- */
-
- /* function exit code */
- __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_13);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_XDECREF(__pyx_t_17);
- __Pyx_AddTraceback("netcdftime._netcdftime.time2index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_num);
- __Pyx_XDECREF(__pyx_v_N);
- __Pyx_XDECREF(__pyx_v_t0);
- __Pyx_XDECREF(__pyx_v_t1);
- __Pyx_XDECREF(__pyx_v_dt);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_XDECREF(__pyx_v_bisect);
- __Pyx_XDECREF(__pyx_v_before);
- __Pyx_XDECREF(__pyx_v_after);
- __Pyx_XDECREF(__pyx_v_ncnum);
- __Pyx_XDECREF(__pyx_v_mismatch);
- __Pyx_XDECREF(__pyx_v_nearest_to_left);
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_calendar);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1168
- *
- *
- * cdef _toscalar(a): # <<<<<<<<<<<<<<
- * if a.shape in [(), (1,)]:
- * return a.item()
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__toscalar(PyObject *__pyx_v_a) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- __Pyx_RefNannySetupContext("_toscalar", 0);
-
- /* "netcdftime/_netcdftime.pyx":1169
- *
- * cdef _toscalar(a):
- * if a.shape in [(), (1,)]: # <<<<<<<<<<<<<<
- * return a.item()
- * else:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!__pyx_t_4) {
- } else {
- __pyx_t_2 = __pyx_t_4;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__22, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_2 = __pyx_t_4;
- __pyx_L4_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = (__pyx_t_2 != 0);
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1170
- * cdef _toscalar(a):
- * if a.shape in [(), (1,)]:
- * return a.item() # <<<<<<<<<<<<<<
- * else:
- * return a
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __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_ERR(0, 1170, __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;
-
- /* "netcdftime/_netcdftime.pyx":1169
- *
- * cdef _toscalar(a):
- * if a.shape in [(), (1,)]: # <<<<<<<<<<<<<<
- * return a.item()
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1172
- * return a.item()
- * else:
- * return a # <<<<<<<<<<<<<<
- *
- * cdef to_tuple(dt):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_a);
- __pyx_r = __pyx_v_a;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":1168
- *
- *
- * cdef _toscalar(a): # <<<<<<<<<<<<<<
- * if a.shape in [(), (1,)]:
- * return a.item()
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("netcdftime._netcdftime._toscalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1174
- * return a
- *
- * cdef to_tuple(dt): # <<<<<<<<<<<<<<
- * """Turn a datetime.datetime instance into a tuple of integers. Elements go
- * in the order of decreasing significance, making it easy to compare
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_to_tuple(PyObject *__pyx_v_dt) {
- 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 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- __Pyx_RefNannySetupContext("to_tuple", 0);
-
- /* "netcdftime/_netcdftime.pyx":1179
- * datetime instances. Parts of the state that don't affect ordering
- * are omitted. Compare to datetime.timetuple()."""
- * return (dt.year, dt.month, dt.day, dt.hour, dt.minute, # <<<<<<<<<<<<<<
- * dt.second, dt.microsecond)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netcdftime/_netcdftime.pyx":1180
- * are omitted. Compare to datetime.timetuple()."""
- * return (dt.year, dt.month, dt.day, dt.hour, dt.minute,
- * dt.second, dt.microsecond) # <<<<<<<<<<<<<<
- *
- * # a cache of converters (utime instances) for different calendars
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1180, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1180, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1179
- * datetime instances. Parts of the state that don't affect ordering
- * are omitted. Compare to datetime.timetuple()."""
- * return (dt.year, dt.month, dt.day, dt.hour, dt.minute, # <<<<<<<<<<<<<<
- * dt.second, dt.microsecond)
- *
- */
- __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1179, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1174
- * return a
- *
- * cdef to_tuple(dt): # <<<<<<<<<<<<<<
- * """Turn a datetime.datetime instance into a tuple of integers. Elements go
- * in the order of decreasing significance, making it easy to compare
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("netcdftime._netcdftime.to_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1204
- * cdef readonly bint datetime_compatible
- *
- * def __init__(self, int year, int month, int day, int hour=0, int minute=0, int second=0, # <<<<<<<<<<<<<<
- * int microsecond=0, int dayofwk=-1, int dayofyr=1):
- * """dayofyr set to 1 by default - otherwise time.strftime will complain"""
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_8datetime_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_8datetime___init__[] = "dayofyr set to 1 by default - otherwise time.strftime will complain";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_10netcdftime_11_netcdftime_8datetime___init__;
-#endif
-static int __pyx_pw_10netcdftime_11_netcdftime_8datetime_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- int __pyx_v_year;
- int __pyx_v_month;
- int __pyx_v_day;
- int __pyx_v_hour;
- int __pyx_v_minute;
- int __pyx_v_second;
- int __pyx_v_microsecond;
- int __pyx_v_dayofwk;
- int __pyx_v_dayofyr;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_year,&__pyx_n_s_month,&__pyx_n_s_day,&__pyx_n_s_hour,&__pyx_n_s_minute,&__pyx_n_s_second,&__pyx_n_s_microsecond,&__pyx_n_s_dayofwk,&__pyx_n_s_dayofyr,0};
- PyObject* values[9] = {0,0,0,0,0,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 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_year)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_month)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 9, 1); __PYX_ERR(0, 1204, __pyx_L3_error)
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_day)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 9, 2); __PYX_ERR(0, 1204, __pyx_L3_error)
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hour);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minute);
- if (value) { values[4] = value; kw_args--; }
- }
- case 5:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_second);
- if (value) { values[5] = value; kw_args--; }
- }
- case 6:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_microsecond);
- if (value) { values[6] = value; kw_args--; }
- }
- case 7:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayofwk);
- if (value) { values[7] = value; kw_args--; }
- }
- case 8:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayofyr);
- if (value) { values[8] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1204, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- 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_year = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- __pyx_v_month = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- if (values[3]) {
- __pyx_v_hour = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_hour == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- } else {
- __pyx_v_hour = ((int)0);
- }
- if (values[4]) {
- __pyx_v_minute = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_minute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- } else {
- __pyx_v_minute = ((int)0);
- }
- if (values[5]) {
- __pyx_v_second = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_second == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
- } else {
- __pyx_v_second = ((int)0);
- }
- if (values[6]) {
- __pyx_v_microsecond = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_microsecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1205, __pyx_L3_error)
- } else {
- __pyx_v_microsecond = ((int)0);
- }
- if (values[7]) {
- __pyx_v_dayofwk = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_dayofwk == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1205, __pyx_L3_error)
- } else {
- __pyx_v_dayofwk = ((int)-1);
- }
- if (values[8]) {
- __pyx_v_dayofyr = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_dayofyr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1205, __pyx_L3_error)
- } else {
- __pyx_v_dayofyr = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1204, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_dayofwk, __pyx_v_dayofyr);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_8datetime___init__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_dayofwk, int __pyx_v_dayofyr) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1208
- * """dayofyr set to 1 by default - otherwise time.strftime will complain"""
- *
- * self.year = year # <<<<<<<<<<<<<<
- * self.month = month
- * self.day = day
- */
- __pyx_v_self->year = __pyx_v_year;
-
- /* "netcdftime/_netcdftime.pyx":1209
- *
- * self.year = year
- * self.month = month # <<<<<<<<<<<<<<
- * self.day = day
- * self.hour = hour
- */
- __pyx_v_self->month = __pyx_v_month;
-
- /* "netcdftime/_netcdftime.pyx":1210
- * self.year = year
- * self.month = month
- * self.day = day # <<<<<<<<<<<<<<
- * self.hour = hour
- * self.minute = minute
- */
- __pyx_v_self->day = __pyx_v_day;
-
- /* "netcdftime/_netcdftime.pyx":1211
- * self.month = month
- * self.day = day
- * self.hour = hour # <<<<<<<<<<<<<<
- * self.minute = minute
- * self.dayofwk = dayofwk
- */
- __pyx_v_self->hour = __pyx_v_hour;
-
- /* "netcdftime/_netcdftime.pyx":1212
- * self.day = day
- * self.hour = hour
- * self.minute = minute # <<<<<<<<<<<<<<
- * self.dayofwk = dayofwk
- * self.dayofyr = dayofyr
- */
- __pyx_v_self->minute = __pyx_v_minute;
-
- /* "netcdftime/_netcdftime.pyx":1213
- * self.hour = hour
- * self.minute = minute
- * self.dayofwk = dayofwk # <<<<<<<<<<<<<<
- * self.dayofyr = dayofyr
- * self.second = second
- */
- __pyx_v_self->dayofwk = __pyx_v_dayofwk;
-
- /* "netcdftime/_netcdftime.pyx":1214
- * self.minute = minute
- * self.dayofwk = dayofwk
- * self.dayofyr = dayofyr # <<<<<<<<<<<<<<
- * self.second = second
- * self.microsecond = microsecond
- */
- __pyx_v_self->dayofyr = __pyx_v_dayofyr;
-
- /* "netcdftime/_netcdftime.pyx":1215
- * self.dayofwk = dayofwk
- * self.dayofyr = dayofyr
- * self.second = second # <<<<<<<<<<<<<<
- * self.microsecond = microsecond
- * self.calendar = ""
- */
- __pyx_v_self->second = __pyx_v_second;
-
- /* "netcdftime/_netcdftime.pyx":1216
- * self.dayofyr = dayofyr
- * self.second = second
- * self.microsecond = microsecond # <<<<<<<<<<<<<<
- * self.calendar = ""
- *
- */
- __pyx_v_self->microsecond = __pyx_v_microsecond;
-
- /* "netcdftime/_netcdftime.pyx":1217
- * self.second = second
- * self.microsecond = microsecond
- * self.calendar = "" # <<<<<<<<<<<<<<
- *
- * self.datetime_compatible = True
- */
- __Pyx_INCREF(__pyx_kp_s__23);
- __Pyx_GIVEREF(__pyx_kp_s__23);
- __Pyx_GOTREF(__pyx_v_self->calendar);
- __Pyx_DECREF(__pyx_v_self->calendar);
- __pyx_v_self->calendar = __pyx_kp_s__23;
-
- /* "netcdftime/_netcdftime.pyx":1219
- * self.calendar = ""
- *
- * self.datetime_compatible = True # <<<<<<<<<<<<<<
- *
- * @property
- */
- __pyx_v_self->datetime_compatible = 1;
-
- /* "netcdftime/_netcdftime.pyx":1204
- * cdef readonly bint datetime_compatible
- *
- * def __init__(self, int year, int month, int day, int hour=0, int minute=0, int second=0, # <<<<<<<<<<<<<<
- * int microsecond=0, int dayofwk=-1, int dayofyr=1):
- * """dayofyr set to 1 by default - otherwise time.strftime will complain"""
- */
-
- /* function exit code */
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1222
- *
- * @property
- * def format(self): # <<<<<<<<<<<<<<
- * return '%Y-%m-%d %H:%M:%S'
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6format_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_6format___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6format___get__(CYTHON_UNUSED struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1223
- * @property
- * def format(self):
- * return '%Y-%m-%d %H:%M:%S' # <<<<<<<<<<<<<<
- *
- * def strftime(self, format=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_kp_s_Y_m_d_H_M_S);
- __pyx_r = __pyx_kp_s_Y_m_d_H_M_S;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1222
- *
- * @property
- * def format(self): # <<<<<<<<<<<<<<
- * return '%Y-%m-%d %H:%M:%S'
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1225
- * return '%Y-%m-%d %H:%M:%S'
- *
- * def strftime(self, format=None): # <<<<<<<<<<<<<<
- * if format is None:
- * format = self.format
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_3strftime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_3strftime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_format = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("strftime (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format,0};
- PyObject* values[1] = {0};
- values[0] = ((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 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, "strftime") < 0)) __PYX_ERR(0, 1225, __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("strftime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1225, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.strftime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_2strftime(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_format);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_2strftime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, PyObject *__pyx_v_format) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("strftime", 0);
- __Pyx_INCREF(__pyx_v_format);
-
- /* "netcdftime/_netcdftime.pyx":1226
- *
- * def strftime(self, format=None):
- * if format is None: # <<<<<<<<<<<<<<
- * format = self.format
- * return _strftime(self, format)
- */
- __pyx_t_1 = (__pyx_v_format == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1227
- * def strftime(self, format=None):
- * if format is None:
- * format = self.format # <<<<<<<<<<<<<<
- * return _strftime(self, format)
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1226
- *
- * def strftime(self, format=None):
- * if format is None: # <<<<<<<<<<<<<<
- * format = self.format
- * return _strftime(self, format)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1228
- * if format is None:
- * format = self.format
- * return _strftime(self, format) # <<<<<<<<<<<<<<
- *
- * def replace(self, **kwargs):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_10netcdftime_11_netcdftime__strftime(__pyx_v_self, __pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1225
- * return '%Y-%m-%d %H:%M:%S'
- *
- * def strftime(self, format=None): # <<<<<<<<<<<<<<
- * if format is None:
- * format = self.format
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.strftime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_format);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1230
- * return _strftime(self, format)
- *
- * def replace(self, **kwargs): # <<<<<<<<<<<<<<
- * "Return datetime with new specified fields."
- * args = {"year": self.year,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_5replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_8datetime_4replace[] = "Return datetime with new specified fields.";
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_5replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_kwargs = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("replace (wrapper)", 0);
- if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
- __Pyx_RaiseArgtupleInvalid("replace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
- if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "replace", 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_10netcdftime_11_netcdftime_8datetime_4replace(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4replace(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, PyObject *__pyx_v_kwargs) {
- PyObject *__pyx_v_args = NULL;
- PyObject *__pyx_v_name = NULL;
- PyObject *__pyx_v_value = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- __Pyx_RefNannySetupContext("replace", 0);
-
- /* "netcdftime/_netcdftime.pyx":1232
- * def replace(self, **kwargs):
- * "Return datetime with new specified fields."
- * args = {"year": self.year, # <<<<<<<<<<<<<<
- * "month": self.month,
- * "day": self.day,
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_year, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1233
- * "Return datetime with new specified fields."
- * args = {"year": self.year,
- * "month": self.month, # <<<<<<<<<<<<<<
- * "day": self.day,
- * "hour": self.hour,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_month, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1234
- * args = {"year": self.year,
- * "month": self.month,
- * "day": self.day, # <<<<<<<<<<<<<<
- * "hour": self.hour,
- * "minute": self.minute,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_day, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1235
- * "month": self.month,
- * "day": self.day,
- * "hour": self.hour, # <<<<<<<<<<<<<<
- * "minute": self.minute,
- * "second": self.second,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hour, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1236
- * "day": self.day,
- * "hour": self.hour,
- * "minute": self.minute, # <<<<<<<<<<<<<<
- * "second": self.second,
- * "microsecond": self.microsecond,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minute, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1237
- * "hour": self.hour,
- * "minute": self.minute,
- * "second": self.second, # <<<<<<<<<<<<<<
- * "microsecond": self.microsecond,
- * "dayofwk": self.dayofwk,
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_second, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1238
- * "minute": self.minute,
- * "second": self.second,
- * "microsecond": self.microsecond, # <<<<<<<<<<<<<<
- * "dayofwk": self.dayofwk,
- * "dayofyr": self.dayofyr}
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->microsecond); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_microsecond, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1239
- * "second": self.second,
- * "microsecond": self.microsecond,
- * "dayofwk": self.dayofwk, # <<<<<<<<<<<<<<
- * "dayofyr": self.dayofyr}
- *
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->dayofwk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dayofwk, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1240
- * "microsecond": self.microsecond,
- * "dayofwk": self.dayofwk,
- * "dayofyr": self.dayofyr} # <<<<<<<<<<<<<<
- *
- * for name, value in kwargs.items():
- */
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->dayofyr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dayofyr, __pyx_t_2) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_args = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1242
- * "dayofyr": self.dayofyr}
- *
- * for name, value in kwargs.items(): # <<<<<<<<<<<<<<
- * args[name] = value
- *
- */
- __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- 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_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1242, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1242, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1242, __pyx_L1_error)
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- #endif
- }
- } else {
- __pyx_t_1 = __pyx_t_4(__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_ERR(0, 1242, __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_PYPY
- 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_ERR(0, 1242, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- 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_ERR(0, 1242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __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_ERR(0, 1242, __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_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_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_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1242, __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_ERR(0, 1242, __pyx_L1_error)
- __pyx_L6_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1243
- *
- * for name, value in kwargs.items():
- * args[name] = value # <<<<<<<<<<<<<<
- *
- * return self.__class__(**args)
- */
- if (unlikely(PyDict_SetItem(__pyx_v_args, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1243, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1242
- * "dayofyr": self.dayofyr}
- *
- * for name, value in kwargs.items(): # <<<<<<<<<<<<<<
- * args[name] = value
- *
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1245
- * args[name] = value
- *
- * return self.__class__(**args) # <<<<<<<<<<<<<<
- *
- * def timetuple(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1245, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __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;
-
- /* "netcdftime/_netcdftime.pyx":1230
- * return _strftime(self, format)
- *
- * def replace(self, **kwargs): # <<<<<<<<<<<<<<
- * "Return datetime with new specified fields."
- * args = {"year": self.year,
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.datetime.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_name);
- __Pyx_XDECREF(__pyx_v_value);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1247
- * return self.__class__(**args)
- *
- * def timetuple(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7timetuple(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7timetuple(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("timetuple (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_6timetuple(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6timetuple(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__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;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- __Pyx_RefNannySetupContext("timetuple", 0);
-
- /* "netcdftime/_netcdftime.pyx":1248
- *
- * def timetuple(self):
- * return (self.year, self.month, self.day, self.hour, # <<<<<<<<<<<<<<
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "netcdftime/_netcdftime.pyx":1249
- * def timetuple(self):
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1) # <<<<<<<<<<<<<<
- *
- * cpdef _to_real_datetime(self):
- */
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->dayofwk); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1249, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->dayofyr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netcdftime/_netcdftime.pyx":1248
- *
- * def timetuple(self):
- * return (self.year, self.month, self.day, self.hour, # <<<<<<<<<<<<<<
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- *
- */
- __pyx_t_9 = PyTuple_New(9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1248, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_int_neg_1);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_8 = 0;
- __pyx_r = __pyx_t_9;
- __pyx_t_9 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1247
- * return self.__class__(**args)
- *
- * def timetuple(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.timetuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1251
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- *
- * cpdef _to_real_datetime(self): # <<<<<<<<<<<<<<
- * return real_datetime(self.year, self.month, self.day,
- * self.hour, self.minute, self.second,
- */
-
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_9_to_real_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__to_real_datetime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, int __pyx_skip_dispatch) {
- 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 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- __Pyx_RefNannySetupContext("_to_real_datetime", 0);
- /* Check if called by wrapper */
- if (unlikely(__pyx_skip_dispatch)) ;
- /* Check if overridden in Python */
- else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_real_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_9_to_real_datetime)) {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __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_ERR(0, 1251, __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;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
-
- /* "netcdftime/_netcdftime.pyx":1252
- *
- * cpdef _to_real_datetime(self):
- * return real_datetime(self.year, self.month, self.day, # <<<<<<<<<<<<<<
- * self.hour, self.minute, self.second,
- * self.microsecond)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netcdftime/_netcdftime.pyx":1253
- * cpdef _to_real_datetime(self):
- * return real_datetime(self.year, self.month, self.day,
- * self.hour, self.minute, self.second, # <<<<<<<<<<<<<<
- * self.microsecond)
- *
- */
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1253, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1253, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1253, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
-
- /* "netcdftime/_netcdftime.pyx":1254
- * return real_datetime(self.year, self.month, self.day,
- * self.hour, self.minute, self.second,
- * self.microsecond) # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->microsecond); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1254, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = NULL;
- __pyx_t_11 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_11 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(7+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_10) {
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_11, __pyx_t_9);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_8 = 0;
- __pyx_t_9 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1251
- * self.minute, self.second, self.dayofwk, self.dayofyr, -1)
- *
- * cpdef _to_real_datetime(self): # <<<<<<<<<<<<<<
- * return real_datetime(self.year, self.month, self.day,
- * self.hour, self.minute, self.second,
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime._to_real_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_9_to_real_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_9_to_real_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_to_real_datetime (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_8_to_real_datetime(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_8_to_real_datetime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("_to_real_datetime", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_8datetime__to_real_datetime(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __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("netcdftime._netcdftime.datetime._to_real_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1256
- * self.microsecond)
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "{0}.{1}{2}".format(self.__class__.__module__,
- * self.__class__.__name__,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_10__repr__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_10__repr__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__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;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1257
- *
- * def __repr__(self):
- * return "{0}.{1}{2}".format(self.__class__.__module__, # <<<<<<<<<<<<<<
- * self.__class__.__name__,
- * self._getstate())
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1258
- * def __repr__(self):
- * return "{0}.{1}{2}".format(self.__class__.__module__,
- * self.__class__.__name__, # <<<<<<<<<<<<<<
- * self._getstate())
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1258, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1259
- * return "{0}.{1}{2}".format(self.__class__.__module__,
- * self.__class__.__name__,
- * self._getstate()) # <<<<<<<<<<<<<<
- *
- * def __str__(self):
- */
- __pyx_t_3 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_self->__pyx_vtab)->_getstate(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(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_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_t_5, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __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_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_3);
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1256
- * self.microsecond)
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "{0}.{1}{2}".format(self.__class__.__module__,
- * self.__class__.__name__,
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1261
- * self._getstate())
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return self.strftime(self.format)
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_12__str__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_12__str__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__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;
- __Pyx_RefNannySetupContext("__str__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1262
- *
- * def __str__(self):
- * return self.strftime(self.format) # <<<<<<<<<<<<<<
- *
- * def __hash__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strftime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __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_3);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __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_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1261
- * self._getstate())
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return self.strftime(self.format)
- *
- */
-
- /* 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("netcdftime._netcdftime.datetime.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1264
- * return self.strftime(self.format)
- *
- * def __hash__(self): # <<<<<<<<<<<<<<
- * try:
- * d = self._to_real_datetime()
- */
-
-/* Python wrapper */
-static Py_hash_t __pyx_pw_10netcdftime_11_netcdftime_8datetime_15__hash__(PyObject *__pyx_v_self); /*proto*/
-static Py_hash_t __pyx_pw_10netcdftime_11_netcdftime_8datetime_15__hash__(PyObject *__pyx_v_self) {
- Py_hash_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_14__hash__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static Py_hash_t __pyx_pf_10netcdftime_11_netcdftime_8datetime_14__hash__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_v_d = NULL;
- Py_hash_t __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;
- 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;
- Py_hash_t __pyx_t_11;
- __Pyx_RefNannySetupContext("__hash__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1265
- *
- * def __hash__(self):
- * try: # <<<<<<<<<<<<<<
- * d = self._to_real_datetime()
- * except ValueError:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __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:*/ {
-
- /* "netcdftime/_netcdftime.pyx":1266
- * def __hash__(self):
- * try:
- * d = self._to_real_datetime() # <<<<<<<<<<<<<<
- * except ValueError:
- * return hash(self.timetuple())
- */
- __pyx_t_4 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_self->__pyx_vtab)->_to_real_datetime(__pyx_v_self, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_v_d = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1265
- *
- * def __hash__(self):
- * try: # <<<<<<<<<<<<<<
- * d = self._to_real_datetime()
- * except ValueError:
- */
- }
- __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_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1267
- * try:
- * d = self._to_real_datetime()
- * except ValueError: # <<<<<<<<<<<<<<
- * return hash(self.timetuple())
- * return hash(d)
- */
- __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
- if (__pyx_t_5) {
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1267, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1268
- * d = self._to_real_datetime()
- * except ValueError:
- * return hash(self.timetuple()) # <<<<<<<<<<<<<<
- * return hash(d)
- *
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_timetuple); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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);
- }
- }
- if (__pyx_t_10) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L5_except_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L5_except_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_11 = PyObject_Hash(__pyx_t_8); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1268, __pyx_L5_except_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_r = __pyx_t_11;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L6_except_return;
- }
- goto __pyx_L5_except_error;
- __pyx_L5_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":1265
- *
- * def __hash__(self):
- * try: # <<<<<<<<<<<<<<
- * d = self._to_real_datetime()
- * except ValueError:
- */
- __Pyx_PyThreadState_assign
- __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_L6_except_return:;
- __Pyx_PyThreadState_assign
- __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_L0;
- __pyx_L10_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1269
- * except ValueError:
- * return hash(self.timetuple())
- * return hash(d) # <<<<<<<<<<<<<<
- *
- * cdef to_tuple(self):
- */
- __pyx_t_11 = PyObject_Hash(__pyx_v_d); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1269, __pyx_L1_error)
- __pyx_r = __pyx_t_11;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1264
- * return self.strftime(self.format)
- *
- * def __hash__(self): # <<<<<<<<<<<<<<
- * try:
- * d = self._to_real_datetime()
- */
-
- /* function exit code */
- __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_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_d);
- if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1271
- * return hash(d)
- *
- * cdef to_tuple(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour, self.minute,
- * self.second, self.microsecond)
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime_to_tuple(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__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;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- __Pyx_RefNannySetupContext("to_tuple", 0);
-
- /* "netcdftime/_netcdftime.pyx":1272
- *
- * cdef to_tuple(self):
- * return (self.year, self.month, self.day, self.hour, self.minute, # <<<<<<<<<<<<<<
- * self.second, self.microsecond)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "netcdftime/_netcdftime.pyx":1273
- * cdef to_tuple(self):
- * return (self.year, self.month, self.day, self.hour, self.minute,
- * self.second, self.microsecond) # <<<<<<<<<<<<<<
- *
- * def __richcmp__(self, other, int op):
- */
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->microsecond); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1272
- *
- * cdef to_tuple(self):
- * return (self.year, self.month, self.day, self.hour, self.minute, # <<<<<<<<<<<<<<
- * self.second, self.microsecond)
- *
- */
- __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1272, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1271
- * return hash(d)
- *
- * cdef to_tuple(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour, self.minute,
- * self.second, self.microsecond)
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.to_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1275
- * self.second, self.microsecond)
- *
- * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
- * cdef datetime dt, dt_other
- * dt = self
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_17__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_17__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_16__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_16__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt = 0;
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt_other = 0;
- 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;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- __Pyx_RefNannySetupContext("__richcmp__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1277
- * def __richcmp__(self, other, int op):
- * cdef datetime dt, dt_other
- * dt = self # <<<<<<<<<<<<<<
- * if isinstance(other, datetime):
- * dt_other = other
- */
- if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10netcdftime_11_netcdftime_datetime))))) __PYX_ERR(0, 1277, __pyx_L1_error)
- __pyx_t_1 = __pyx_v_self;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v_dt = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1278
- * cdef datetime dt, dt_other
- * dt = self
- * if isinstance(other, datetime): # <<<<<<<<<<<<<<
- * dt_other = other
- * # comparing two datetime instances
- */
- __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_10netcdftime_11_netcdftime_datetime);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1279
- * dt = self
- * if isinstance(other, datetime):
- * dt_other = other # <<<<<<<<<<<<<<
- * # comparing two datetime instances
- * if dt.calendar == dt_other.calendar:
- */
- if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10netcdftime_11_netcdftime_datetime))))) __PYX_ERR(0, 1279, __pyx_L1_error)
- __pyx_t_1 = __pyx_v_other;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v_dt_other = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1281
- * dt_other = other
- * # comparing two datetime instances
- * if dt.calendar == dt_other.calendar: # <<<<<<<<<<<<<<
- * return PyObject_RichCompare(dt.to_tuple(), dt_other.to_tuple(), op)
- * else:
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_dt->calendar, __pyx_v_dt_other->calendar, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1281, __pyx_L1_error)
- __pyx_t_2 = (__pyx_t_3 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1282
- * # comparing two datetime instances
- * if dt.calendar == dt_other.calendar:
- * return PyObject_RichCompare(dt.to_tuple(), dt_other.to_tuple(), op) # <<<<<<<<<<<<<<
- * else:
- * # Note: it *is* possible to compare datetime
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt->__pyx_vtab)->to_tuple(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt_other->__pyx_vtab)->to_tuple(__pyx_v_dt_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, __pyx_v_op); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1282, __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_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1281
- * dt_other = other
- * # comparing two datetime instances
- * if dt.calendar == dt_other.calendar: # <<<<<<<<<<<<<<
- * return PyObject_RichCompare(dt.to_tuple(), dt_other.to_tuple(), op)
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1288
- * # utime.date2num(), but this implementation does
- * # not attempt it.
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(dt, dt_other)) # <<<<<<<<<<<<<<
- * elif isinstance(other, real_datetime):
- * # comparing datetime and real_datetime
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_compare_0_r_and_1_r_diffe, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dt), ((PyObject *)__pyx_v_dt_other)};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1288, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dt), ((PyObject *)__pyx_v_dt_other)};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1288, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1288, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_dt));
- __Pyx_INCREF(((PyObject *)__pyx_v_dt_other));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt_other));
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_dt_other));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __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 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1288, __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_ERR(0, 1288, __pyx_L1_error)
- }
-
- /* "netcdftime/_netcdftime.pyx":1278
- * cdef datetime dt, dt_other
- * dt = self
- * if isinstance(other, datetime): # <<<<<<<<<<<<<<
- * dt_other = other
- * # comparing two datetime instances
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1289
- * # not attempt it.
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(dt, dt_other))
- * elif isinstance(other, real_datetime): # <<<<<<<<<<<<<<
- * # comparing datetime and real_datetime
- * if not dt.datetime_compatible:
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_5); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1289, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1291
- * elif isinstance(other, real_datetime):
- * # comparing datetime and real_datetime
- * if not dt.datetime_compatible: # <<<<<<<<<<<<<<
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(self, other))
- * return PyObject_RichCompare(dt.to_tuple(), to_tuple(other), op)
- */
- __pyx_t_3 = ((!(__pyx_v_dt->datetime_compatible != 0)) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1292
- * # comparing datetime and real_datetime
- * if not dt.datetime_compatible:
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(self, other)) # <<<<<<<<<<<<<<
- * return PyObject_RichCompare(dt.to_tuple(), to_tuple(other), op)
- * else:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_compare_0_r_and_1_r_diffe, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && likely(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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self, __pyx_v_other};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1292, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self, __pyx_v_other};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1292, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __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_self);
- __Pyx_GIVEREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_self);
- __Pyx_INCREF(__pyx_v_other);
- __Pyx_GIVEREF(__pyx_v_other);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_other);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1292, __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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __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 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1292, __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_ERR(0, 1292, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1291
- * elif isinstance(other, real_datetime):
- * # comparing datetime and real_datetime
- * if not dt.datetime_compatible: # <<<<<<<<<<<<<<
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(self, other))
- * return PyObject_RichCompare(dt.to_tuple(), to_tuple(other), op)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1293
- * if not dt.datetime_compatible:
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(self, other))
- * return PyObject_RichCompare(dt.to_tuple(), to_tuple(other), op) # <<<<<<<<<<<<<<
- * else:
- * raise TypeError("cannot compare {0!r} and {1!r}".format(self, other))
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt->__pyx_vtab)->to_tuple(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __pyx_f_10netcdftime_11_netcdftime_to_tuple(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1293, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, __pyx_v_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __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_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1289
- * # not attempt it.
- * raise TypeError("cannot compare {0!r} and {1!r} (different calendars)".format(dt, dt_other))
- * elif isinstance(other, real_datetime): # <<<<<<<<<<<<<<
- * # comparing datetime and real_datetime
- * if not dt.datetime_compatible:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1295
- * return PyObject_RichCompare(dt.to_tuple(), to_tuple(other), op)
- * else:
- * raise TypeError("cannot compare {0!r} and {1!r}".format(self, other)) # <<<<<<<<<<<<<<
- *
- * cdef _getstate(self):
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_compare_0_r_and_1_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && 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;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_other};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_other};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1295, __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_self);
- __Pyx_GIVEREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
- __Pyx_INCREF(__pyx_v_other);
- __Pyx_GIVEREF(__pyx_v_other);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_other);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __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_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __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_ERR(0, 1295, __pyx_L1_error)
- }
-
- /* "netcdftime/_netcdftime.pyx":1275
- * self.second, self.microsecond)
- *
- * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
- * cdef datetime dt, dt_other
- * dt = self
- */
-
- /* 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_7);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_dt);
- __Pyx_XDECREF((PyObject *)__pyx_v_dt_other);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1297
- * raise TypeError("cannot compare {0!r} and {1!r}".format(self, other))
- *
- * cdef _getstate(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.microsecond,
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__getstate(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__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;
- 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;
- __Pyx_RefNannySetupContext("_getstate", 0);
-
- /* "netcdftime/_netcdftime.pyx":1298
- *
- * cdef _getstate(self):
- * return (self.year, self.month, self.day, self.hour, # <<<<<<<<<<<<<<
- * self.minute, self.second, self.microsecond,
- * self.dayofwk, self.dayofyr)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "netcdftime/_netcdftime.pyx":1299
- * cdef _getstate(self):
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.microsecond, # <<<<<<<<<<<<<<
- * self.dayofwk, self.dayofyr)
- *
- */
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1299, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->microsecond); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":1300
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.microsecond,
- * self.dayofwk, self.dayofyr) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->dayofwk); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->dayofyr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1300, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
-
- /* "netcdftime/_netcdftime.pyx":1298
- *
- * cdef _getstate(self):
- * return (self.year, self.month, self.day, self.hour, # <<<<<<<<<<<<<<
- * self.minute, self.second, self.microsecond,
- * self.dayofwk, self.dayofyr)
- */
- __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1298, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_8 = 0;
- __pyx_t_9 = 0;
- __pyx_r = __pyx_t_10;
- __pyx_t_10 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1297
- * raise TypeError("cannot compare {0!r} and {1!r}".format(self, other))
- *
- * cdef _getstate(self): # <<<<<<<<<<<<<<
- * return (self.year, self.month, self.day, self.hour,
- * self.minute, self.second, self.microsecond,
- */
-
- /* 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_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime._getstate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1302
- * self.dayofwk, self.dayofyr)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * """special method that allows instance to be pickled"""
- * return (self.__class__, self._getstate())
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_19__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_10netcdftime_11_netcdftime_8datetime_18__reduce__[] = "special method that allows instance to be pickled";
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_19__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_18__reduce__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_18__reduce__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1304
- * def __reduce__(self):
- * """special method that allows instance to be pickled"""
- * return (self.__class__, self._getstate()) # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, other):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_self->__pyx_vtab)->_getstate(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1302
- * self.dayofwk, self.dayofyr)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * """special method that allows instance to be pickled"""
- * return (self.__class__, self._getstate())
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1306
- * return (self.__class__, self._getstate())
- *
- * cdef _add_timedelta(self, other): # <<<<<<<<<<<<<<
- * return NotImplemented
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_8datetime__add_timedelta(CYTHON_UNUSED struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1307
- *
- * cdef _add_timedelta(self, other):
- * return NotImplemented # <<<<<<<<<<<<<<
- *
- * def __add__(self, other):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_builtin_NotImplemented);
- __pyx_r = __pyx_builtin_NotImplemented;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1306
- * return (self.__class__, self._getstate())
- *
- * cdef _add_timedelta(self, other): # <<<<<<<<<<<<<<
- * return NotImplemented
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1309
- * return NotImplemented
- *
- * def __add__(self, other): # <<<<<<<<<<<<<<
- * cdef datetime dt
- * if isinstance(self, datetime) and isinstance(other, timedelta):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_21__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_21__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_20__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_20__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt = 0;
- PyObject *__pyx_v_delta = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- __Pyx_RefNannySetupContext("__add__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1311
- * def __add__(self, other):
- * cdef datetime dt
- * if isinstance(self, datetime) and isinstance(other, timedelta): # <<<<<<<<<<<<<<
- * dt = self
- * delta = other
- */
- __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_10netcdftime_11_netcdftime_datetime);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_1 = __pyx_t_3;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1311, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1311, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = (__pyx_t_3 != 0);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L4_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1312
- * cdef datetime dt
- * if isinstance(self, datetime) and isinstance(other, timedelta):
- * dt = self # <<<<<<<<<<<<<<
- * delta = other
- * elif isinstance(self, timedelta) and isinstance(other, datetime):
- */
- if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10netcdftime_11_netcdftime_datetime))))) __PYX_ERR(0, 1312, __pyx_L1_error)
- __pyx_t_4 = __pyx_v_self;
- __Pyx_INCREF(__pyx_t_4);
- __pyx_v_dt = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1313
- * if isinstance(self, datetime) and isinstance(other, timedelta):
- * dt = self
- * delta = other # <<<<<<<<<<<<<<
- * elif isinstance(self, timedelta) and isinstance(other, datetime):
- * dt = other
- */
- __Pyx_INCREF(__pyx_v_other);
- __pyx_v_delta = __pyx_v_other;
-
- /* "netcdftime/_netcdftime.pyx":1311
- * def __add__(self, other):
- * cdef datetime dt
- * if isinstance(self, datetime) and isinstance(other, timedelta): # <<<<<<<<<<<<<<
- * dt = self
- * delta = other
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":1314
- * dt = self
- * delta = other
- * elif isinstance(self, timedelta) and isinstance(other, datetime): # <<<<<<<<<<<<<<
- * dt = other
- * delta = self
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_self, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1314, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_1 = __pyx_t_3;
- goto __pyx_L6_bool_binop_done;
- }
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_10netcdftime_11_netcdftime_datetime);
- __pyx_t_2 = (__pyx_t_3 != 0);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L6_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1315
- * delta = other
- * elif isinstance(self, timedelta) and isinstance(other, datetime):
- * dt = other # <<<<<<<<<<<<<<
- * delta = self
- * else:
- */
- if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10netcdftime_11_netcdftime_datetime))))) __PYX_ERR(0, 1315, __pyx_L1_error)
- __pyx_t_4 = __pyx_v_other;
- __Pyx_INCREF(__pyx_t_4);
- __pyx_v_dt = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1316
- * elif isinstance(self, timedelta) and isinstance(other, datetime):
- * dt = other
- * delta = self # <<<<<<<<<<<<<<
- * else:
- * return NotImplemented
- */
- __Pyx_INCREF(__pyx_v_self);
- __pyx_v_delta = __pyx_v_self;
-
- /* "netcdftime/_netcdftime.pyx":1314
- * dt = self
- * delta = other
- * elif isinstance(self, timedelta) and isinstance(other, datetime): # <<<<<<<<<<<<<<
- * dt = other
- * delta = self
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":1318
- * delta = self
- * else:
- * return NotImplemented # <<<<<<<<<<<<<<
- * return dt._add_timedelta(delta)
- *
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_builtin_NotImplemented);
- __pyx_r = __pyx_builtin_NotImplemented;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- /* "netcdftime/_netcdftime.pyx":1319
- * else:
- * return NotImplemented
- * return dt._add_timedelta(delta) # <<<<<<<<<<<<<<
- *
- * def __sub__(self, other):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt->__pyx_vtab)->_add_timedelta(__pyx_v_dt, __pyx_v_delta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1309
- * return NotImplemented
- *
- * def __add__(self, other): # <<<<<<<<<<<<<<
- * cdef datetime dt
- * if isinstance(self, datetime) and isinstance(other, timedelta):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_dt);
- __Pyx_XDECREF(__pyx_v_delta);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1321
- * return dt._add_timedelta(delta)
- *
- * def __sub__(self, other): # <<<<<<<<<<<<<<
- * cdef datetime dt
- * if isinstance(self, datetime): # left arg is a datetime instance
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_23__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_23__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_22__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_22__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt = 0;
- PyObject *__pyx_v_converter = NULL;
- 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;
- __Pyx_RefNannySetupContext("__sub__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1323
- * def __sub__(self, other):
- * cdef datetime dt
- * if isinstance(self, datetime): # left arg is a datetime instance # <<<<<<<<<<<<<<
- * dt = self
- * if isinstance(other, datetime):
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_10netcdftime_11_netcdftime_datetime);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1324
- * cdef datetime dt
- * if isinstance(self, datetime): # left arg is a datetime instance
- * dt = self # <<<<<<<<<<<<<<
- * if isinstance(other, datetime):
- * # datetime - datetime
- */
- if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10netcdftime_11_netcdftime_datetime))))) __PYX_ERR(0, 1324, __pyx_L1_error)
- __pyx_t_3 = __pyx_v_self;
- __Pyx_INCREF(__pyx_t_3);
- __pyx_v_dt = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1325
- * if isinstance(self, datetime): # left arg is a datetime instance
- * dt = self
- * if isinstance(other, datetime): # <<<<<<<<<<<<<<
- * # datetime - datetime
- * if dt.calendar != other.calendar:
- */
- __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_10netcdftime_11_netcdftime_datetime);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1327
- * if isinstance(other, datetime):
- * # datetime - datetime
- * if dt.calendar != other.calendar: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "":
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_dt->calendar, __pyx_t_3, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1327, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1328
- * # datetime - datetime
- * if dt.calendar != other.calendar:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * if dt.calendar == "":
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- */
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __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_ERR(0, 1328, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1327
- * if isinstance(other, datetime):
- * # datetime - datetime
- * if dt.calendar != other.calendar: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "":
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1329
- * if dt.calendar != other.calendar:
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "": # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- * converter = _converters[dt.calendar]
- */
- __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_dt->calendar, __pyx_kp_s__23, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1329, __pyx_L1_error)
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1330
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "":
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware") # <<<<<<<<<<<<<<
- * converter = _converters[dt.calendar]
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other))
- */
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __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_ERR(0, 1330, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1329
- * if dt.calendar != other.calendar:
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "": # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- * converter = _converters[dt.calendar]
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1331
- * if dt.calendar == "":
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- * converter = _converters[dt.calendar] # <<<<<<<<<<<<<<
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other))
- * elif isinstance(other, real_datetime):
- */
- if (unlikely(__pyx_v_10netcdftime_11_netcdftime__converters == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- __PYX_ERR(0, 1331, __pyx_L1_error)
- }
- __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_10netcdftime_11_netcdftime__converters, __pyx_v_dt->calendar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_converter = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1332
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- * converter = _converters[dt.calendar]
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other)) # <<<<<<<<<<<<<<
- * elif isinstance(other, real_datetime):
- * # datetime - real_datetime
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_converter, __pyx_n_s_date2num); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else
- #endif
- {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_dt));
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_converter, __pyx_n_s_date2num); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_other};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_other};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_6);
- } else
- #endif
- {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
- __Pyx_INCREF(__pyx_v_other);
- __Pyx_GIVEREF(__pyx_v_other);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_other);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_seconds, __pyx_t_8) < 0) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1325
- * if isinstance(self, datetime): # left arg is a datetime instance
- * dt = self
- * if isinstance(other, datetime): # <<<<<<<<<<<<<<
- * # datetime - datetime
- * if dt.calendar != other.calendar:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1333
- * converter = _converters[dt.calendar]
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other))
- * elif isinstance(other, real_datetime): # <<<<<<<<<<<<<<
- * # datetime - real_datetime
- * if not dt.datetime_compatible:
- */
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_8); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1333, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1335
- * elif isinstance(other, real_datetime):
- * # datetime - real_datetime
- * if not dt.datetime_compatible: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return dt._to_real_datetime() - other
- */
- __pyx_t_1 = ((!(__pyx_v_dt->datetime_compatible != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1336
- * # datetime - real_datetime
- * if not dt.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * return dt._to_real_datetime() - other
- * elif isinstance(other, timedelta):
- */
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1336, __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_ERR(0, 1336, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1335
- * elif isinstance(other, real_datetime):
- * # datetime - real_datetime
- * if not dt.datetime_compatible: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return dt._to_real_datetime() - other
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1337
- * if not dt.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return dt._to_real_datetime() - other # <<<<<<<<<<<<<<
- * elif isinstance(other, timedelta):
- * # datetime - timedelta
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_8 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt->__pyx_vtab)->_to_real_datetime(__pyx_v_dt, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1333
- * converter = _converters[dt.calendar]
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other))
- * elif isinstance(other, real_datetime): # <<<<<<<<<<<<<<
- * # datetime - real_datetime
- * if not dt.datetime_compatible:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1338
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return dt._to_real_datetime() - other
- * elif isinstance(other, timedelta): # <<<<<<<<<<<<<<
- * # datetime - timedelta
- * return dt._add_timedelta(-other)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1338, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1340
- * elif isinstance(other, timedelta):
- * # datetime - timedelta
- * return dt._add_timedelta(-other) # <<<<<<<<<<<<<<
- * else:
- * return NotImplemented
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime *)__pyx_v_dt->__pyx_vtab)->_add_timedelta(__pyx_v_dt, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1338
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return dt._to_real_datetime() - other
- * elif isinstance(other, timedelta): # <<<<<<<<<<<<<<
- * # datetime - timedelta
- * return dt._add_timedelta(-other)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1342
- * return dt._add_timedelta(-other)
- * else:
- * return NotImplemented # <<<<<<<<<<<<<<
- * else:
- * if isinstance(self, real_datetime):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_builtin_NotImplemented);
- __pyx_r = __pyx_builtin_NotImplemented;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":1323
- * def __sub__(self, other):
- * cdef datetime dt
- * if isinstance(self, datetime): # left arg is a datetime instance # <<<<<<<<<<<<<<
- * dt = self
- * if isinstance(other, datetime):
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1344
- * return NotImplemented
- * else:
- * if isinstance(self, real_datetime): # <<<<<<<<<<<<<<
- * # real_datetime - datetime
- * if not other.datetime_compatible:
- */
- /*else*/ {
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_real_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_self, __pyx_t_8); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1344, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1346
- * if isinstance(self, real_datetime):
- * # real_datetime - datetime
- * if not other.datetime_compatible: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return self - other._to_real_datetime()
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_datetime_compatible); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_2 = ((!__pyx_t_1) != 0);
- if (__pyx_t_2) {
-
- /* "netcdftime/_netcdftime.pyx":1347
- * # real_datetime - datetime
- * if not other.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * return self - other._to_real_datetime()
- * else:
- */
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1347, __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_ERR(0, 1347, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1346
- * if isinstance(self, real_datetime):
- * # real_datetime - datetime
- * if not other.datetime_compatible: # <<<<<<<<<<<<<<
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return self - other._to_real_datetime()
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1348
- * if not other.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * return self - other._to_real_datetime() # <<<<<<<<<<<<<<
- * else:
- * return NotImplemented
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_to_real_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(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_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1344
- * return NotImplemented
- * else:
- * if isinstance(self, real_datetime): # <<<<<<<<<<<<<<
- * # real_datetime - datetime
- * if not other.datetime_compatible:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1350
- * return self - other._to_real_datetime()
- * else:
- * return NotImplemented # <<<<<<<<<<<<<<
- *
- * cdef class DatetimeNoLeap(datetime):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_builtin_NotImplemented);
- __pyx_r = __pyx_builtin_NotImplemented;
- goto __pyx_L0;
- }
- }
-
- /* "netcdftime/_netcdftime.pyx":1321
- * return dt._add_timedelta(delta)
- *
- * def __sub__(self, other): # <<<<<<<<<<<<<<
- * cdef datetime dt
- * if isinstance(self, datetime): # left arg is a datetime instance
- */
-
- /* 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_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("netcdftime._netcdftime.datetime.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_dt);
- __Pyx_XDECREF(__pyx_v_converter);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1194
- * Gregorial calendar.
- * """
- * cdef readonly int year, month, day, hour, minute, dayofwk, dayofyr # <<<<<<<<<<<<<<
- * cdef readonly int second, microsecond
- * cdef readonly str calendar
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_4year_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_4year_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_4year___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4year___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.year.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_5month_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_5month_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_5month___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_5month___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->month); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.month.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_3day_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_3day_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_3day___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_3day___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->day); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.day.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_4hour_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_4hour_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_4hour___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_4hour___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.hour.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6minute_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6minute_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_6minute___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6minute___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.minute.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofwk_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofwk_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofwk___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofwk___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dayofwk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.dayofwk.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofyr_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofyr_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofyr___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_7dayofyr___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dayofyr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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("netcdftime._netcdftime.datetime.dayofyr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1195
- * """
- * cdef readonly int year, month, day, hour, minute, dayofwk, dayofyr
- * cdef readonly int second, microsecond # <<<<<<<<<<<<<<
- * cdef readonly str calendar
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6second_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_6second_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_6second___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_6second___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __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("netcdftime._netcdftime.datetime.second.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_11microsecond_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_11microsecond_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_11microsecond___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_11microsecond___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __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("netcdftime._netcdftime.datetime.microsecond.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1196
- * cdef readonly int year, month, day, hour, minute, dayofwk, dayofyr
- * cdef readonly int second, microsecond
- * cdef readonly str calendar # <<<<<<<<<<<<<<
- *
- * # Python's datetime.datetime uses the proleptic Gregorian
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_8calendar_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_8calendar_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_8calendar___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_8calendar___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->calendar);
- __pyx_r = __pyx_v_self->calendar;
- goto __pyx_L0;
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1202
- * # netcdftime.datetime instance can be converted to
- * # datetime.datetime.
- * cdef readonly bint datetime_compatible # <<<<<<<<<<<<<<
- *
- * def __init__(self, int year, int month, int day, int hour=0, int minute=0, int second=0,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_19datetime_compatible_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_10netcdftime_11_netcdftime_8datetime_19datetime_compatible_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_8datetime_19datetime_compatible___get__(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_10netcdftime_11_netcdftime_8datetime_19datetime_compatible___get__(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->datetime_compatible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __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("netcdftime._netcdftime.datetime.datetime_compatible.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1357
- * but uses the "noleap" ("365_day") calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "noleap"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_14DatetimeNoLeap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_14DatetimeNoLeap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_14DatetimeNoLeap___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_14DatetimeNoLeap___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1358
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "noleap"
- * self.datetime_compatible = False
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1359
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "noleap" # <<<<<<<<<<<<<<
- * self.datetime_compatible = False
- *
- */
- __Pyx_INCREF(__pyx_n_s_noleap);
- __Pyx_GIVEREF(__pyx_n_s_noleap);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_n_s_noleap;
-
- /* "netcdftime/_netcdftime.pyx":1360
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "noleap"
- * self.datetime_compatible = False # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 0;
-
- /* "netcdftime/_netcdftime.pyx":1357
- * but uses the "noleap" ("365_day") calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "noleap"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.DatetimeNoLeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1362
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeNoLeap(*add_timedelta(self, delta, no_leap, False))
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14DatetimeNoLeap__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1363
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeNoLeap(*add_timedelta(self, delta, no_leap, False)) # <<<<<<<<<<<<<<
- *
- * cdef class DatetimeAllLeap(datetime):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta, __pyx_f_10netcdftime_11_netcdftime_no_leap, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1363, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeNoLeap), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __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;
-
- /* "netcdftime/_netcdftime.pyx":1362
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeNoLeap(*add_timedelta(self, delta, no_leap, False))
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.DatetimeNoLeap._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1370
- * but uses the "all_leap" ("366_day") calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "all_leap"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_15DatetimeAllLeap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_15DatetimeAllLeap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_15DatetimeAllLeap___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_15DatetimeAllLeap___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1371
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "all_leap"
- * self.datetime_compatible = False
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1372
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "all_leap" # <<<<<<<<<<<<<<
- * self.datetime_compatible = False
- *
- */
- __Pyx_INCREF(__pyx_n_s_all_leap);
- __Pyx_GIVEREF(__pyx_n_s_all_leap);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_n_s_all_leap;
-
- /* "netcdftime/_netcdftime.pyx":1373
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "all_leap"
- * self.datetime_compatible = False # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 0;
-
- /* "netcdftime/_netcdftime.pyx":1370
- * but uses the "all_leap" ("366_day") calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "all_leap"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.DatetimeAllLeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1375
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeAllLeap(*add_timedelta(self, delta, all_leap, False))
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_15DatetimeAllLeap__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1376
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeAllLeap(*add_timedelta(self, delta, all_leap, False)) # <<<<<<<<<<<<<<
- *
- * cdef class Datetime360Day(datetime):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta, __pyx_f_10netcdftime_11_netcdftime_all_leap, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1376, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeAllLeap), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __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;
-
- /* "netcdftime/_netcdftime.pyx":1375
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeAllLeap(*add_timedelta(self, delta, all_leap, False))
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.DatetimeAllLeap._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1383
- * but uses the "360_day" calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "360_day"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_14Datetime360Day_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_14Datetime360Day_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_14Datetime360Day___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_14Datetime360Day___init__(struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1384
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "360_day"
- * self.datetime_compatible = False
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1385
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "360_day" # <<<<<<<<<<<<<<
- * self.datetime_compatible = False
- *
- */
- __Pyx_INCREF(__pyx_kp_s_360_day);
- __Pyx_GIVEREF(__pyx_kp_s_360_day);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_kp_s_360_day;
-
- /* "netcdftime/_netcdftime.pyx":1386
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "360_day"
- * self.datetime_compatible = False # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 0;
-
- /* "netcdftime/_netcdftime.pyx":1383
- * but uses the "360_day" calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "360_day"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.Datetime360Day.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1388
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return Datetime360Day(*add_timedelta_360_day(self, delta))
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14Datetime360Day__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1389
- *
- * cdef _add_timedelta(self, delta):
- * return Datetime360Day(*add_timedelta_360_day(self, delta)) # <<<<<<<<<<<<<<
- *
- * cdef class DatetimeJulian(datetime):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta_360_day(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1389, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_Datetime360Day), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __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;
-
- /* "netcdftime/_netcdftime.pyx":1388
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return Datetime360Day(*add_timedelta_360_day(self, delta))
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.Datetime360Day._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1396
- * but uses the "julian" calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "julian"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_14DatetimeJulian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_14DatetimeJulian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_14DatetimeJulian___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_14DatetimeJulian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1397
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "julian"
- * self.datetime_compatible = False
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1398
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "julian" # <<<<<<<<<<<<<<
- * self.datetime_compatible = False
- *
- */
- __Pyx_INCREF(__pyx_n_s_julian);
- __Pyx_GIVEREF(__pyx_n_s_julian);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_n_s_julian;
-
- /* "netcdftime/_netcdftime.pyx":1399
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "julian"
- * self.datetime_compatible = False # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 0;
-
- /* "netcdftime/_netcdftime.pyx":1396
- * but uses the "julian" calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "julian"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.DatetimeJulian.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1401
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeJulian(*add_timedelta(self, delta, is_leap_julian, False))
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_14DatetimeJulian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1402
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeJulian(*add_timedelta(self, delta, is_leap_julian, False)) # <<<<<<<<<<<<<<
- *
- * cdef class DatetimeGregorian(datetime):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta, __pyx_f_10netcdftime_11_netcdftime_is_leap_julian, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1402, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeJulian), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __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;
-
- /* "netcdftime/_netcdftime.pyx":1401
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeJulian(*add_timedelta(self, delta, is_leap_julian, False))
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.DatetimeJulian._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1417
- * a datetime.datetime instance or vice versa.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "gregorian"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_17DatetimeGregorian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_17DatetimeGregorian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_17DatetimeGregorian___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_17DatetimeGregorian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1418
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "gregorian"
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1419
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "gregorian" # <<<<<<<<<<<<<<
- *
- * # dates after 1582-10-15 can be converted to and compared to
- */
- __Pyx_INCREF(__pyx_n_s_gregorian);
- __Pyx_GIVEREF(__pyx_n_s_gregorian);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_n_s_gregorian;
-
- /* "netcdftime/_netcdftime.pyx":1423
- * # dates after 1582-10-15 can be converted to and compared to
- * # proleptic Gregorian dates
- * if self.to_tuple() >= (1582, 10, 15, 0, 0, 0, 0): # <<<<<<<<<<<<<<
- * self.datetime_compatible = True
- * else:
- */
- __pyx_t_2 = ((struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeGregorian *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.to_tuple(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__28, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1423, __pyx_L1_error)
- __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_ERR(0, 1423, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_4) {
-
- /* "netcdftime/_netcdftime.pyx":1424
- * # proleptic Gregorian dates
- * if self.to_tuple() >= (1582, 10, 15, 0, 0, 0, 0):
- * self.datetime_compatible = True # <<<<<<<<<<<<<<
- * else:
- * self.datetime_compatible = False
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 1;
-
- /* "netcdftime/_netcdftime.pyx":1423
- * # dates after 1582-10-15 can be converted to and compared to
- * # proleptic Gregorian dates
- * if self.to_tuple() >= (1582, 10, 15, 0, 0, 0, 0): # <<<<<<<<<<<<<<
- * self.datetime_compatible = True
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "netcdftime/_netcdftime.pyx":1426
- * self.datetime_compatible = True
- * else:
- * self.datetime_compatible = False # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- /*else*/ {
- __pyx_v_self->__pyx_base.datetime_compatible = 0;
- }
- __pyx_L3:;
-
- /* "netcdftime/_netcdftime.pyx":1417
- * a datetime.datetime instance or vice versa.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "gregorian"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.DatetimeGregorian.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1428
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeGregorian(*add_timedelta(self, delta, is_leap_gregorian, True))
- *
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_17DatetimeGregorian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1429
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeGregorian(*add_timedelta(self, delta, is_leap_gregorian, True)) # <<<<<<<<<<<<<<
- *
- * cdef class DatetimeProlepticGregorian(datetime):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta, __pyx_f_10netcdftime_11_netcdftime_is_leap_gregorian, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1429, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeGregorian), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __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;
-
- /* "netcdftime/_netcdftime.pyx":1428
- * self.datetime_compatible = False
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeGregorian(*add_timedelta(self, delta, is_leap_gregorian, True))
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.DatetimeGregorian._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1448
- * format, and calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "proleptic_gregorian"
- */
-
-/* Python wrapper */
-static int __pyx_pw_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_v_kwargs = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
- if (unlikely(__pyx_kwds)) {
- __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
- __Pyx_GOTREF(__pyx_v_kwargs);
- } else {
- __pyx_v_kwargs = NULL;
- }
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian___init__(((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
- /* function exit code */
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_XDECREF(__pyx_v_kwargs);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian___init__(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "netcdftime/_netcdftime.pyx":1449
- * """
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<<
- * self.calendar = "proleptic_gregorian"
- * self.datetime_compatible = True
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_datetime), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1450
- * def __init__(self, *args, **kwargs):
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "proleptic_gregorian" # <<<<<<<<<<<<<<
- * self.datetime_compatible = True
- *
- */
- __Pyx_INCREF(__pyx_n_s_proleptic_gregorian);
- __Pyx_GIVEREF(__pyx_n_s_proleptic_gregorian);
- __Pyx_GOTREF(__pyx_v_self->__pyx_base.calendar);
- __Pyx_DECREF(__pyx_v_self->__pyx_base.calendar);
- __pyx_v_self->__pyx_base.calendar = __pyx_n_s_proleptic_gregorian;
-
- /* "netcdftime/_netcdftime.pyx":1451
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "proleptic_gregorian"
- * self.datetime_compatible = True # <<<<<<<<<<<<<<
- *
- * cdef _add_timedelta(self, delta):
- */
- __pyx_v_self->__pyx_base.datetime_compatible = 1;
-
- /* "netcdftime/_netcdftime.pyx":1448
- * format, and calendar.
- * """
- * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<<
- * datetime.__init__(self, *args, **kwargs)
- * self.calendar = "proleptic_gregorian"
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime.DatetimeProlepticGregorian.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1453
- * self.datetime_compatible = True
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeProlepticGregorian(*add_timedelta(self, delta,
- * is_leap_proleptic_gregorian, False))
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian__add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *__pyx_v_self, PyObject *__pyx_v_delta) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("_add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1454
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeProlepticGregorian(*add_timedelta(self, delta, # <<<<<<<<<<<<<<
- * is_leap_proleptic_gregorian, False))
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "netcdftime/_netcdftime.pyx":1455
- * cdef _add_timedelta(self, delta):
- * return DatetimeProlepticGregorian(*add_timedelta(self, delta,
- * is_leap_proleptic_gregorian, False)) # <<<<<<<<<<<<<<
- *
- * _illegal_s = re.compile(r"((^|[^%])(%%)*%s)")
- */
- __pyx_t_1 = __pyx_f_10netcdftime_11_netcdftime_add_timedelta(((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)__pyx_v_self), __pyx_v_delta, __pyx_f_10netcdftime_11_netcdftime_is_leap_proleptic_gregorian, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "netcdftime/_netcdftime.pyx":1454
- *
- * cdef _add_timedelta(self, delta):
- * return DatetimeProlepticGregorian(*add_timedelta(self, delta, # <<<<<<<<<<<<<<
- * is_leap_proleptic_gregorian, False))
- *
- */
- if (unlikely(__pyx_t_1 == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 1454, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10netcdftime_11_netcdftime_DatetimeProlepticGregorian), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __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;
-
- /* "netcdftime/_netcdftime.pyx":1453
- * self.datetime_compatible = True
- *
- * cdef _add_timedelta(self, delta): # <<<<<<<<<<<<<<
- * return DatetimeProlepticGregorian(*add_timedelta(self, delta,
- * is_leap_proleptic_gregorian, False))
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("netcdftime._netcdftime.DatetimeProlepticGregorian._add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1460
- *
- *
- * cdef _findall(text, substr): # <<<<<<<<<<<<<<
- * # Also finds overlaps
- * sites = []
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__findall(PyObject *__pyx_v_text, PyObject *__pyx_v_substr) {
- PyObject *__pyx_v_sites = NULL;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_j = 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;
- int __pyx_t_6;
- int __pyx_t_7;
- __Pyx_RefNannySetupContext("_findall", 0);
-
- /* "netcdftime/_netcdftime.pyx":1462
- * cdef _findall(text, substr):
- * # Also finds overlaps
- * sites = [] # <<<<<<<<<<<<<<
- * i = 0
- * while 1:
- */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_sites = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1463
- * # Also finds overlaps
- * sites = []
- * i = 0 # <<<<<<<<<<<<<<
- * while 1:
- * j = text.find(substr, i)
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_i = __pyx_int_0;
-
- /* "netcdftime/_netcdftime.pyx":1464
- * sites = []
- * i = 0
- * while 1: # <<<<<<<<<<<<<<
- * j = text.find(substr, i)
- * if j == -1:
- */
- while (1) {
-
- /* "netcdftime/_netcdftime.pyx":1465
- * i = 0
- * while 1:
- * j = text.find(substr, i) # <<<<<<<<<<<<<<
- * if j == -1:
- * break
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_find); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = NULL;
- __pyx_t_4 = 0;
- if (CYTHON_UNPACK_METHODS && 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);
- __pyx_t_4 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_substr, __pyx_v_i};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_substr, __pyx_v_i};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1465, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_v_substr);
- __Pyx_GIVEREF(__pyx_v_substr);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_substr);
- __Pyx_INCREF(__pyx_v_i);
- __Pyx_GIVEREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_i);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __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_j, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1466
- * while 1:
- * j = text.find(substr, i)
- * if j == -1: # <<<<<<<<<<<<<<
- * break
- * sites.append(j)
- */
- __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_j, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1466, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_6) {
-
- /* "netcdftime/_netcdftime.pyx":1467
- * j = text.find(substr, i)
- * if j == -1:
- * break # <<<<<<<<<<<<<<
- * sites.append(j)
- * i = j + 1
- */
- goto __pyx_L4_break;
-
- /* "netcdftime/_netcdftime.pyx":1466
- * while 1:
- * j = text.find(substr, i)
- * if j == -1: # <<<<<<<<<<<<<<
- * break
- * sites.append(j)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1468
- * if j == -1:
- * break
- * sites.append(j) # <<<<<<<<<<<<<<
- * i = j + 1
- * return sites
- */
- __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_sites, __pyx_v_j); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1468, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1469
- * break
- * sites.append(j)
- * i = j + 1 # <<<<<<<<<<<<<<
- * return sites
- *
- */
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_j, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1);
- __pyx_t_1 = 0;
- }
- __pyx_L4_break:;
-
- /* "netcdftime/_netcdftime.pyx":1470
- * sites.append(j)
- * i = j + 1
- * return sites # <<<<<<<<<<<<<<
- *
- * # Every 28 years the calendar repeats, except through century leap
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_sites);
- __pyx_r = __pyx_v_sites;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1460
- *
- *
- * cdef _findall(text, substr): # <<<<<<<<<<<<<<
- * # Also finds overlaps
- * sites = []
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime._findall", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_sites);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_j);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1477
- *
- *
- * cdef _strftime(datetime dt, fmt): # <<<<<<<<<<<<<<
- * if _illegal_s.search(fmt):
- * raise TypeError("This strftime implementation does not handle %s")
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime__strftime(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt, PyObject *__pyx_v_fmt) {
- PyObject *__pyx_v_year = NULL;
- PyObject *__pyx_v_delta = NULL;
- PyObject *__pyx_v_off = NULL;
- PyObject *__pyx_v_timetuple = NULL;
- PyObject *__pyx_v_s1 = NULL;
- PyObject *__pyx_v_sites1 = NULL;
- PyObject *__pyx_v_s2 = NULL;
- PyObject *__pyx_v_sites2 = NULL;
- PyObject *__pyx_v_sites = NULL;
- PyObject *__pyx_v_site = NULL;
- PyObject *__pyx_v_s = NULL;
- PyObject *__pyx_v_syear = 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;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- Py_ssize_t __pyx_t_8;
- PyObject *(*__pyx_t_9)(PyObject *);
- int __pyx_t_10;
- int __pyx_t_11;
- __Pyx_RefNannySetupContext("_strftime", 0);
-
- /* "netcdftime/_netcdftime.pyx":1478
- *
- * cdef _strftime(datetime dt, fmt):
- * if _illegal_s.search(fmt): # <<<<<<<<<<<<<<
- * raise TypeError("This strftime implementation does not handle %s")
- * # don't use strftime method at all.
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_illegal_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- if (CYTHON_UNPACK_METHODS && 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_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_fmt};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_fmt};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __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_fmt);
- __Pyx_GIVEREF(__pyx_v_fmt);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_fmt);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1478, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "netcdftime/_netcdftime.pyx":1479
- * cdef _strftime(datetime dt, fmt):
- * if _illegal_s.search(fmt):
- * raise TypeError("This strftime implementation does not handle %s") # <<<<<<<<<<<<<<
- * # don't use strftime method at all.
- * # if dt.year > 1900:
- */
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __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_ERR(0, 1479, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1478
- *
- * cdef _strftime(datetime dt, fmt):
- * if _illegal_s.search(fmt): # <<<<<<<<<<<<<<
- * raise TypeError("This strftime implementation does not handle %s")
- * # don't use strftime method at all.
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1484
- * # return dt.strftime(fmt)
- *
- * year = dt.year # <<<<<<<<<<<<<<
- * # For every non-leap year century, advance by
- * # 6 years to get into the 28-year repeat cycle
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dt->year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_year = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1487
- * # For every non-leap year century, advance by
- * # 6 years to get into the 28-year repeat cycle
- * delta = 2000 - year # <<<<<<<<<<<<<<
- * off = 6 * (delta // 100 + delta // 400)
- * year = year + off
- */
- __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_2000, __pyx_v_year, 0x7D0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_delta = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1488
- * # 6 years to get into the 28-year repeat cycle
- * delta = 2000 - year
- * off = 6 * (delta // 100 + delta // 400) # <<<<<<<<<<<<<<
- * year = year + off
- *
- */
- __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_delta, __pyx_int_100, 0x64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_delta, __pyx_int_400, 0x190, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __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 = PyNumber_Multiply(__pyx_int_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_off = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1489
- * delta = 2000 - year
- * off = 6 * (delta // 100 + delta // 400)
- * year = year + off # <<<<<<<<<<<<<<
- *
- * # Move to around the year 2000
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_year, __pyx_v_off); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1492
- *
- * # Move to around the year 2000
- * year = year + ((2000 - year) // 28) * 28 # <<<<<<<<<<<<<<
- * timetuple = dt.timetuple()
- * s1 = time.strftime(fmt, (year,) + timetuple[1:])
- */
- __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_2000, __pyx_v_year, 0x7D0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_3, __pyx_int_28, 28, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_28); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_v_year, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1493
- * # Move to around the year 2000
- * year = year + ((2000 - year) // 28) * 28
- * timetuple = dt.timetuple() # <<<<<<<<<<<<<<
- * s1 = time.strftime(fmt, (year,) + timetuple[1:])
- * sites1 = _findall(s1, str(year))
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dt), __pyx_n_s_timetuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1493, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error)
- }
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_timetuple = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1494
- * year = year + ((2000 - year) // 28) * 28
- * timetuple = dt.timetuple()
- * s1 = time.strftime(fmt, (year,) + timetuple[1:]) # <<<<<<<<<<<<<<
- * sites1 = _findall(s1, str(year))
- *
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strftime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_year);
- __Pyx_GIVEREF(__pyx_v_year);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_year);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_timetuple, 1, 0, NULL, NULL, &__pyx_slice__30, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_fmt, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
- PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_fmt, __pyx_t_6};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_2) {
- __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
- }
- __Pyx_INCREF(__pyx_v_fmt);
- __Pyx_GIVEREF(__pyx_v_fmt);
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_fmt);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_s1 = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1495
- * timetuple = dt.timetuple()
- * s1 = time.strftime(fmt, (year,) + timetuple[1:])
- * sites1 = _findall(s1, str(year)) # <<<<<<<<<<<<<<
- *
- * s2 = time.strftime(fmt, (year + 28,) + timetuple[1:])
- */
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1495, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_year);
- __Pyx_GIVEREF(__pyx_v_year);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_year);
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_f_10netcdftime_11_netcdftime__findall(__pyx_v_s1, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1495, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_sites1 = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1497
- * sites1 = _findall(s1, str(year))
- *
- * s2 = time.strftime(fmt, (year + 28,) + timetuple[1:]) # <<<<<<<<<<<<<<
- * sites2 = _findall(s2, str(year + 28))
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strftime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_28, 28, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_timetuple, 1, 0, NULL, NULL, &__pyx_slice__31, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_7 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fmt, __pyx_t_2};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fmt, __pyx_t_2};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_v_fmt);
- __Pyx_GIVEREF(__pyx_v_fmt);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_fmt);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __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_v_s2 = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1498
- *
- * s2 = time.strftime(fmt, (year + 28,) + timetuple[1:])
- * sites2 = _findall(s2, str(year + 28)) # <<<<<<<<<<<<<<
- *
- * sites = []
- */
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_year, __pyx_int_28, 28, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __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 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_f_10netcdftime_11_netcdftime__findall(__pyx_v_s2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_sites2 = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1500
- * sites2 = _findall(s2, str(year + 28))
- *
- * sites = [] # <<<<<<<<<<<<<<
- * for site in sites1:
- * if site in sites2:
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1500, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_sites = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1501
- *
- * sites = []
- * for site in sites1: # <<<<<<<<<<<<<<
- * if site in sites2:
- * sites.append(site)
- */
- if (likely(PyList_CheckExact(__pyx_v_sites1)) || PyTuple_CheckExact(__pyx_v_sites1)) {
- __pyx_t_3 = __pyx_v_sites1; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
- __pyx_t_9 = NULL;
- } else {
- __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_sites1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1501, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_3))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1501, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1501, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_9(__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_ERR(0, 1501, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_site, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1502
- * sites = []
- * for site in sites1:
- * if site in sites2: # <<<<<<<<<<<<<<
- * sites.append(site)
- *
- */
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_site, __pyx_v_sites2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1502, __pyx_L1_error)
- __pyx_t_10 = (__pyx_t_5 != 0);
- if (__pyx_t_10) {
-
- /* "netcdftime/_netcdftime.pyx":1503
- * for site in sites1:
- * if site in sites2:
- * sites.append(site) # <<<<<<<<<<<<<<
- *
- * s = s1
- */
- __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sites, __pyx_v_site); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1503, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1502
- * sites = []
- * for site in sites1:
- * if site in sites2: # <<<<<<<<<<<<<<
- * sites.append(site)
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1501
- *
- * sites = []
- * for site in sites1: # <<<<<<<<<<<<<<
- * if site in sites2:
- * sites.append(site)
- */
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1505
- * sites.append(site)
- *
- * s = s1 # <<<<<<<<<<<<<<
- * syear = "%4d" % (dt.year,)
- * for site in sites:
- */
- __Pyx_INCREF(__pyx_v_s1);
- __pyx_v_s = __pyx_v_s1;
-
- /* "netcdftime/_netcdftime.pyx":1506
- *
- * s = s1
- * syear = "%4d" % (dt.year,) # <<<<<<<<<<<<<<
- * for site in sites:
- * s = s[:site] + syear + s[site + 4:]
- */
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dt->year); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __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_PyString_Format(__pyx_kp_s_4d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_syear = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1507
- * s = s1
- * syear = "%4d" % (dt.year,)
- * for site in sites: # <<<<<<<<<<<<<<
- * s = s[:site] + syear + s[site + 4:]
- * return s
- */
- __pyx_t_3 = __pyx_v_sites; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
- for (;;) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1507, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- __Pyx_XDECREF_SET(__pyx_v_site, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1508
- * syear = "%4d" % (dt.year,)
- * for site in sites:
- * s = s[:site] + syear + s[site + 4:] # <<<<<<<<<<<<<<
- * return s
- *
- */
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_s, 0, 0, NULL, &__pyx_v_site, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_v_syear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_site, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_s, 0, 0, &__pyx_t_4, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1507
- * s = s1
- * syear = "%4d" % (dt.year,)
- * for site in sites: # <<<<<<<<<<<<<<
- * s = s[:site] + syear + s[site + 4:]
- * return s
- */
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1509
- * for site in sites:
- * s = s[:site] + syear + s[site + 4:]
- * return s # <<<<<<<<<<<<<<
- *
- * cdef bint is_leap_julian(int year):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_s);
- __pyx_r = __pyx_v_s;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1477
- *
- *
- * cdef _strftime(datetime dt, fmt): # <<<<<<<<<<<<<<
- * if _illegal_s.search(fmt):
- * raise TypeError("This strftime implementation does not handle %s")
- */
-
- /* 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_AddTraceback("netcdftime._netcdftime._strftime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_year);
- __Pyx_XDECREF(__pyx_v_delta);
- __Pyx_XDECREF(__pyx_v_off);
- __Pyx_XDECREF(__pyx_v_timetuple);
- __Pyx_XDECREF(__pyx_v_s1);
- __Pyx_XDECREF(__pyx_v_sites1);
- __Pyx_XDECREF(__pyx_v_s2);
- __Pyx_XDECREF(__pyx_v_sites2);
- __Pyx_XDECREF(__pyx_v_sites);
- __Pyx_XDECREF(__pyx_v_site);
- __Pyx_XDECREF(__pyx_v_s);
- __Pyx_XDECREF(__pyx_v_syear);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1511
- * return s
- *
- * cdef bint is_leap_julian(int year): # <<<<<<<<<<<<<<
- * "Return 1 if year is a leap year in the Julian calendar, 0 otherwise."
- * cdef int y
- */
-
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_julian(int __pyx_v_year) {
- int __pyx_v_y;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- long __pyx_t_1;
- __Pyx_RefNannySetupContext("is_leap_julian", 0);
-
- /* "netcdftime/_netcdftime.pyx":1514
- * "Return 1 if year is a leap year in the Julian calendar, 0 otherwise."
- * cdef int y
- * y = year if year > 0 else year + 1 # <<<<<<<<<<<<<<
- * return (y % 4) == 0
- *
- */
- if (((__pyx_v_year > 0) != 0)) {
- __pyx_t_1 = __pyx_v_year;
- } else {
- __pyx_t_1 = (__pyx_v_year + 1);
- }
- __pyx_v_y = __pyx_t_1;
-
- /* "netcdftime/_netcdftime.pyx":1515
- * cdef int y
- * y = year if year > 0 else year + 1
- * return (y % 4) == 0 # <<<<<<<<<<<<<<
- *
- * cdef bint is_leap_proleptic_gregorian(int year):
- */
- __pyx_r = (__Pyx_mod_long(__pyx_v_y, 4) == 0);
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1511
- * return s
- *
- * cdef bint is_leap_julian(int year): # <<<<<<<<<<<<<<
- * "Return 1 if year is a leap year in the Julian calendar, 0 otherwise."
- * cdef int y
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1517
- * return (y % 4) == 0
- *
- * cdef bint is_leap_proleptic_gregorian(int year): # <<<<<<<<<<<<<<
- * "Return 1 if year is a leap year in the Gregorian calendar, 0 otherwise."
- * cdef int y
- */
-
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_proleptic_gregorian(int __pyx_v_year) {
- int __pyx_v_y;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- long __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- __Pyx_RefNannySetupContext("is_leap_proleptic_gregorian", 0);
-
- /* "netcdftime/_netcdftime.pyx":1520
- * "Return 1 if year is a leap year in the Gregorian calendar, 0 otherwise."
- * cdef int y
- * y = year if year > 0 else year + 1 # <<<<<<<<<<<<<<
- * return (((y % 4) == 0) and ((y % 100) != 0)) or ((y % 400) == 0)
- *
- */
- if (((__pyx_v_year > 0) != 0)) {
- __pyx_t_1 = __pyx_v_year;
- } else {
- __pyx_t_1 = (__pyx_v_year + 1);
- }
- __pyx_v_y = __pyx_t_1;
-
- /* "netcdftime/_netcdftime.pyx":1521
- * cdef int y
- * y = year if year > 0 else year + 1
- * return (((y % 4) == 0) and ((y % 100) != 0)) or ((y % 400) == 0) # <<<<<<<<<<<<<<
- *
- * cdef bint is_leap_gregorian(int year):
- */
- __pyx_t_3 = ((__Pyx_mod_long(__pyx_v_y, 4) == 0) != 0);
- if (!__pyx_t_3) {
- goto __pyx_L4_next_or;
- } else {
- }
- __pyx_t_3 = ((__Pyx_mod_long(__pyx_v_y, 0x64) != 0) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_L4_next_or:;
- __pyx_t_3 = ((__Pyx_mod_long(__pyx_v_y, 0x190) == 0) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L3_bool_binop_done:;
- __pyx_r = __pyx_t_2;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1517
- * return (y % 4) == 0
- *
- * cdef bint is_leap_proleptic_gregorian(int year): # <<<<<<<<<<<<<<
- * "Return 1 if year is a leap year in the Gregorian calendar, 0 otherwise."
- * cdef int y
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1523
- * return (((y % 4) == 0) and ((y % 100) != 0)) or ((y % 400) == 0)
- *
- * cdef bint is_leap_gregorian(int year): # <<<<<<<<<<<<<<
- * return (year > 1582 and is_leap_proleptic_gregorian(year)) or (year < 1582 and is_leap_julian(year))
- *
- */
-
-static int __pyx_f_10netcdftime_11_netcdftime_is_leap_gregorian(int __pyx_v_year) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("is_leap_gregorian", 0);
-
- /* "netcdftime/_netcdftime.pyx":1524
- *
- * cdef bint is_leap_gregorian(int year):
- * return (year > 1582 and is_leap_proleptic_gregorian(year)) or (year < 1582 and is_leap_julian(year)) # <<<<<<<<<<<<<<
- *
- * cdef bint all_leap(int year):
- */
- __pyx_t_2 = ((__pyx_v_year > 0x62E) != 0);
- if (!__pyx_t_2) {
- goto __pyx_L4_next_or;
- } else {
- }
- __pyx_t_2 = (__pyx_f_10netcdftime_11_netcdftime_is_leap_proleptic_gregorian(__pyx_v_year) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_L4_next_or:;
- __pyx_t_2 = ((__pyx_v_year < 0x62E) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_t_2 = (__pyx_f_10netcdftime_11_netcdftime_is_leap_julian(__pyx_v_year) != 0);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L3_bool_binop_done:;
- __pyx_r = __pyx_t_1;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1523
- * return (((y % 4) == 0) and ((y % 100) != 0)) or ((y % 400) == 0)
- *
- * cdef bint is_leap_gregorian(int year): # <<<<<<<<<<<<<<
- * return (year > 1582 and is_leap_proleptic_gregorian(year)) or (year < 1582 and is_leap_julian(year))
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1526
- * return (year > 1582 and is_leap_proleptic_gregorian(year)) or (year < 1582 and is_leap_julian(year))
- *
- * cdef bint all_leap(int year): # <<<<<<<<<<<<<<
- * "Return True for all years."
- * return True
- */
-
-static int __pyx_f_10netcdftime_11_netcdftime_all_leap(CYTHON_UNUSED int __pyx_v_year) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("all_leap", 0);
-
- /* "netcdftime/_netcdftime.pyx":1528
- * cdef bint all_leap(int year):
- * "Return True for all years."
- * return True # <<<<<<<<<<<<<<
- *
- * cdef bint no_leap(int year):
- */
- __pyx_r = 1;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1526
- * return (year > 1582 and is_leap_proleptic_gregorian(year)) or (year < 1582 and is_leap_julian(year))
- *
- * cdef bint all_leap(int year): # <<<<<<<<<<<<<<
- * "Return True for all years."
- * return True
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1530
- * return True
- *
- * cdef bint no_leap(int year): # <<<<<<<<<<<<<<
- * "Return False for all years."
- * return False
- */
-
-static int __pyx_f_10netcdftime_11_netcdftime_no_leap(CYTHON_UNUSED int __pyx_v_year) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("no_leap", 0);
-
- /* "netcdftime/_netcdftime.pyx":1532
- * cdef bint no_leap(int year):
- * "Return False for all years."
- * return False # <<<<<<<<<<<<<<
- *
- * # numbers of days per month for calendars supported by add_timedelta(...)
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1530
- * return True
- *
- * cdef bint no_leap(int year): # <<<<<<<<<<<<<<
- * "Return False for all years."
- * return False
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1544
- * month_lengths_366_day[j] = N
- *
- * cdef int* month_lengths(bint (*is_leap)(int), int year): # <<<<<<<<<<<<<<
- * if is_leap(year):
- * return month_lengths_366_day
- */
-
-static int *__pyx_f_10netcdftime_11_netcdftime_month_lengths(int (*__pyx_v_is_leap)(int), int __pyx_v_year) {
- int *__pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("month_lengths", 0);
-
- /* "netcdftime/_netcdftime.pyx":1545
- *
- * cdef int* month_lengths(bint (*is_leap)(int), int year):
- * if is_leap(year): # <<<<<<<<<<<<<<
- * return month_lengths_366_day
- * else:
- */
- __pyx_t_1 = (__pyx_v_is_leap(__pyx_v_year) != 0);
- if (__pyx_t_1) {
-
- /* "netcdftime/_netcdftime.pyx":1546
- * cdef int* month_lengths(bint (*is_leap)(int), int year):
- * if is_leap(year):
- * return month_lengths_366_day # <<<<<<<<<<<<<<
- * else:
- * return month_lengths_365_day
- */
- __pyx_r = __pyx_v_10netcdftime_11_netcdftime_month_lengths_366_day;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1545
- *
- * cdef int* month_lengths(bint (*is_leap)(int), int year):
- * if is_leap(year): # <<<<<<<<<<<<<<
- * return month_lengths_366_day
- * else:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1548
- * return month_lengths_366_day
- * else:
- * return month_lengths_365_day # <<<<<<<<<<<<<<
- *
- * # Add a datetime.timedelta to a netcdftime.datetime instance. Uses
- */
- /*else*/ {
- __pyx_r = __pyx_v_10netcdftime_11_netcdftime_month_lengths_365_day;
- goto __pyx_L0;
- }
-
- /* "netcdftime/_netcdftime.pyx":1544
- * month_lengths_366_day[j] = N
- *
- * cdef int* month_lengths(bint (*is_leap)(int), int year): # <<<<<<<<<<<<<<
- * if is_leap(year):
- * return month_lengths_366_day
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1564
- * # the number of invalid dates are hard-wired (1582-10-4 is the last day
- * # of the Julian calendar, after which follows 1582-10-15).
- * cdef tuple add_timedelta(datetime dt, delta, bint (*is_leap)(int), bint julian_gregorian_mixed): # <<<<<<<<<<<<<<
- * cdef int microsecond, second, minute, hour, day, month, year
- * cdef int delta_microseconds, delta_seconds, delta_days
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_add_timedelta(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt, PyObject *__pyx_v_delta, int (*__pyx_v_is_leap)(int), int __pyx_v_julian_gregorian_mixed) {
- int __pyx_v_microsecond;
- int __pyx_v_second;
- int __pyx_v_minute;
- int __pyx_v_hour;
- int __pyx_v_day;
- int __pyx_v_month;
- int __pyx_v_year;
- int __pyx_v_delta_microseconds;
- int __pyx_v_delta_seconds;
- int __pyx_v_delta_days;
- int *__pyx_v_month_length;
- int __pyx_v_extra_days;
- int __pyx_v_n_invalid_dates;
- 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_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- __Pyx_RefNannySetupContext("add_timedelta", 0);
-
- /* "netcdftime/_netcdftime.pyx":1571
- *
- * # extract these inputs here to avoid type conversion in the code below
- * delta_microseconds = delta.microseconds # <<<<<<<<<<<<<<
- * delta_seconds = delta.seconds
- * delta_days = delta.days
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __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_ERR(0, 1571, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_delta_microseconds = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1572
- * # extract these inputs here to avoid type conversion in the code below
- * delta_microseconds = delta.microseconds
- * delta_seconds = delta.seconds # <<<<<<<<<<<<<<
- * delta_days = delta.days
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __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_ERR(0, 1572, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_delta_seconds = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1573
- * delta_microseconds = delta.microseconds
- * delta_seconds = delta.seconds
- * delta_days = delta.days # <<<<<<<<<<<<<<
- *
- * # shift microseconds, seconds, days
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __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_ERR(0, 1573, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_delta_days = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1576
- *
- * # shift microseconds, seconds, days
- * microsecond = dt.microsecond + delta_microseconds # <<<<<<<<<<<<<<
- * second = dt.second + delta_seconds
- * minute = dt.minute
- */
- __pyx_v_microsecond = (__pyx_v_dt->microsecond + __pyx_v_delta_microseconds);
-
- /* "netcdftime/_netcdftime.pyx":1577
- * # shift microseconds, seconds, days
- * microsecond = dt.microsecond + delta_microseconds
- * second = dt.second + delta_seconds # <<<<<<<<<<<<<<
- * minute = dt.minute
- * hour = dt.hour
- */
- __pyx_v_second = (__pyx_v_dt->second + __pyx_v_delta_seconds);
-
- /* "netcdftime/_netcdftime.pyx":1578
- * microsecond = dt.microsecond + delta_microseconds
- * second = dt.second + delta_seconds
- * minute = dt.minute # <<<<<<<<<<<<<<
- * hour = dt.hour
- * day = dt.day
- */
- __pyx_t_2 = __pyx_v_dt->minute;
- __pyx_v_minute = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1579
- * second = dt.second + delta_seconds
- * minute = dt.minute
- * hour = dt.hour # <<<<<<<<<<<<<<
- * day = dt.day
- * month = dt.month
- */
- __pyx_t_2 = __pyx_v_dt->hour;
- __pyx_v_hour = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1580
- * minute = dt.minute
- * hour = dt.hour
- * day = dt.day # <<<<<<<<<<<<<<
- * month = dt.month
- * year = dt.year
- */
- __pyx_t_2 = __pyx_v_dt->day;
- __pyx_v_day = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1581
- * hour = dt.hour
- * day = dt.day
- * month = dt.month # <<<<<<<<<<<<<<
- * year = dt.year
- *
- */
- __pyx_t_2 = __pyx_v_dt->month;
- __pyx_v_month = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1582
- * day = dt.day
- * month = dt.month
- * year = dt.year # <<<<<<<<<<<<<<
- *
- * # validate inputs:
- */
- __pyx_t_2 = __pyx_v_dt->year;
- __pyx_v_year = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1585
- *
- * # validate inputs:
- * if year == 0: # <<<<<<<<<<<<<<
- * raise ValueError("invalid year in {0!r}".format(dt))
- *
- */
- __pyx_t_3 = ((__pyx_v_year == 0) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1586
- * # validate inputs:
- * if year == 0:
- * raise ValueError("invalid year in {0!r}".format(dt)) # <<<<<<<<<<<<<<
- *
- * month_length = month_lengths(is_leap, year)
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_invalid_year_in_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1586, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_dt));
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __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_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __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_ERR(0, 1586, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1585
- *
- * # validate inputs:
- * if year == 0: # <<<<<<<<<<<<<<
- * raise ValueError("invalid year in {0!r}".format(dt))
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1588
- * raise ValueError("invalid year in {0!r}".format(dt))
- *
- * month_length = month_lengths(is_leap, year) # <<<<<<<<<<<<<<
- *
- * if month < 1 or month > 12:
- */
- __pyx_v_month_length = __pyx_f_10netcdftime_11_netcdftime_month_lengths(__pyx_v_is_leap, __pyx_v_year);
-
- /* "netcdftime/_netcdftime.pyx":1590
- * month_length = month_lengths(is_leap, year)
- *
- * if month < 1 or month > 12: # <<<<<<<<<<<<<<
- * raise ValueError("invalid month in {0!r}".format(dt))
- *
- */
- __pyx_t_7 = ((__pyx_v_month < 1) != 0);
- if (!__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L5_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_month > 12) != 0);
- __pyx_t_3 = __pyx_t_7;
- __pyx_L5_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1591
- *
- * if month < 1 or month > 12:
- * raise ValueError("invalid month in {0!r}".format(dt)) # <<<<<<<<<<<<<<
- *
- * if day < 1 or day > month_length[month]:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_invalid_month_in_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1591, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_dt));
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __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_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __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_ERR(0, 1591, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1590
- * month_length = month_lengths(is_leap, year)
- *
- * if month < 1 or month > 12: # <<<<<<<<<<<<<<
- * raise ValueError("invalid month in {0!r}".format(dt))
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1593
- * raise ValueError("invalid month in {0!r}".format(dt))
- *
- * if day < 1 or day > month_length[month]: # <<<<<<<<<<<<<<
- * raise ValueError("invalid day number in {0!r}".format(dt))
- *
- */
- __pyx_t_7 = ((__pyx_v_day < 1) != 0);
- if (!__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L8_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_day > (__pyx_v_month_length[__pyx_v_month])) != 0);
- __pyx_t_3 = __pyx_t_7;
- __pyx_L8_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1594
- *
- * if day < 1 or day > month_length[month]:
- * raise ValueError("invalid day number in {0!r}".format(dt)) # <<<<<<<<<<<<<<
- *
- * if julian_gregorian_mixed and year == 1582 and month == 10 and day > 4 and day < 15:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_invalid_day_number_in_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1594, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- if (CYTHON_UNPACK_METHODS && 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, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1594, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_dt));
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1594, __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_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __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_ERR(0, 1594, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1593
- * raise ValueError("invalid month in {0!r}".format(dt))
- *
- * if day < 1 or day > month_length[month]: # <<<<<<<<<<<<<<
- * raise ValueError("invalid day number in {0!r}".format(dt))
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1596
- * raise ValueError("invalid day number in {0!r}".format(dt))
- *
- * if julian_gregorian_mixed and year == 1582 and month == 10 and day > 4 and day < 15: # <<<<<<<<<<<<<<
- * raise ValueError("{0!r} is not present in the mixed Julian/Gregorian calendar".format(dt))
- *
- */
- __pyx_t_7 = (__pyx_v_julian_gregorian_mixed != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L11_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_year == 0x62E) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L11_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_month == 10) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L11_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_day > 4) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L11_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_day < 15) != 0);
- __pyx_t_3 = __pyx_t_7;
- __pyx_L11_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1597
- *
- * if julian_gregorian_mixed and year == 1582 and month == 10 and day > 4 and day < 15:
- * raise ValueError("{0!r} is not present in the mixed Julian/Gregorian calendar".format(dt)) # <<<<<<<<<<<<<<
- *
- * n_invalid_dates = 10 if julian_gregorian_mixed else 0
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_r_is_not_present_in_the_mixed, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
- PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_dt)};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else
- #endif
- {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1597, __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(((PyObject *)__pyx_v_dt));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_dt));
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_dt));
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __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_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __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_ERR(0, 1597, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1596
- * raise ValueError("invalid day number in {0!r}".format(dt))
- *
- * if julian_gregorian_mixed and year == 1582 and month == 10 and day > 4 and day < 15: # <<<<<<<<<<<<<<
- * raise ValueError("{0!r} is not present in the mixed Julian/Gregorian calendar".format(dt))
- *
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1599
- * raise ValueError("{0!r} is not present in the mixed Julian/Gregorian calendar".format(dt))
- *
- * n_invalid_dates = 10 if julian_gregorian_mixed else 0 # <<<<<<<<<<<<<<
- *
- * # Normalize microseconds, seconds, minutes, hours.
- */
- if ((__pyx_v_julian_gregorian_mixed != 0)) {
- __pyx_t_2 = 10;
- } else {
- __pyx_t_2 = 0;
- }
- __pyx_v_n_invalid_dates = __pyx_t_2;
-
- /* "netcdftime/_netcdftime.pyx":1602
- *
- * # Normalize microseconds, seconds, minutes, hours.
- * second += microsecond // 1000000 # <<<<<<<<<<<<<<
- * microsecond = microsecond % 1000000
- * minute += second // 60
- */
- __pyx_v_second = (__pyx_v_second + __Pyx_div_long(__pyx_v_microsecond, 0xF4240));
-
- /* "netcdftime/_netcdftime.pyx":1603
- * # Normalize microseconds, seconds, minutes, hours.
- * second += microsecond // 1000000
- * microsecond = microsecond % 1000000 # <<<<<<<<<<<<<<
- * minute += second // 60
- * second = second % 60
- */
- __pyx_v_microsecond = __Pyx_mod_long(__pyx_v_microsecond, 0xF4240);
-
- /* "netcdftime/_netcdftime.pyx":1604
- * second += microsecond // 1000000
- * microsecond = microsecond % 1000000
- * minute += second // 60 # <<<<<<<<<<<<<<
- * second = second % 60
- * hour += minute // 60
- */
- __pyx_v_minute = (__pyx_v_minute + __Pyx_div_long(__pyx_v_second, 60));
-
- /* "netcdftime/_netcdftime.pyx":1605
- * microsecond = microsecond % 1000000
- * minute += second // 60
- * second = second % 60 # <<<<<<<<<<<<<<
- * hour += minute // 60
- * minute = minute % 60
- */
- __pyx_v_second = __Pyx_mod_long(__pyx_v_second, 60);
-
- /* "netcdftime/_netcdftime.pyx":1606
- * minute += second // 60
- * second = second % 60
- * hour += minute // 60 # <<<<<<<<<<<<<<
- * minute = minute % 60
- * extra_days = hour // 24
- */
- __pyx_v_hour = (__pyx_v_hour + __Pyx_div_long(__pyx_v_minute, 60));
-
- /* "netcdftime/_netcdftime.pyx":1607
- * second = second % 60
- * hour += minute // 60
- * minute = minute % 60 # <<<<<<<<<<<<<<
- * extra_days = hour // 24
- * hour = hour % 24
- */
- __pyx_v_minute = __Pyx_mod_long(__pyx_v_minute, 60);
-
- /* "netcdftime/_netcdftime.pyx":1608
- * hour += minute // 60
- * minute = minute % 60
- * extra_days = hour // 24 # <<<<<<<<<<<<<<
- * hour = hour % 24
- *
- */
- __pyx_v_extra_days = __Pyx_div_long(__pyx_v_hour, 24);
-
- /* "netcdftime/_netcdftime.pyx":1609
- * minute = minute % 60
- * extra_days = hour // 24
- * hour = hour % 24 # <<<<<<<<<<<<<<
- *
- * delta_days += extra_days
- */
- __pyx_v_hour = __Pyx_mod_long(__pyx_v_hour, 24);
-
- /* "netcdftime/_netcdftime.pyx":1611
- * hour = hour % 24
- *
- * delta_days += extra_days # <<<<<<<<<<<<<<
- *
- * while delta_days < 0:
- */
- __pyx_v_delta_days = (__pyx_v_delta_days + __pyx_v_extra_days);
-
- /* "netcdftime/_netcdftime.pyx":1613
- * delta_days += extra_days
- *
- * while delta_days < 0: # <<<<<<<<<<<<<<
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15:
- * delta_days -= n_invalid_dates # skip over invalid dates
- */
- while (1) {
- __pyx_t_3 = ((__pyx_v_delta_days < 0) != 0);
- if (!__pyx_t_3) break;
-
- /* "netcdftime/_netcdftime.pyx":1614
- *
- * while delta_days < 0:
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15: # <<<<<<<<<<<<<<
- * delta_days -= n_invalid_dates # skip over invalid dates
- * if day + delta_days < 1:
- */
- __pyx_t_7 = ((__pyx_v_year == 0x62E) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L19_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_month == 10) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L19_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_day > 14) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L19_bool_binop_done;
- }
- __pyx_t_7 = (((__pyx_v_day + __pyx_v_delta_days) < 15) != 0);
- __pyx_t_3 = __pyx_t_7;
- __pyx_L19_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1615
- * while delta_days < 0:
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15:
- * delta_days -= n_invalid_dates # skip over invalid dates # <<<<<<<<<<<<<<
- * if day + delta_days < 1:
- * delta_days += day
- */
- __pyx_v_delta_days = (__pyx_v_delta_days - __pyx_v_n_invalid_dates);
-
- /* "netcdftime/_netcdftime.pyx":1614
- *
- * while delta_days < 0:
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15: # <<<<<<<<<<<<<<
- * delta_days -= n_invalid_dates # skip over invalid dates
- * if day + delta_days < 1:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1616
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15:
- * delta_days -= n_invalid_dates # skip over invalid dates
- * if day + delta_days < 1: # <<<<<<<<<<<<<<
- * delta_days += day
- * # decrement month
- */
- __pyx_t_3 = (((__pyx_v_day + __pyx_v_delta_days) < 1) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1617
- * delta_days -= n_invalid_dates # skip over invalid dates
- * if day + delta_days < 1:
- * delta_days += day # <<<<<<<<<<<<<<
- * # decrement month
- * month -= 1
- */
- __pyx_v_delta_days = (__pyx_v_delta_days + __pyx_v_day);
-
- /* "netcdftime/_netcdftime.pyx":1619
- * delta_days += day
- * # decrement month
- * month -= 1 # <<<<<<<<<<<<<<
- * if month < 1:
- * month = 12
- */
- __pyx_v_month = (__pyx_v_month - 1);
-
- /* "netcdftime/_netcdftime.pyx":1620
- * # decrement month
- * month -= 1
- * if month < 1: # <<<<<<<<<<<<<<
- * month = 12
- * year -= 1
- */
- __pyx_t_3 = ((__pyx_v_month < 1) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1621
- * month -= 1
- * if month < 1:
- * month = 12 # <<<<<<<<<<<<<<
- * year -= 1
- * if year == 0:
- */
- __pyx_v_month = 12;
-
- /* "netcdftime/_netcdftime.pyx":1622
- * if month < 1:
- * month = 12
- * year -= 1 # <<<<<<<<<<<<<<
- * if year == 0:
- * year = -1
- */
- __pyx_v_year = (__pyx_v_year - 1);
-
- /* "netcdftime/_netcdftime.pyx":1623
- * month = 12
- * year -= 1
- * if year == 0: # <<<<<<<<<<<<<<
- * year = -1
- * month_length = month_lengths(is_leap, year)
- */
- __pyx_t_3 = ((__pyx_v_year == 0) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1624
- * year -= 1
- * if year == 0:
- * year = -1 # <<<<<<<<<<<<<<
- * month_length = month_lengths(is_leap, year)
- * day = month_length[month]
- */
- __pyx_v_year = -1;
-
- /* "netcdftime/_netcdftime.pyx":1623
- * month = 12
- * year -= 1
- * if year == 0: # <<<<<<<<<<<<<<
- * year = -1
- * month_length = month_lengths(is_leap, year)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1625
- * if year == 0:
- * year = -1
- * month_length = month_lengths(is_leap, year) # <<<<<<<<<<<<<<
- * day = month_length[month]
- * else:
- */
- __pyx_v_month_length = __pyx_f_10netcdftime_11_netcdftime_month_lengths(__pyx_v_is_leap, __pyx_v_year);
-
- /* "netcdftime/_netcdftime.pyx":1620
- * # decrement month
- * month -= 1
- * if month < 1: # <<<<<<<<<<<<<<
- * month = 12
- * year -= 1
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1626
- * year = -1
- * month_length = month_lengths(is_leap, year)
- * day = month_length[month] # <<<<<<<<<<<<<<
- * else:
- * day += delta_days
- */
- __pyx_v_day = (__pyx_v_month_length[__pyx_v_month]);
-
- /* "netcdftime/_netcdftime.pyx":1616
- * if year == 1582 and month == 10 and day > 14 and day + delta_days < 15:
- * delta_days -= n_invalid_dates # skip over invalid dates
- * if day + delta_days < 1: # <<<<<<<<<<<<<<
- * delta_days += day
- * # decrement month
- */
- goto __pyx_L23;
- }
-
- /* "netcdftime/_netcdftime.pyx":1628
- * day = month_length[month]
- * else:
- * day += delta_days # <<<<<<<<<<<<<<
- * delta_days = 0
- *
- */
- /*else*/ {
- __pyx_v_day = (__pyx_v_day + __pyx_v_delta_days);
-
- /* "netcdftime/_netcdftime.pyx":1629
- * else:
- * day += delta_days
- * delta_days = 0 # <<<<<<<<<<<<<<
- *
- * while delta_days > 0:
- */
- __pyx_v_delta_days = 0;
- }
- __pyx_L23:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1631
- * delta_days = 0
- *
- * while delta_days > 0: # <<<<<<<<<<<<<<
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4:
- * delta_days += n_invalid_dates # skip over invalid dates
- */
- while (1) {
- __pyx_t_3 = ((__pyx_v_delta_days > 0) != 0);
- if (!__pyx_t_3) break;
-
- /* "netcdftime/_netcdftime.pyx":1632
- *
- * while delta_days > 0:
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4: # <<<<<<<<<<<<<<
- * delta_days += n_invalid_dates # skip over invalid dates
- * if day + delta_days > month_length[month]:
- */
- __pyx_t_7 = ((__pyx_v_year == 0x62E) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L29_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_month == 10) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L29_bool_binop_done;
- }
- __pyx_t_7 = ((__pyx_v_day < 5) != 0);
- if (__pyx_t_7) {
- } else {
- __pyx_t_3 = __pyx_t_7;
- goto __pyx_L29_bool_binop_done;
- }
- __pyx_t_7 = (((__pyx_v_day + __pyx_v_delta_days) > 4) != 0);
- __pyx_t_3 = __pyx_t_7;
- __pyx_L29_bool_binop_done:;
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1633
- * while delta_days > 0:
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4:
- * delta_days += n_invalid_dates # skip over invalid dates # <<<<<<<<<<<<<<
- * if day + delta_days > month_length[month]:
- * delta_days -= month_length[month] - (day - 1)
- */
- __pyx_v_delta_days = (__pyx_v_delta_days + __pyx_v_n_invalid_dates);
-
- /* "netcdftime/_netcdftime.pyx":1632
- *
- * while delta_days > 0:
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4: # <<<<<<<<<<<<<<
- * delta_days += n_invalid_dates # skip over invalid dates
- * if day + delta_days > month_length[month]:
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1634
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4:
- * delta_days += n_invalid_dates # skip over invalid dates
- * if day + delta_days > month_length[month]: # <<<<<<<<<<<<<<
- * delta_days -= month_length[month] - (day - 1)
- * # increment month
- */
- __pyx_t_3 = (((__pyx_v_day + __pyx_v_delta_days) > (__pyx_v_month_length[__pyx_v_month])) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1635
- * delta_days += n_invalid_dates # skip over invalid dates
- * if day + delta_days > month_length[month]:
- * delta_days -= month_length[month] - (day - 1) # <<<<<<<<<<<<<<
- * # increment month
- * month += 1
- */
- __pyx_v_delta_days = (__pyx_v_delta_days - ((__pyx_v_month_length[__pyx_v_month]) - (__pyx_v_day - 1)));
-
- /* "netcdftime/_netcdftime.pyx":1637
- * delta_days -= month_length[month] - (day - 1)
- * # increment month
- * month += 1 # <<<<<<<<<<<<<<
- * if month > 12:
- * month = 1
- */
- __pyx_v_month = (__pyx_v_month + 1);
-
- /* "netcdftime/_netcdftime.pyx":1638
- * # increment month
- * month += 1
- * if month > 12: # <<<<<<<<<<<<<<
- * month = 1
- * year += 1
- */
- __pyx_t_3 = ((__pyx_v_month > 12) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1639
- * month += 1
- * if month > 12:
- * month = 1 # <<<<<<<<<<<<<<
- * year += 1
- * if year == 0:
- */
- __pyx_v_month = 1;
-
- /* "netcdftime/_netcdftime.pyx":1640
- * if month > 12:
- * month = 1
- * year += 1 # <<<<<<<<<<<<<<
- * if year == 0:
- * year = 1
- */
- __pyx_v_year = (__pyx_v_year + 1);
-
- /* "netcdftime/_netcdftime.pyx":1641
- * month = 1
- * year += 1
- * if year == 0: # <<<<<<<<<<<<<<
- * year = 1
- * month_length = month_lengths(is_leap, year)
- */
- __pyx_t_3 = ((__pyx_v_year == 0) != 0);
- if (__pyx_t_3) {
-
- /* "netcdftime/_netcdftime.pyx":1642
- * year += 1
- * if year == 0:
- * year = 1 # <<<<<<<<<<<<<<
- * month_length = month_lengths(is_leap, year)
- * day = 1
- */
- __pyx_v_year = 1;
-
- /* "netcdftime/_netcdftime.pyx":1641
- * month = 1
- * year += 1
- * if year == 0: # <<<<<<<<<<<<<<
- * year = 1
- * month_length = month_lengths(is_leap, year)
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1643
- * if year == 0:
- * year = 1
- * month_length = month_lengths(is_leap, year) # <<<<<<<<<<<<<<
- * day = 1
- * else:
- */
- __pyx_v_month_length = __pyx_f_10netcdftime_11_netcdftime_month_lengths(__pyx_v_is_leap, __pyx_v_year);
-
- /* "netcdftime/_netcdftime.pyx":1638
- * # increment month
- * month += 1
- * if month > 12: # <<<<<<<<<<<<<<
- * month = 1
- * year += 1
- */
- }
-
- /* "netcdftime/_netcdftime.pyx":1644
- * year = 1
- * month_length = month_lengths(is_leap, year)
- * day = 1 # <<<<<<<<<<<<<<
- * else:
- * day += delta_days
- */
- __pyx_v_day = 1;
-
- /* "netcdftime/_netcdftime.pyx":1634
- * if year == 1582 and month == 10 and day < 5 and day + delta_days > 4:
- * delta_days += n_invalid_dates # skip over invalid dates
- * if day + delta_days > month_length[month]: # <<<<<<<<<<<<<<
- * delta_days -= month_length[month] - (day - 1)
- * # increment month
- */
- goto __pyx_L33;
- }
-
- /* "netcdftime/_netcdftime.pyx":1646
- * day = 1
- * else:
- * day += delta_days # <<<<<<<<<<<<<<
- * delta_days = 0
- *
- */
- /*else*/ {
- __pyx_v_day = (__pyx_v_day + __pyx_v_delta_days);
-
- /* "netcdftime/_netcdftime.pyx":1647
- * else:
- * day += delta_days
- * delta_days = 0 # <<<<<<<<<<<<<<
- *
- * return (year, month, day, hour, minute, second, microsecond, -1, 1)
- */
- __pyx_v_delta_days = 0;
- }
- __pyx_L33:;
- }
-
- /* "netcdftime/_netcdftime.pyx":1649
- * delta_days = 0
- *
- * return (year, month, day, hour, minute, second, microsecond, -1, 1) # <<<<<<<<<<<<<<
- *
- * # Add a datetime.timedelta to a netcdftime.datetime instance with the 360_day calendar.
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_hour); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_minute); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_second); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_microsecond); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1649, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_10);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_int_1);
- __pyx_t_1 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_8 = 0;
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- __pyx_r = ((PyObject*)__pyx_t_11);
- __pyx_t_11 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1564
- * # the number of invalid dates are hard-wired (1582-10-4 is the last day
- * # of the Julian calendar, after which follows 1582-10-15).
- * cdef tuple add_timedelta(datetime dt, delta, bint (*is_leap)(int), bint julian_gregorian_mixed): # <<<<<<<<<<<<<<
- * cdef int microsecond, second, minute, hour, day, month, year
- * cdef int delta_microseconds, delta_seconds, delta_days
- */
-
- /* 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_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("netcdftime._netcdftime.add_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "netcdftime/_netcdftime.pyx":1657
- * # months are 30 days long, so we can compute month and year by using
- * # "//" and "%".
- * cdef tuple add_timedelta_360_day(datetime dt, delta): # <<<<<<<<<<<<<<
- * cdef int microsecond, second, minute, hour, day, month, year
- * cdef int delta_microseconds, delta_seconds, delta_days
- */
-
-static PyObject *__pyx_f_10netcdftime_11_netcdftime_add_timedelta_360_day(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *__pyx_v_dt, PyObject *__pyx_v_delta) {
- int __pyx_v_microsecond;
- int __pyx_v_second;
- int __pyx_v_minute;
- int __pyx_v_hour;
- int __pyx_v_day;
- int __pyx_v_month;
- int __pyx_v_year;
- int __pyx_v_delta_microseconds;
- int __pyx_v_delta_seconds;
- int __pyx_v_delta_days;
- 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;
- 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 = NULL;
- __Pyx_RefNannySetupContext("add_timedelta_360_day", 0);
-
- /* "netcdftime/_netcdftime.pyx":1661
- * cdef int delta_microseconds, delta_seconds, delta_days
- *
- * assert dt.month >= 1 and dt.month <= 12 # <<<<<<<<<<<<<<
- *
- * # extract these inputs here to avoid type conversion in the code below
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_2 = ((__pyx_v_dt->month >= 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_t_2 = ((__pyx_v_dt->month <= 12) != 0);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L3_bool_binop_done:;
- if (unlikely(!__pyx_t_1)) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 1661, __pyx_L1_error)
- }
- }
- #endif
-
- /* "netcdftime/_netcdftime.pyx":1664
- *
- * # extract these inputs here to avoid type conversion in the code below
- * delta_microseconds = delta.microseconds # <<<<<<<<<<<<<<
- * delta_seconds = delta.seconds
- * delta_days = delta.days
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1664, __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_ERR(0, 1664, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_delta_microseconds = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1665
- * # extract these inputs here to avoid type conversion in the code below
- * delta_microseconds = delta.microseconds
- * delta_seconds = delta.seconds # <<<<<<<<<<<<<<
- * delta_days = delta.days
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __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_ERR(0, 1665, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_delta_seconds = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1666
- * delta_microseconds = delta.microseconds
- * delta_seconds = delta.seconds
- * delta_days = delta.days # <<<<<<<<<<<<<<
- *
- * # shift microseconds, seconds, days
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1666, __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_ERR(0, 1666, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_delta_days = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1669
- *
- * # shift microseconds, seconds, days
- * microsecond = dt.microsecond + delta_microseconds # <<<<<<<<<<<<<<
- * second = dt.second + delta_seconds
- * minute = dt.minute
- */
- __pyx_v_microsecond = (__pyx_v_dt->microsecond + __pyx_v_delta_microseconds);
-
- /* "netcdftime/_netcdftime.pyx":1670
- * # shift microseconds, seconds, days
- * microsecond = dt.microsecond + delta_microseconds
- * second = dt.second + delta_seconds # <<<<<<<<<<<<<<
- * minute = dt.minute
- * hour = dt.hour
- */
- __pyx_v_second = (__pyx_v_dt->second + __pyx_v_delta_seconds);
-
- /* "netcdftime/_netcdftime.pyx":1671
- * microsecond = dt.microsecond + delta_microseconds
- * second = dt.second + delta_seconds
- * minute = dt.minute # <<<<<<<<<<<<<<
- * hour = dt.hour
- * day = dt.day + delta_days
- */
- __pyx_t_4 = __pyx_v_dt->minute;
- __pyx_v_minute = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1672
- * second = dt.second + delta_seconds
- * minute = dt.minute
- * hour = dt.hour # <<<<<<<<<<<<<<
- * day = dt.day + delta_days
- * month = dt.month
- */
- __pyx_t_4 = __pyx_v_dt->hour;
- __pyx_v_hour = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1673
- * minute = dt.minute
- * hour = dt.hour
- * day = dt.day + delta_days # <<<<<<<<<<<<<<
- * month = dt.month
- * year = dt.year
- */
- __pyx_v_day = (__pyx_v_dt->day + __pyx_v_delta_days);
-
- /* "netcdftime/_netcdftime.pyx":1674
- * hour = dt.hour
- * day = dt.day + delta_days
- * month = dt.month # <<<<<<<<<<<<<<
- * year = dt.year
- *
- */
- __pyx_t_4 = __pyx_v_dt->month;
- __pyx_v_month = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1675
- * day = dt.day + delta_days
- * month = dt.month
- * year = dt.year # <<<<<<<<<<<<<<
- *
- * # Normalize microseconds, seconds, minutes, hours, days, and months.
- */
- __pyx_t_4 = __pyx_v_dt->year;
- __pyx_v_year = __pyx_t_4;
-
- /* "netcdftime/_netcdftime.pyx":1678
- *
- * # Normalize microseconds, seconds, minutes, hours, days, and months.
- * second += microsecond // 1000000 # <<<<<<<<<<<<<<
- * microsecond = microsecond % 1000000
- * minute += second // 60
- */
- __pyx_v_second = (__pyx_v_second + __Pyx_div_long(__pyx_v_microsecond, 0xF4240));
-
- /* "netcdftime/_netcdftime.pyx":1679
- * # Normalize microseconds, seconds, minutes, hours, days, and months.
- * second += microsecond // 1000000
- * microsecond = microsecond % 1000000 # <<<<<<<<<<<<<<
- * minute += second // 60
- * second = second % 60
- */
- __pyx_v_microsecond = __Pyx_mod_long(__pyx_v_microsecond, 0xF4240);
-
- /* "netcdftime/_netcdftime.pyx":1680
- * second += microsecond // 1000000
- * microsecond = microsecond % 1000000
- * minute += second // 60 # <<<<<<<<<<<<<<
- * second = second % 60
- * hour += minute // 60
- */
- __pyx_v_minute = (__pyx_v_minute + __Pyx_div_long(__pyx_v_second, 60));
-
- /* "netcdftime/_netcdftime.pyx":1681
- * microsecond = microsecond % 1000000
- * minute += second // 60
- * second = second % 60 # <<<<<<<<<<<<<<
- * hour += minute // 60
- * minute = minute % 60
- */
- __pyx_v_second = __Pyx_mod_long(__pyx_v_second, 60);
-
- /* "netcdftime/_netcdftime.pyx":1682
- * minute += second // 60
- * second = second % 60
- * hour += minute // 60 # <<<<<<<<<<<<<<
- * minute = minute % 60
- * day += hour // 24
- */
- __pyx_v_hour = (__pyx_v_hour + __Pyx_div_long(__pyx_v_minute, 60));
-
- /* "netcdftime/_netcdftime.pyx":1683
- * second = second % 60
- * hour += minute // 60
- * minute = minute % 60 # <<<<<<<<<<<<<<
- * day += hour // 24
- * hour = hour % 24
- */
- __pyx_v_minute = __Pyx_mod_long(__pyx_v_minute, 60);
-
- /* "netcdftime/_netcdftime.pyx":1684
- * hour += minute // 60
- * minute = minute % 60
- * day += hour // 24 # <<<<<<<<<<<<<<
- * hour = hour % 24
- * # day and month are counted from 1; all months have 30 days
- */
- __pyx_v_day = (__pyx_v_day + __Pyx_div_long(__pyx_v_hour, 24));
-
- /* "netcdftime/_netcdftime.pyx":1685
- * minute = minute % 60
- * day += hour // 24
- * hour = hour % 24 # <<<<<<<<<<<<<<
- * # day and month are counted from 1; all months have 30 days
- * month += (day - 1) // 30
- */
- __pyx_v_hour = __Pyx_mod_long(__pyx_v_hour, 24);
-
- /* "netcdftime/_netcdftime.pyx":1687
- * hour = hour % 24
- * # day and month are counted from 1; all months have 30 days
- * month += (day - 1) // 30 # <<<<<<<<<<<<<<
- * day = (day - 1) % 30 + 1
- * # all years have 12 months
- */
- __pyx_v_month = (__pyx_v_month + __Pyx_div_long((__pyx_v_day - 1), 30));
-
- /* "netcdftime/_netcdftime.pyx":1688
- * # day and month are counted from 1; all months have 30 days
- * month += (day - 1) // 30
- * day = (day - 1) % 30 + 1 # <<<<<<<<<<<<<<
- * # all years have 12 months
- * year += (month - 1) // 12
- */
- __pyx_v_day = (__Pyx_mod_long((__pyx_v_day - 1), 30) + 1);
-
- /* "netcdftime/_netcdftime.pyx":1690
- * day = (day - 1) % 30 + 1
- * # all years have 12 months
- * year += (month - 1) // 12 # <<<<<<<<<<<<<<
- * month = (month - 1) % 12 + 1
- *
- */
- __pyx_v_year = (__pyx_v_year + __Pyx_div_long((__pyx_v_month - 1), 12));
-
- /* "netcdftime/_netcdftime.pyx":1691
- * # all years have 12 months
- * year += (month - 1) // 12
- * month = (month - 1) % 12 + 1 # <<<<<<<<<<<<<<
- *
- * return (year, month, day, hour, minute, second, microsecond, -1, 1)
- */
- __pyx_v_month = (__Pyx_mod_long((__pyx_v_month - 1), 12) + 1);
-
- /* "netcdftime/_netcdftime.pyx":1693
- * month = (month - 1) % 12 + 1
- *
- * return (year, month, day, hour, minute, second, microsecond, -1, 1) # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_hour); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_minute); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_second); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_microsecond); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_10);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_int_1);
- __pyx_t_3 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_8 = 0;
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- __pyx_r = ((PyObject*)__pyx_t_11);
- __pyx_t_11 = 0;
- goto __pyx_L0;
-
- /* "netcdftime/_netcdftime.pyx":1657
- * # months are 30 days long, so we can compute month and year by using
- * # "//" and "%".
- * cdef tuple add_timedelta_360_day(datetime dt, delta): # <<<<<<<<<<<<<<
- * cdef int microsecond, second, minute, hour, day, month, year
- * cdef int delta_microseconds, delta_seconds, delta_days
- */
-
- /* function exit code */
- __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_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("netcdftime._netcdftime.add_timedelta_360_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime __pyx_vtable_10netcdftime_11_netcdftime_datetime;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_datetime(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *p;
- PyObject *o;
- if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
- o = (*t->tp_alloc)(t, 0);
- } else {
- o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
- }
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)o);
- p->__pyx_vtab = __pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- p->calendar = ((PyObject*)Py_None); Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime(PyObject *o) {
- struct __pyx_obj_10netcdftime_11_netcdftime_datetime *p = (struct __pyx_obj_10netcdftime_11_netcdftime_datetime *)o;
- #if PY_VERSION_HEX >= 0x030400a1
- if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
- if (PyObject_CallFinalizerFromDealloc(o)) return;
- }
- #endif
- Py_CLEAR(p->calendar);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_format(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_6format_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_year(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_4year_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_month(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_5month_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_day(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_3day_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_hour(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_4hour_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_minute(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_6minute_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_dayofwk(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofwk_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_dayofyr(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_7dayofyr_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_second(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_6second_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_microsecond(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_11microsecond_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_calendar(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_8calendar_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_10netcdftime_11_netcdftime_8datetime_datetime_compatible(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_10netcdftime_11_netcdftime_8datetime_19datetime_compatible_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_datetime[] = {
- {"strftime", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_3strftime, METH_VARARGS|METH_KEYWORDS, 0},
- {"replace", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_5replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10netcdftime_11_netcdftime_8datetime_4replace},
- {"timetuple", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_7timetuple, METH_NOARGS, 0},
- {"_to_real_datetime", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_9_to_real_datetime, METH_NOARGS, 0},
- {"__reduce__", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_8datetime_19__reduce__, METH_NOARGS, __pyx_doc_10netcdftime_11_netcdftime_8datetime_18__reduce__},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_10netcdftime_11_netcdftime_datetime[] = {
- {(char *)"format", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_format, 0, (char *)0, 0},
- {(char *)"year", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_year, 0, (char *)0, 0},
- {(char *)"month", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_month, 0, (char *)0, 0},
- {(char *)"day", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_day, 0, (char *)0, 0},
- {(char *)"hour", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_hour, 0, (char *)0, 0},
- {(char *)"minute", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_minute, 0, (char *)0, 0},
- {(char *)"dayofwk", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_dayofwk, 0, (char *)0, 0},
- {(char *)"dayofyr", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_dayofyr, 0, (char *)0, 0},
- {(char *)"second", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_second, 0, (char *)0, 0},
- {(char *)"microsecond", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_microsecond, 0, (char *)0, 0},
- {(char *)"calendar", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_calendar, 0, (char *)0, 0},
- {(char *)"datetime_compatible", __pyx_getprop_10netcdftime_11_netcdftime_8datetime_datetime_compatible, 0, (char *)0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyNumberMethods __pyx_tp_as_number_datetime = {
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_21__add__, /*nb_add*/
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_23__sub__, /*nb_subtract*/
- 0, /*nb_multiply*/
- #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
- 0, /*nb_divide*/
- #endif
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
- 0, /*nb_negative*/
- 0, /*nb_positive*/
- 0, /*nb_absolute*/
- 0, /*nb_nonzero*/
- 0, /*nb_invert*/
- 0, /*nb_lshift*/
- 0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
- 0, /*nb_coerce*/
- #endif
- 0, /*nb_int*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_long*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*nb_float*/
- #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
- 0, /*nb_oct*/
- #endif
- #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
- 0, /*nb_hex*/
- #endif
- 0, /*nb_inplace_add*/
- 0, /*nb_inplace_subtract*/
- 0, /*nb_inplace_multiply*/
- #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
- 0, /*nb_inplace_divide*/
- #endif
- 0, /*nb_inplace_remainder*/
- 0, /*nb_inplace_power*/
- 0, /*nb_inplace_lshift*/
- 0, /*nb_inplace_rshift*/
- 0, /*nb_inplace_and*/
- 0, /*nb_inplace_xor*/
- 0, /*nb_inplace_or*/
- 0, /*nb_floor_divide*/
- 0, /*nb_true_divide*/
- 0, /*nb_inplace_floor_divide*/
- 0, /*nb_inplace_true_divide*/
- 0, /*nb_index*/
- #if PY_VERSION_HEX >= 0x03050000
- 0, /*nb_matrix_multiply*/
- #endif
- #if PY_VERSION_HEX >= 0x03050000
- 0, /*nb_inplace_matrix_multiply*/
- #endif
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_datetime = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.datetime", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_datetime), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- &__pyx_tp_as_number_datetime, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_15__hash__, /*tp_hash*/
- 0, /*tp_call*/
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nThe base class implementing most methods of datetime classes that\nmimic datetime.datetime but support calendars other than the proleptic\nGregorial calendar.\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_17__richcmp__, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_datetime, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_10netcdftime_11_netcdftime_datetime, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_datetime, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeNoLeap __pyx_vtable_10netcdftime_11_netcdftime_DatetimeNoLeap;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeNoLeap(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeNoLeap;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_DatetimeNoLeap[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.DatetimeNoLeap", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeNoLeap), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut uses the \"noleap\" (\"365_day\") calendar.\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_DatetimeNoLeap, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_14DatetimeNoLeap_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_DatetimeNoLeap, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeAllLeap __pyx_vtable_10netcdftime_11_netcdftime_DatetimeAllLeap;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeAllLeap(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeAllLeap;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_DatetimeAllLeap[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.DatetimeAllLeap", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeAllLeap), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut uses the \"all_leap\" (\"366_day\") calendar.\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_DatetimeAllLeap, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_15DatetimeAllLeap_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_DatetimeAllLeap, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_Datetime360Day __pyx_vtable_10netcdftime_11_netcdftime_Datetime360Day;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_Datetime360Day(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_Datetime360Day;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_Datetime360Day[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_Datetime360Day = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.Datetime360Day", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_Datetime360Day), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut uses the \"360_day\" calendar.\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_Datetime360Day, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_14Datetime360Day_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_Datetime360Day, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeJulian __pyx_vtable_10netcdftime_11_netcdftime_DatetimeJulian;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeJulian(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeJulian;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_DatetimeJulian[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_DatetimeJulian = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.DatetimeJulian", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeJulian), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut uses the \"julian\" calendar.\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_DatetimeJulian, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_14DatetimeJulian_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_DatetimeJulian, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeGregorian __pyx_vtable_10netcdftime_11_netcdftime_DatetimeGregorian;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeGregorian(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeGregorian;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_DatetimeGregorian[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.DatetimeGregorian", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeGregorian), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut uses the mixed Julian-Gregorian (\"standard\", \"gregorian\") calendar.\n\nThe last date of the Julian calendar is 1582-10-4, which is followed\nby 1582-10-15, using the Gregorian calendar.\n\nInstances using the date after 1582-10-15 can be compared to\ndatetime.datetime instances and used to compute time differences\n(datetime.timedelta) by subtracting a DatetimeGregorian instance from\na datetime.datetime instanc [...]
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_DatetimeGregorian, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_17DatetimeGregorian_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_DatetimeGregorian, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-static struct __pyx_vtabstruct_10netcdftime_11_netcdftime_DatetimeProlepticGregorian __pyx_vtable_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
-
-static PyObject *__pyx_tp_new_10netcdftime_11_netcdftime_DatetimeProlepticGregorian(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *p;
- PyObject *o = __pyx_tp_new_10netcdftime_11_netcdftime_datetime(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10netcdftime_11_netcdftime_datetime*)__pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
- return o;
-}
-
-static PyMethodDef __pyx_methods_10netcdftime_11_netcdftime_DatetimeProlepticGregorian[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian = {
- PyVarObject_HEAD_INIT(0, 0)
- "netcdftime._netcdftime.DatetimeProlepticGregorian", /*tp_name*/
- sizeof(struct __pyx_obj_10netcdftime_11_netcdftime_DatetimeProlepticGregorian), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_10netcdftime_11_netcdftime_datetime, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_11__repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_pw_10netcdftime_11_netcdftime_8datetime_13__str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "\nPhony datetime object which mimics the python datetime object,\nbut allows for dates that don't exist in the proleptic gregorian calendar.\n\nSupports timedelta operations by overloading + and -.\n\nHas strftime, timetuple, replace, __repr__, and __str__ methods. The\nformat of the string produced by __str__ is controlled by self.format\n(default %Y-%m-%d %H:%M:%S). Supports comparisons with other phony\ndatetime instances using the same calendar; comparison with\ndatetime.datetime [...]
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_10netcdftime_11_netcdftime_DatetimeProlepticGregorian, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pw_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_10netcdftime_11_netcdftime_DatetimeProlepticGregorian, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {"_parse_date", (PyCFunction)__pyx_pw_10netcdftime_11_netcdftime_5_parse_date, METH_O, __pyx_doc_10netcdftime_11_netcdftime_4_parse_date},
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- #if PY_VERSION_HEX < 0x03020000
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
- #else
- PyModuleDef_HEAD_INIT,
- #endif
- "_netcdftime",
- __pyx_k_Performs_conversions_of_netCDF, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_0_1_2, __pyx_k_0_1_2, sizeof(__pyx_k_0_1_2), 0, 0, 1, 0},
- {&__pyx_kp_s_0_r_is_not_present_in_the_mixed, __pyx_k_0_r_is_not_present_in_the_mixed, sizeof(__pyx_k_0_r_is_not_present_in_the_mixed), 0, 0, 1, 0},
- {&__pyx_kp_s_1_4_1, __pyx_k_1_4_1, sizeof(__pyx_k_1_4_1), 0, 0, 1, 0},
- {&__pyx_kp_s_360_day, __pyx_k_360_day, sizeof(__pyx_k_360_day), 0, 0, 1, 0},
- {&__pyx_kp_s_365_day, __pyx_k_365_day, sizeof(__pyx_k_365_day), 0, 0, 1, 0},
- {&__pyx_kp_s_366_day, __pyx_k_366_day, sizeof(__pyx_k_366_day), 0, 0, 1, 0},
- {&__pyx_kp_s_4d, __pyx_k_4d, sizeof(__pyx_k_4d), 0, 0, 1, 0},
- {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
- {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
- {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
- {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
- {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
- {&__pyx_n_s_DateFromJulianDay, __pyx_k_DateFromJulianDay, sizeof(__pyx_k_DateFromJulianDay), 0, 0, 1, 1},
- {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
- {&__pyx_kp_s_Expecting_a_string_r, __pyx_k_Expecting_a_string_r, sizeof(__pyx_k_Expecting_a_string_r), 0, 0, 1, 0},
- {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
- {&__pyx_n_s_ISO8601_REGEX, __pyx_k_ISO8601_REGEX, sizeof(__pyx_k_ISO8601_REGEX), 0, 0, 1, 1},
- {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
- {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
- {&__pyx_n_s_JD, __pyx_k_JD, sizeof(__pyx_k_JD), 0, 0, 1, 1},
- {&__pyx_n_s_JulianDayFromDate, __pyx_k_JulianDayFromDate, sizeof(__pyx_k_JulianDayFromDate), 0, 0, 1, 1},
- {&__pyx_kp_s_Julian_Day_must_be_positive, __pyx_k_Julian_Day_must_be_positive, sizeof(__pyx_k_Julian_Day_must_be_positive), 0, 0, 1, 0},
- {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
- {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
- {&__pyx_kp_s_P_prefix_P_hours_0_9_1_2_P_minu, __pyx_k_P_prefix_P_hours_0_9_1_2_P_minu, sizeof(__pyx_k_P_prefix_P_hours_0_9_1_2_P_minu), 0, 0, 1, 0},
- {&__pyx_kp_s_P_year_0_9_1_4_P_month_0_9_1_2, __pyx_k_P_year_0_9_1_4_P_month_0_9_1_2, sizeof(__pyx_k_P_year_0_9_1_4_P_month_0_9_1_2), 0, 0, 1, 0},
- {&__pyx_kp_s_Performs_conversions_of_netCDF_2, __pyx_k_Performs_conversions_of_netCDF_2, sizeof(__pyx_k_Performs_conversions_of_netCDF_2), 0, 0, 1, 0},
- {&__pyx_kp_s_Some_of_the_times_given_are_afte, __pyx_k_Some_of_the_times_given_are_afte, sizeof(__pyx_k_Some_of_the_times_given_are_afte), 0, 0, 1, 0},
- {&__pyx_kp_s_Some_of_the_times_given_are_befo, __pyx_k_Some_of_the_times_given_are_befo, sizeof(__pyx_k_Some_of_the_times_given_are_befo), 0, 0, 1, 0},
- {&__pyx_kp_s_Some_of_the_times_specified_were, __pyx_k_Some_of_the_times_specified_were, sizeof(__pyx_k_Some_of_the_times_specified_were), 0, 0, 1, 0},
- {&__pyx_n_s_TIMEZONE_REGEX, __pyx_k_TIMEZONE_REGEX, sizeof(__pyx_k_TIMEZONE_REGEX), 0, 0, 1, 1},
- {&__pyx_kp_s_This_strftime_implementation_doe, __pyx_k_This_strftime_implementation_doe, sizeof(__pyx_k_This_strftime_implementation_doe), 0, 0, 1, 0},
- {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
- {&__pyx_kp_s_Unable_to_parse_date_string_r, __pyx_k_Unable_to_parse_date_string_r, sizeof(__pyx_k_Unable_to_parse_date_string_r), 0, 0, 1, 0},
- {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
- {&__pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_k_Volumes_Drobo_python_netcdf4_py, sizeof(__pyx_k_Volumes_Drobo_python_netcdf4_py), 0, 0, 1, 0},
- {&__pyx_kp_s_Y_m_d_H_M_S, __pyx_k_Y_m_d_H_M_S, sizeof(__pyx_k_Y_m_d_H_M_S), 0, 0, 1, 0},
- {&__pyx_n_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 1},
- {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
- {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
- {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
- {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1},
- {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
- {&__pyx_n_s_all_leap, __pyx_k_all_leap, sizeof(__pyx_k_all_leap), 0, 0, 1, 1},
- {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
- {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
- {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
- {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
- {&__pyx_n_s_around, __pyx_k_around, sizeof(__pyx_k_around), 0, 0, 1, 1},
- {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
- {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
- {&__pyx_n_s_atleast_1d, __pyx_k_atleast_1d, sizeof(__pyx_k_atleast_1d), 0, 0, 1, 1},
- {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1},
- {&__pyx_n_s_bisect, __pyx_k_bisect, sizeof(__pyx_k_bisect), 0, 0, 1, 1},
- {&__pyx_n_s_bisect_left, __pyx_k_bisect_left, sizeof(__pyx_k_bisect_left), 0, 0, 1, 1},
- {&__pyx_n_s_bisect_right, __pyx_k_bisect_right, sizeof(__pyx_k_bisect_right), 0, 0, 1, 1},
- {&__pyx_n_s_calendar, __pyx_k_calendar, sizeof(__pyx_k_calendar), 0, 0, 1, 1},
- {&__pyx_kp_s_calendar_must_be_one_of_s_got_s, __pyx_k_calendar_must_be_one_of_s_got_s, sizeof(__pyx_k_calendar_must_be_one_of_s_got_s), 0, 0, 1, 0},
- {&__pyx_n_s_calendars, __pyx_k_calendars, sizeof(__pyx_k_calendars), 0, 0, 1, 1},
- {&__pyx_kp_s_cannot_compare_0_r_and_1_r, __pyx_k_cannot_compare_0_r_and_1_r, sizeof(__pyx_k_cannot_compare_0_r_and_1_r), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_compare_0_r_and_1_r_diffe, __pyx_k_cannot_compare_0_r_and_1_r_diffe, sizeof(__pyx_k_cannot_compare_0_r_and_1_r_diffe), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_compute_the_time_differen, __pyx_k_cannot_compute_the_time_differen, sizeof(__pyx_k_cannot_compute_the_time_differen), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_compute_the_time_differen_2, __pyx_k_cannot_compute_the_time_differen_2, sizeof(__pyx_k_cannot_compute_the_time_differen_2), 0, 0, 1, 0},
- {&__pyx_kp_s_cannot_specify_a_leap_day_as_the, __pyx_k_cannot_specify_a_leap_day_as_the, sizeof(__pyx_k_cannot_specify_a_leap_day_as_the), 0, 0, 1, 0},
- {&__pyx_n_s_cdftime, __pyx_k_cdftime, sizeof(__pyx_k_cdftime), 0, 0, 1, 1},
- {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
- {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
- {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
- {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
- {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
- {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
- {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
- {&__pyx_n_s_date2index, __pyx_k_date2index, sizeof(__pyx_k_date2index), 0, 0, 1, 1},
- {&__pyx_n_s_date2num, __pyx_k_date2num, sizeof(__pyx_k_date2num), 0, 0, 1, 1},
- {&__pyx_n_s_dates, __pyx_k_dates, sizeof(__pyx_k_dates), 0, 0, 1, 1},
- {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
- {&__pyx_n_s_datetime_compatible, __pyx_k_datetime_compatible, sizeof(__pyx_k_datetime_compatible), 0, 0, 1, 1},
- {&__pyx_n_s_datetime_type, __pyx_k_datetime_type, sizeof(__pyx_k_datetime_type), 0, 0, 1, 1},
- {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
- {&__pyx_n_s_day_units, __pyx_k_day_units, sizeof(__pyx_k_day_units), 0, 0, 1, 1},
- {&__pyx_n_s_dayofwk, __pyx_k_dayofwk, sizeof(__pyx_k_dayofwk), 0, 0, 1, 1},
- {&__pyx_n_s_dayofyr, __pyx_k_dayofyr, sizeof(__pyx_k_dayofyr), 0, 0, 1, 1},
- {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
- {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
- {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
- {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
- {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
- {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
- {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1},
- {&__pyx_n_s_exact, __pyx_k_exact, sizeof(__pyx_k_exact), 0, 0, 1, 1},
- {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
- {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 0, 0, 1, 1},
- {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
- {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
- {&__pyx_n_s_fmod, __pyx_k_fmod, sizeof(__pyx_k_fmod), 0, 0, 1, 1},
- {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
- {&__pyx_n_s_gregorian, __pyx_k_gregorian, sizeof(__pyx_k_gregorian), 0, 0, 1, 1},
- {&__pyx_n_s_groupdict, __pyx_k_groupdict, sizeof(__pyx_k_groupdict), 0, 0, 1, 1},
- {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
- {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
- {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
- {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
- {&__pyx_n_s_hr, __pyx_k_hr, sizeof(__pyx_k_hr), 0, 0, 1, 1},
- {&__pyx_n_s_hr_units, __pyx_k_hr_units, sizeof(__pyx_k_hr_units), 0, 0, 1, 1},
- {&__pyx_n_s_hrs, __pyx_k_hrs, sizeof(__pyx_k_hrs), 0, 0, 1, 1},
- {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
- {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1},
- {&__pyx_n_s_illegal_s, __pyx_k_illegal_s, sizeof(__pyx_k_illegal_s), 0, 0, 1, 1},
- {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
- {&__pyx_kp_s_impossible_date_falls_in_gap_bet, __pyx_k_impossible_date_falls_in_gap_bet, sizeof(__pyx_k_impossible_date_falls_in_gap_bet), 0, 0, 1, 0},
- {&__pyx_n_s_inc_idx, __pyx_k_inc_idx, sizeof(__pyx_k_inc_idx), 0, 0, 1, 1},
- {&__pyx_n_s_ind_before, __pyx_k_ind_before, sizeof(__pyx_k_ind_before), 0, 0, 1, 1},
- {&__pyx_n_s_ind_nday_before, __pyx_k_ind_nday_before, sizeof(__pyx_k_ind_nday_before), 0, 0, 1, 1},
- {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
- {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
- {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
- {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
- {&__pyx_kp_s_invalid_day_number_in_0_r, __pyx_k_invalid_day_number_in_0_r, sizeof(__pyx_k_invalid_day_number_in_0_r), 0, 0, 1, 0},
- {&__pyx_kp_s_invalid_month_in_0_r, __pyx_k_invalid_month_in_0_r, sizeof(__pyx_k_invalid_month_in_0_r), 0, 0, 1, 0},
- {&__pyx_kp_s_invalid_year_in_0_r, __pyx_k_invalid_year_in_0_r, sizeof(__pyx_k_invalid_year_in_0_r), 0, 0, 1, 0},
- {&__pyx_n_s_ismasked, __pyx_k_ismasked, sizeof(__pyx_k_ismasked), 0, 0, 1, 1},
- {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
- {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
- {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
- {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
- {&__pyx_n_s_izip, __pyx_k_izip, sizeof(__pyx_k_izip), 0, 0, 1, 1},
- {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
- {&__pyx_n_s_jd, __pyx_k_jd, sizeof(__pyx_k_jd), 0, 0, 1, 1},
- {&__pyx_n_s_jd0, __pyx_k_jd0, sizeof(__pyx_k_jd0), 0, 0, 1, 1},
- {&__pyx_n_s_jdelta, __pyx_k_jdelta, sizeof(__pyx_k_jdelta), 0, 0, 1, 1},
- {&__pyx_n_s_julian, __pyx_k_julian, sizeof(__pyx_k_julian), 0, 0, 1, 1},
- {&__pyx_n_s_leap, __pyx_k_leap, sizeof(__pyx_k_leap), 0, 0, 1, 1},
- {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
- {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
- {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
- {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
- {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
- {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
- {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1},
- {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
- {&__pyx_n_s_microsec, __pyx_k_microsec, sizeof(__pyx_k_microsec), 0, 0, 1, 1},
- {&__pyx_n_s_microsec_units, __pyx_k_microsec_units, sizeof(__pyx_k_microsec_units), 0, 0, 1, 1},
- {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
- {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
- {&__pyx_n_s_microsecs, __pyx_k_microsecs, sizeof(__pyx_k_microsecs), 0, 0, 1, 1},
- {&__pyx_n_s_millisec, __pyx_k_millisec, sizeof(__pyx_k_millisec), 0, 0, 1, 1},
- {&__pyx_n_s_millisec_units, __pyx_k_millisec_units, sizeof(__pyx_k_millisec_units), 0, 0, 1, 1},
- {&__pyx_n_s_millisecond, __pyx_k_millisecond, sizeof(__pyx_k_millisecond), 0, 0, 1, 1},
- {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1},
- {&__pyx_n_s_millisecs, __pyx_k_millisecs, sizeof(__pyx_k_millisecs), 0, 0, 1, 1},
- {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
- {&__pyx_n_s_min_units, __pyx_k_min_units, sizeof(__pyx_k_min_units), 0, 0, 1, 1},
- {&__pyx_n_s_mins, __pyx_k_mins, sizeof(__pyx_k_mins), 0, 0, 1, 1},
- {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
- {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
- {&__pyx_n_s_mismatch, __pyx_k_mismatch, sizeof(__pyx_k_mismatch), 0, 0, 1, 1},
- {&__pyx_n_s_modf, __pyx_k_modf, sizeof(__pyx_k_modf), 0, 0, 1, 1},
- {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
- {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
- {&__pyx_n_s_month_lt_3, __pyx_k_month_lt_3, sizeof(__pyx_k_month_lt_3), 0, 0, 1, 1},
- {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
- {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
- {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
- {&__pyx_n_s_ncnum, __pyx_k_ncnum, sizeof(__pyx_k_ncnum), 0, 0, 1, 1},
- {&__pyx_n_s_nctime, __pyx_k_nctime, sizeof(__pyx_k_nctime), 0, 0, 1, 1},
- {&__pyx_n_s_nday, __pyx_k_nday, sizeof(__pyx_k_nday), 0, 0, 1, 1},
- {&__pyx_n_s_nearest, __pyx_k_nearest, sizeof(__pyx_k_nearest), 0, 0, 1, 1},
- {&__pyx_n_s_nearest_to_left, __pyx_k_nearest_to_left, sizeof(__pyx_k_nearest_to_left), 0, 0, 1, 1},
- {&__pyx_kp_s_negative_reference_year_in_time, __pyx_k_negative_reference_year_in_time, sizeof(__pyx_k_negative_reference_year_in_time), 0, 0, 1, 0},
- {&__pyx_kp_s_netcdf_time_variable_is_missing, __pyx_k_netcdf_time_variable_is_missing, sizeof(__pyx_k_netcdf_time_variable_is_missing), 0, 0, 1, 0},
- {&__pyx_n_s_netcdftime__netcdftime, __pyx_k_netcdftime__netcdftime, sizeof(__pyx_k_netcdftime__netcdftime), 0, 0, 1, 1},
- {&__pyx_kp_s_no_since_in_unit_string, __pyx_k_no_since_in_unit_string, sizeof(__pyx_k_no_since_in_unit_string), 0, 0, 1, 0},
- {&__pyx_n_s_noleap, __pyx_k_noleap, sizeof(__pyx_k_noleap), 0, 0, 1, 1},
- {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1},
- {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
- {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
- {&__pyx_n_s_num2date, __pyx_k_num2date, sizeof(__pyx_k_num2date), 0, 0, 1, 1},
- {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
- {&__pyx_n_s_origin, __pyx_k_origin, sizeof(__pyx_k_origin), 0, 0, 1, 1},
- {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
- {&__pyx_n_s_proleptic_gregorian, __pyx_k_proleptic_gregorian, sizeof(__pyx_k_proleptic_gregorian), 0, 0, 1, 1},
- {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
- {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
- {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
- {&__pyx_n_s_real_datetime, __pyx_k_real_datetime, sizeof(__pyx_k_real_datetime), 0, 0, 1, 1},
- {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
- {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
- {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
- {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0},
- {&__pyx_kp_s_s_is_not_an_option_for_the_sele, __pyx_k_s_is_not_an_option_for_the_sele, sizeof(__pyx_k_s_is_not_an_option_for_the_sele), 0, 0, 1, 0},
- {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1},
- {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1},
- {&__pyx_n_s_sec_units, __pyx_k_sec_units, sizeof(__pyx_k_sec_units), 0, 0, 1, 1},
- {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
- {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1},
- {&__pyx_kp_s_seconds_since_1_1_1, __pyx_k_seconds_since_1_1_1, sizeof(__pyx_k_seconds_since_1_1_1), 0, 0, 1, 0},
- {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1},
- {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
- {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
- {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
- {&__pyx_n_s_since, __pyx_k_since, sizeof(__pyx_k_since), 0, 0, 1, 1},
- {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
- {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
- {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1},
- {&__pyx_n_s_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 0, 1, 1},
- {&__pyx_n_s_strftime, __pyx_k_strftime, sizeof(__pyx_k_strftime), 0, 0, 1, 1},
- {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
- {&__pyx_n_s_t0, __pyx_k_t0, sizeof(__pyx_k_t0), 0, 0, 1, 1},
- {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
- {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
- {&__pyx_kp_s_there_are_only_30_days_in_every, __pyx_k_there_are_only_30_days_in_every, sizeof(__pyx_k_there_are_only_30_days_in_every), 0, 0, 1, 0},
- {&__pyx_kp_s_there_is_no_leap_day_in_the_nole, __pyx_k_there_is_no_leap_day_in_the_nole, sizeof(__pyx_k_there_is_no_leap_day_in_the_nole), 0, 0, 1, 0},
- {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
- {&__pyx_n_s_time2index, __pyx_k_time2index, sizeof(__pyx_k_time2index), 0, 0, 1, 1},
- {&__pyx_n_s_time_value, __pyx_k_time_value, sizeof(__pyx_k_time_value), 0, 0, 1, 1},
- {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
- {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1},
- {&__pyx_n_s_timetuple, __pyx_k_timetuple, sizeof(__pyx_k_timetuple), 0, 0, 1, 1},
- {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
- {&__pyx_n_s_to_real_datetime, __pyx_k_to_real_datetime, sizeof(__pyx_k_to_real_datetime), 0, 0, 1, 1},
- {&__pyx_n_s_tzoffset, __pyx_k_tzoffset, sizeof(__pyx_k_tzoffset), 0, 0, 1, 1},
- {&__pyx_n_s_unit_string, __pyx_k_unit_string, sizeof(__pyx_k_unit_string), 0, 0, 1, 1},
- {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
- {&__pyx_n_s_units_2, __pyx_k_units_2, sizeof(__pyx_k_units_2), 0, 0, 1, 1},
- {&__pyx_kp_s_units_must_be_one_of_seconds_min, __pyx_k_units_must_be_one_of_seconds_min, sizeof(__pyx_k_units_must_be_one_of_seconds_min), 0, 0, 1, 0},
- {&__pyx_kp_s_unknown_calendar_must_be_one_of, __pyx_k_unknown_calendar_must_be_one_of, sizeof(__pyx_k_unknown_calendar_must_be_one_of), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_calendar_0, __pyx_k_unsupported_calendar_0, sizeof(__pyx_k_unsupported_calendar_0), 0, 0, 1, 0},
- {&__pyx_kp_s_unsupported_time_units, __pyx_k_unsupported_time_units, sizeof(__pyx_k_unsupported_time_units), 0, 0, 1, 0},
- {&__pyx_n_s_utime, __pyx_k_utime, sizeof(__pyx_k_utime), 0, 0, 1, 1},
- {&__pyx_n_s_utime___init, __pyx_k_utime___init, sizeof(__pyx_k_utime___init), 0, 0, 1, 1},
- {&__pyx_n_s_utime_date2num, __pyx_k_utime_date2num, sizeof(__pyx_k_utime_date2num), 0, 0, 1, 1},
- {&__pyx_n_s_utime_num2date, __pyx_k_utime_num2date, sizeof(__pyx_k_utime_num2date), 0, 0, 1, 1},
- {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
- {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
- {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
- {&__pyx_kp_s_zero_not_allowed_as_a_reference, __pyx_k_zero_not_allowed_as_a_reference, sizeof(__pyx_k_zero_not_allowed_as_a_reference), 0, 0, 1, 0},
- {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
- {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 18, __pyx_L1_error)
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1537, __pyx_L1_error)
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 123, __pyx_L1_error)
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 993, __pyx_L1_error)
- __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 1050, __pyx_L1_error)
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 1288, __pyx_L1_error)
- __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1307, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "netcdftime/_netcdftime.pyx":123
- * # 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * if np.any((jd >= 2299160.5) & (jd < 2299170.5)): # missing days in Gregorian calendar
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'impossible date (falls in gap between end of Julian calendar and beginning of Gregorian calendar')
- * B = np.zeros(len(jd)) # 1582 October 5 (Julian Calendar)
- */
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_impossible_date_falls_in_gap_bet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 123, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple_);
- __Pyx_GIVEREF(__pyx_tuple_);
-
- /* "netcdftime/_netcdftime.pyx":267
- *
- * if np.min(julian) < 0:
- * raise ValueError('Julian Day must be positive') # <<<<<<<<<<<<<<
- *
- * dayofwk = np.atleast_1d(np.int32(np.fmod(np.int32(julian + 1.5), 7)))
- */
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Julian_Day_must_be_positive); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 267, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__2);
- __Pyx_GIVEREF(__pyx_tuple__2);
-
- /* "netcdftime/_netcdftime.pyx":474
- *
- * if JD < 0:
- * raise ValueError('Julian Day must be positive') # <<<<<<<<<<<<<<
- *
- * dayofwk = int(math.fmod(int(JD + 1.5), 7))
- */
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Julian_Day_must_be_positive); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 474, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__3);
- __Pyx_GIVEREF(__pyx_tuple__3);
-
- /* "netcdftime/_netcdftime.pyx":557
- * "units must be one of 'seconds', 'minutes', 'hours' or 'days' (or singular version of these), got '%s'" % units)
- * if timestr_split[1].lower() != 'since':
- * raise ValueError("no 'since' in unit_string") # <<<<<<<<<<<<<<
- * # parse the date string.
- * n = timestr.find('since') + 6
- */
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_since_in_unit_string); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 557, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__4);
- __Pyx_GIVEREF(__pyx_tuple__4);
-
- /* "netcdftime/_netcdftime.pyx":559
- * raise ValueError("no 'since' in unit_string")
- * # parse the date string.
- * n = timestr.find('since') + 6 # <<<<<<<<<<<<<<
- * year, month, day, hour, minute, second, utc_offset = _parse_date(
- * timestr[n:].strip())
- */
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_since); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 559, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__5);
- __Pyx_GIVEREF(__pyx_tuple__5);
-
- /* "netcdftime/_netcdftime.pyx":720
- * self.unit_string = unit_string
- * if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30:
- */
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_cannot_specify_a_leap_day_as_the); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 720, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
-
- /* "netcdftime/_netcdftime.pyx":723
- * 'cannot specify a leap day as the reference time with the noleap calendar')
- * if self.calendar == '360_day' and self.origin.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * if self.calendar in ['noleap', '365_day']:
- */
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_there_are_only_30_days_in_every); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 723, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
-
- /* "netcdftime/_netcdftime.pyx":770
- * if isscalar:
- * if date.month == 2 and date.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there is no leap day in the noleap calendar')
- * jdelta = _NoLeapDayFromDate(date) - self._jd0
- */
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_there_is_no_leap_day_in_the_nole); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 770, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
-
- /* "netcdftime/_netcdftime.pyx":777
- * for d in date.flat:
- * if d.month == 2 and d.day == 29:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there is no leap day in the noleap calendar')
- * jdelta.append(_NoLeapDayFromDate(d) - self._jd0)
- */
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_there_is_no_leap_day_in_the_nole); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 777, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
-
- /* "netcdftime/_netcdftime.pyx":788
- * if isscalar:
- * if date.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta = _360DayFromDate(date) - self._jd0
- */
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_there_are_only_30_days_in_every); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 788, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
-
- /* "netcdftime/_netcdftime.pyx":795
- * for d in date.flat:
- * if d.day > 30:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'there are only 30 days in every month with the 360_day calendar')
- * jdelta.append(_360DayFromDate(d) - self._jd0)
- */
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_there_are_only_30_days_in_every); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 795, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__11);
- __Pyx_GIVEREF(__pyx_tuple__11);
-
- /* "netcdftime/_netcdftime.pyx":814
- * jdelta = jdelta - self.tzoffset / 1440.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * if isscalar:
- * return jdelta
- */
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unsupported_time_units); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 814, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
-
- /* "netcdftime/_netcdftime.pyx":868
- * jdelta = time_value + self.tzoffset / 1440.
- * else:
- * raise ValueError('unsupported time units') # <<<<<<<<<<<<<<
- * jd = self._jd0 + jdelta
- * if self.calendar in ['julian', 'standard', 'gregorian', 'proleptic_gregorian']:
- */
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unsupported_time_units); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 868, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__13);
- __Pyx_GIVEREF(__pyx_tuple__13);
-
- /* "netcdftime/_netcdftime.pyx":994
- * # array so numpy slicing rules can be used.
- * except IndexError:
- * nctime = nctime[:] # <<<<<<<<<<<<<<
- * t = nctime[indices]
- * # if fancy indexing not available, fall back on this.
- */
- __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 994, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__15);
- __Pyx_GIVEREF(__pyx_slice__15);
-
- /* "netcdftime/_netcdftime.pyx":1051
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * # Setting the calendar.
- * if calendar == None:
- */
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_netcdf_time_variable_is_missing); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1051, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
-
- /* "netcdftime/_netcdftime.pyx":1089
- * nctime.units
- * except AttributeError:
- * raise AttributeError("netcdf time variable is missing a 'units' attribute") # <<<<<<<<<<<<<<
- * # Setting the calendar.
- * if calendar == None:
- */
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_netcdf_time_variable_is_missing); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1089, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
-
- /* "netcdftime/_netcdftime.pyx":1100
- * # This assumes that the times are increasing uniformly.
- * if len(nctime) >= 2:
- * t0, t1 = nctime[:2] # <<<<<<<<<<<<<<
- * dt = t1 - t0
- * else:
- */
- __pyx_slice__18 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(0, 1100, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__18);
- __Pyx_GIVEREF(__pyx_slice__18);
-
- /* "netcdftime/_netcdftime.pyx":1126
- *
- * if select in ['before', 'exact'] and numpy.any(before):
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times given are before the first time in `nctime`.')
- *
- */
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Some_of_the_times_given_are_befo); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
-
- /* "netcdftime/_netcdftime.pyx":1130
- *
- * if select in ['after', 'exact'] and numpy.any(after):
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times given are after the last time in `nctime`.')
- *
- */
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Some_of_the_times_given_are_afte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
-
- /* "netcdftime/_netcdftime.pyx":1142
- * if select == 'exact':
- * if len(mismatch) > 0:
- * raise ValueError( # <<<<<<<<<<<<<<
- * 'Some of the times specified were not found in the `nctime` variable.')
- *
- */
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Some_of_the_times_specified_were); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1142, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
-
- /* "netcdftime/_netcdftime.pyx":1169
- *
- * cdef _toscalar(a):
- * if a.shape in [(), (1,)]: # <<<<<<<<<<<<<<
- * return a.item()
- * else:
- */
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1169, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
-
- /* "netcdftime/_netcdftime.pyx":1328
- * # datetime - datetime
- * if dt.calendar != other.calendar:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * if dt.calendar == "":
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware")
- */
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_cannot_compute_the_time_differen); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1328, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
-
- /* "netcdftime/_netcdftime.pyx":1330
- * raise ValueError("cannot compute the time difference between dates with different calendars")
- * if dt.calendar == "":
- * raise ValueError("cannot compute the time difference between dates that are not calendar-aware") # <<<<<<<<<<<<<<
- * converter = _converters[dt.calendar]
- * return timedelta(seconds=converter.date2num(dt) - converter.date2num(other))
- */
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_cannot_compute_the_time_differen_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1330, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
-
- /* "netcdftime/_netcdftime.pyx":1336
- * # datetime - real_datetime
- * if not dt.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * return dt._to_real_datetime() - other
- * elif isinstance(other, timedelta):
- */
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_cannot_compute_the_time_differen); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1336, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
-
- /* "netcdftime/_netcdftime.pyx":1347
- * # real_datetime - datetime
- * if not other.datetime_compatible:
- * raise ValueError("cannot compute the time difference between dates with different calendars") # <<<<<<<<<<<<<<
- * return self - other._to_real_datetime()
- * else:
- */
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_cannot_compute_the_time_differen); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1347, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
-
- /* "netcdftime/_netcdftime.pyx":1423
- * # dates after 1582-10-15 can be converted to and compared to
- * # proleptic Gregorian dates
- * if self.to_tuple() >= (1582, 10, 15, 0, 0, 0, 0): # <<<<<<<<<<<<<<
- * self.datetime_compatible = True
- * else:
- */
- __pyx_tuple__28 = PyTuple_Pack(7, __pyx_int_1582, __pyx_int_10, __pyx_int_15, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1423, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__28);
- __Pyx_GIVEREF(__pyx_tuple__28);
-
- /* "netcdftime/_netcdftime.pyx":1479
- * cdef _strftime(datetime dt, fmt):
- * if _illegal_s.search(fmt):
- * raise TypeError("This strftime implementation does not handle %s") # <<<<<<<<<<<<<<
- * # don't use strftime method at all.
- * # if dt.year > 1900:
- */
- __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_This_strftime_implementation_doe); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1479, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
-
- /* "netcdftime/_netcdftime.pyx":1494
- * year = year + ((2000 - year) // 28) * 28
- * timetuple = dt.timetuple()
- * s1 = time.strftime(fmt, (year,) + timetuple[1:]) # <<<<<<<<<<<<<<
- * sites1 = _findall(s1, str(year))
- *
- */
- __pyx_slice__30 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 1494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__30);
- __Pyx_GIVEREF(__pyx_slice__30);
-
- /* "netcdftime/_netcdftime.pyx":1497
- * sites1 = _findall(s1, str(year))
- *
- * s2 = time.strftime(fmt, (year + 28,) + timetuple[1:]) # <<<<<<<<<<<<<<
- * sites2 = _findall(s2, str(year + 28))
- *
- */
- __pyx_slice__31 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 1497, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_slice__31);
- __Pyx_GIVEREF(__pyx_slice__31);
-
- /* "netcdftime/_netcdftime.pyx":34
- *
- * # Adapted from http://delete.me.uk/2005/03/iso8601.html
- * ISO8601_REGEX = re.compile(r"(?P<year>[+-]?[0-9]{1,4})(-(?P<month>[0-9]{1,2})(-(?P<day>[0-9]{1,2})" # <<<<<<<<<<<<<<
- * r"(((?P<separator1>.)(?P<hour>[0-9]{1,2}):(?P<minute>[0-9]{1,2})(:(?P<second>[0-9]{1,2})(\.(?P<fraction>[0-9]+))?)?)?"
- * r"((?P<separator2>.?)(?P<timezone>Z|(([-+])([0-9]{1,2}):([0-9]{1,2}))))?)?)?)?"
- */
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_P_year_0_9_1_4_P_month_0_9_1_2); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
-
- /* "netcdftime/_netcdftime.pyx":38
- * r"((?P<separator2>.?)(?P<timezone>Z|(([-+])([0-9]{1,2}):([0-9]{1,2}))))?)?)?)?"
- * )
- * TIMEZONE_REGEX = re.compile( # <<<<<<<<<<<<<<
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- */
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_P_prefix_P_hours_0_9_1_2_P_minu); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 38, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
-
- /* "netcdftime/_netcdftime.pyx":41
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- * def JulianDayFromDate(date, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
- __pyx_tuple__34 = PyTuple_Pack(18, __pyx_n_s_date, __pyx_n_s_calendar, __pyx_n_s_isscalar, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_microsecond, __pyx_n_s_i, __pyx_n_s_d, __pyx_n_s_month_lt_3, __pyx_n_s_A, __pyx_n_s_jd, __pyx_n_s_B, __pyx_n_s_ii, __pyx_n_s_eps); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 41, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
- __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_JulianDayFromDate, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 41, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":236
- *
- *
- * def DateFromJulianDay(JD, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
- __pyx_tuple__36 = PyTuple_Pack(29, __pyx_n_s_JD, __pyx_n_s_calendar, __pyx_n_s_julian, __pyx_n_s_dayofwk, __pyx_n_s_Z, __pyx_n_s_F, __pyx_n_s_alpha, __pyx_n_s_A, __pyx_n_s_ind_before, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_D, __pyx_n_s_E, __pyx_n_s_day, __pyx_n_s_nday, __pyx_n_s_dayofyr, __pyx_n_s_ind_nday_before, __pyx_n_s_month, __pyx_n_s_year, __pyx_n_s_leap, __pyx_n_s_inc_idx, __pyx_n_s_eps, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_microsecond, __pyx_n_s_isscalar, [...]
- __Pyx_GOTREF(__pyx_tuple__36);
- __Pyx_GIVEREF(__pyx_tuple__36);
- __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_DateFromJulianDay, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 236, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":666
- * """
- *
- * def __init__(self, unit_string, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * @param unit_string: a string of the form
- */
- __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_unit_string, __pyx_n_s_calendar, __pyx_n_s_units_2, __pyx_n_s_tzoffset, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__38);
- __Pyx_GIVEREF(__pyx_tuple__38);
- __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_init, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 666, __pyx_L1_error)
- __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_standard)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__40);
- __Pyx_GIVEREF(__pyx_tuple__40);
-
- /* "netcdftime/_netcdftime.pyx":734
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar)
- *
- * def date2num(self, date): # <<<<<<<<<<<<<<
- * """
- * Returns C{time_value} in units described by L{unit_string}, using
- */
- __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_date, __pyx_n_s_isscalar, __pyx_n_s_shape, __pyx_n_s_jdelta, __pyx_n_s_d); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
- __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_date2num, 734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 734, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":820
- * return numpy.reshape(jdelta, shape)
- *
- * def num2date(self, time_value): # <<<<<<<<<<<<<<
- * """
- * Return a 'datetime-like' object given a C{time_value} in units
- */
- __pyx_tuple__43 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_time_value, __pyx_n_s_isscalar, __pyx_n_s_ismasked, __pyx_n_s_mask, __pyx_n_s_shape, __pyx_n_s_jdelta, __pyx_n_s_jd, __pyx_n_s_date, __pyx_n_s_j, __pyx_n_s_m); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 820, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
- __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_num2date, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 820, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1021
- *
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * date2index(dates, nctime, calendar=None, select='exact')
- */
- __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_dates, __pyx_n_s_nctime, __pyx_n_s_calendar, __pyx_n_s_select, __pyx_n_s_cdftime, __pyx_n_s_times); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
- __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_date2index, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1021, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1060
- *
- *
- * def time2index(times, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * time2index(times, nctime, calendar=None, select='exact')
- */
- __pyx_tuple__47 = PyTuple_Pack(18, __pyx_n_s_times, __pyx_n_s_nctime, __pyx_n_s_calendar, __pyx_n_s_select, __pyx_n_s_num, __pyx_n_s_N, __pyx_n_s_t0, __pyx_n_s_t1, __pyx_n_s_dt, __pyx_n_s_index, __pyx_n_s_bisect, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_ncnum, __pyx_n_s_mismatch, __pyx_n_s_nearest_to_left, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1060, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__47);
- __Pyx_GIVEREF(__pyx_tuple__47);
- __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_Drobo_python_netcdf4_py, __pyx_n_s_time2index, 1060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 1060, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":1457
- * is_leap_proleptic_gregorian, False))
- *
- * _illegal_s = re.compile(r"((^|[^%])(%%)*%s)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_s_2); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1457, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
- __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_2_ = PyFloat_FromDouble(2.); if (unlikely(!__pyx_float_2_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_5 = PyFloat_FromDouble(1.5); if (unlikely(!__pyx_float_1_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_float_1e6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_24_ = PyFloat_FromDouble(24.); if (unlikely(!__pyx_float_24_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_30_ = PyFloat_FromDouble(30.); if (unlikely(!__pyx_float_30_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_60_ = PyFloat_FromDouble(60.); if (unlikely(!__pyx_float_60_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_0_25 = PyFloat_FromDouble(0.25); if (unlikely(!__pyx_float_0_25)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_e3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_float_1_e3)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1_e6 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_float_1_e6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_24_0 = PyFloat_FromDouble(24.0); if (unlikely(!__pyx_float_24_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_360_ = PyFloat_FromDouble(360.); if (unlikely(!__pyx_float_360_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_365_ = PyFloat_FromDouble(365.); if (unlikely(!__pyx_float_365_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_366_ = PyFloat_FromDouble(366.); if (unlikely(!__pyx_float_366_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_60_0 = PyFloat_FromDouble(60.0); if (unlikely(!__pyx_float_60_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_122_1 = PyFloat_FromDouble(122.1); if (unlikely(!__pyx_float_122_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1440_ = PyFloat_FromDouble(1440.); if (unlikely(!__pyx_float_1440_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_2000_ = PyFloat_FromDouble(2000.); if (unlikely(!__pyx_float_2000_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_6680_ = PyFloat_FromDouble(6680.); if (unlikely(!__pyx_float_6680_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1440_0 = PyFloat_FromDouble(1440.0); if (unlikely(!__pyx_float_1440_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1524_5 = PyFloat_FromDouble(1524.5); if (unlikely(!__pyx_float_1524_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_365_25 = PyFloat_FromDouble(365.25); if (unlikely(!__pyx_float_365_25)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_86400_ = PyFloat_FromDouble(86400.); if (unlikely(!__pyx_float_86400_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_30_6001 = PyFloat_FromDouble(30.6001); if (unlikely(!__pyx_float_30_6001)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_86400_0 = PyFloat_FromDouble(86400.0); if (unlikely(!__pyx_float_86400_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1867216_ = PyFloat_FromDouble(1867216.); if (unlikely(!__pyx_float_1867216_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_2439870_ = PyFloat_FromDouble(2439870.); if (unlikely(!__pyx_float_2439870_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_36524_25 = PyFloat_FromDouble(36524.25); if (unlikely(!__pyx_float_36524_25)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_1718994_5 = PyFloat_FromDouble(1718994.5); if (unlikely(!__pyx_float_1718994_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_2299160_5 = PyFloat_FromDouble(2299160.5); if (unlikely(!__pyx_float_2299160_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_2299170_5 = PyFloat_FromDouble(2299170.5); if (unlikely(!__pyx_float_2299170_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_86400000_ = PyFloat_FromDouble(86400000.); if (unlikely(!__pyx_float_86400000_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_86400000000_ = PyFloat_FromDouble(86400000000.); if (unlikely(!__pyx_float_86400000000_)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_305 = PyInt_FromLong(305); if (unlikely(!__pyx_int_305)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1524 = PyInt_FromLong(1524); if (unlikely(!__pyx_int_1524)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1582 = PyInt_FromLong(1582); if (unlikely(!__pyx_int_1582)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_4715 = PyInt_FromLong(4715); if (unlikely(!__pyx_int_4715)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_4716 = PyInt_FromLong(4716); if (unlikely(!__pyx_int_4716)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_999999 = PyInt_FromLong(999999L); if (unlikely(!__pyx_int_999999)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC init_netcdftime(void); /*proto*/
-PyMODINIT_FUNC init_netcdftime(void)
-#else
-PyMODINIT_FUNC PyInit__netcdftime(void); /*proto*/
-PyMODINIT_FUNC PyInit__netcdftime(void)
-#endif
-{
- 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_t_6;
- PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
- PyObject *(*__pyx_t_9)(PyObject *);
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- Py_ssize_t __pyx_t_13;
- __Pyx_RefNannyDeclarations
- #if CYTHON_REFNANNY
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- #endif
- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__netcdftime(void)", 0);
- if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
- #ifdef __Pyx_CyFunction_USED
- if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_StopAsyncIteration_USED
- if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4("_netcdftime", __pyx_methods, __pyx_k_Performs_conversions_of_netCDF, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
- Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
- #if CYTHON_COMPILING_IN_PYPY
- Py_INCREF(__pyx_b);
- #endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
- /*--- Initialize various global constants etc. ---*/
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- if (__pyx_module_is_main_netcdftime___netcdftime) {
- if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
- if (!PyDict_GetItemString(modules, "netcdftime._netcdftime")) {
- if (unlikely(PyDict_SetItemString(modules, "netcdftime._netcdftime", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- }
- #endif
- /*--- Builtin init code ---*/
- if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Constants init code ---*/
- if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Global init code ---*/
- __pyx_v_10netcdftime_11_netcdftime__converters = ((PyObject*)Py_None); Py_INCREF(Py_None);
- /*--- Variable export code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- __pyx_vtabptr_10netcdftime_11_netcdftime_datetime = &__pyx_vtable_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_datetime._to_real_datetime = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, int __pyx_skip_dispatch))__pyx_f_10netcdftime_11_netcdftime_8datetime__to_real_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_datetime.to_tuple = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *))__pyx_f_10netcdftime_11_netcdftime_8datetime_to_tuple;
- __pyx_vtable_10netcdftime_11_netcdftime_datetime._getstate = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *))__pyx_f_10netcdftime_11_netcdftime_8datetime__getstate;
- __pyx_vtable_10netcdftime_11_netcdftime_datetime._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_8datetime__add_timedelta;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_datetime) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_datetime.tp_print = 0;
- #if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10netcdftime_11_netcdftime_datetime, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1188, __pyx_L1_error)
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_10netcdftime_11_netcdftime_8datetime___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_10netcdftime_11_netcdftime_8datetime___init__.doc = __pyx_doc_10netcdftime_11_netcdftime_8datetime___init__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10netcdftime_11_netcdftime_8datetime___init__;
- }
- }
- #endif
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_datetime.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_datetime) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "datetime", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_datetime) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_datetime = &__pyx_type_10netcdftime_11_netcdftime_datetime;
- __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeNoLeap = &__pyx_vtable_10netcdftime_11_netcdftime_DatetimeNoLeap;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeNoLeap.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeNoLeap.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_14DatetimeNoLeap__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeNoLeap) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "DatetimeNoLeap", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_DatetimeNoLeap = &__pyx_type_10netcdftime_11_netcdftime_DatetimeNoLeap;
- __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeAllLeap = &__pyx_vtable_10netcdftime_11_netcdftime_DatetimeAllLeap;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeAllLeap.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeAllLeap.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_15DatetimeAllLeap__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeAllLeap) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "DatetimeAllLeap", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_DatetimeAllLeap = &__pyx_type_10netcdftime_11_netcdftime_DatetimeAllLeap;
- __pyx_vtabptr_10netcdftime_11_netcdftime_Datetime360Day = &__pyx_vtable_10netcdftime_11_netcdftime_Datetime360Day;
- __pyx_vtable_10netcdftime_11_netcdftime_Datetime360Day.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_Datetime360Day.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_14Datetime360Day__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_Datetime360Day.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_Datetime360Day) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_Datetime360Day.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_Datetime360Day.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_Datetime360Day) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "Datetime360Day", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_Datetime360Day) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_Datetime360Day = &__pyx_type_10netcdftime_11_netcdftime_Datetime360Day;
- __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeJulian = &__pyx_vtable_10netcdftime_11_netcdftime_DatetimeJulian;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeJulian.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeJulian.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_14DatetimeJulian__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_DatetimeJulian.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_DatetimeJulian) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_DatetimeJulian.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_DatetimeJulian.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeJulian) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "DatetimeJulian", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_DatetimeJulian) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_DatetimeJulian = &__pyx_type_10netcdftime_11_netcdftime_DatetimeJulian;
- __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeGregorian = &__pyx_vtable_10netcdftime_11_netcdftime_DatetimeGregorian;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeGregorian.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeGregorian.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_17DatetimeGregorian__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeGregorian) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "DatetimeGregorian", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_DatetimeGregorian = &__pyx_type_10netcdftime_11_netcdftime_DatetimeGregorian;
- __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeProlepticGregorian = &__pyx_vtable_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeProlepticGregorian.__pyx_base = *__pyx_vtabptr_10netcdftime_11_netcdftime_datetime;
- __pyx_vtable_10netcdftime_11_netcdftime_DatetimeProlepticGregorian.__pyx_base._add_timedelta = (PyObject *(*)(struct __pyx_obj_10netcdftime_11_netcdftime_datetime *, PyObject *))__pyx_f_10netcdftime_11_netcdftime_26DatetimeProlepticGregorian__add_timedelta;
- __pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian.tp_base = __pyx_ptype_10netcdftime_11_netcdftime_datetime;
- if (PyType_Ready(&__pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
- __pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian.tp_dict, __pyx_vtabptr_10netcdftime_11_netcdftime_DatetimeProlepticGregorian) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
- if (PyObject_SetAttrString(__pyx_m, "DatetimeProlepticGregorian", (PyObject *)&__pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
- __pyx_ptype_10netcdftime_11_netcdftime_DatetimeProlepticGregorian = &__pyx_type_10netcdftime_11_netcdftime_DatetimeProlepticGregorian;
- /*--- Type import code ---*/
- __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
- #if CYTHON_COMPILING_IN_PYPY
- sizeof(PyTypeObject),
- #else
- sizeof(PyHeapTypeObject),
- #endif
- 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
- /*--- Variable import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
- #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
-
- /* "netcdftime/_netcdftime.pyx":7
- * from cpython.object cimport PyObject_RichCompare
- *
- * import numpy as np # <<<<<<<<<<<<<<
- * import math
- * import numpy
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":8
- *
- * import numpy as np
- * import math # <<<<<<<<<<<<<<
- * import numpy
- * import re
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":9
- * import numpy as np
- * import math
- * import numpy # <<<<<<<<<<<<<<
- * import re
- *
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":10
- * import math
- * import numpy
- * import re # <<<<<<<<<<<<<<
- *
- * from datetime import datetime as real_datetime
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":12
- * import re
- *
- * from datetime import datetime as real_datetime # <<<<<<<<<<<<<<
- * from datetime import timedelta
- * import time # strftime
- */
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_n_s_datetime);
- __Pyx_GIVEREF(__pyx_n_s_datetime);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_real_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":13
- *
- * from datetime import datetime as real_datetime
- * from datetime import timedelta # <<<<<<<<<<<<<<
- * import time # strftime
- *
- */
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_timedelta);
- __Pyx_GIVEREF(__pyx_n_s_timedelta);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_timedelta);
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":14
- * from datetime import datetime as real_datetime
- * from datetime import timedelta
- * import time # strftime # <<<<<<<<<<<<<<
- *
- * try:
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":16
- * import time # strftime
- *
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError: # python 3.x
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_5);
- /*try:*/ {
-
- /* "netcdftime/_netcdftime.pyx":17
- *
- * try:
- * from itertools import izip as zip # <<<<<<<<<<<<<<
- * except ImportError: # python 3.x
- * pass
- */
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_n_s_izip);
- __Pyx_GIVEREF(__pyx_n_s_izip);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_izip);
- __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_izip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L2_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L2_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":16
- * import time # strftime
- *
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError: # python 3.x
- */
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L9_try_end;
- __pyx_L2_error:;
- __Pyx_PyThreadState_assign
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":18
- * try:
- * from itertools import izip as zip
- * except ImportError: # python 3.x # <<<<<<<<<<<<<<
- * pass
- *
- */
- __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_6) {
- __Pyx_ErrRestore(0,0,0);
- goto __pyx_L3_exception_handled;
- }
- goto __pyx_L4_except_error;
- __pyx_L4_except_error:;
-
- /* "netcdftime/_netcdftime.pyx":16
- * import time # strftime
- *
- * try: # <<<<<<<<<<<<<<
- * from itertools import izip as zip
- * except ImportError: # python 3.x
- */
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L1_error;
- __pyx_L3_exception_handled:;
- __Pyx_PyThreadState_assign
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- __pyx_L9_try_end:;
- }
-
- /* "netcdftime/_netcdftime.pyx":21
- * pass
- *
- * microsec_units = ['microseconds','microsecond', 'microsec', 'microsecs'] # <<<<<<<<<<<<<<
- * millisec_units = ['milliseconds', 'millisecond', 'millisec', 'millisecs']
- * sec_units = ['second', 'seconds', 'sec', 'secs', 's']
- */
- __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_microseconds);
- __Pyx_GIVEREF(__pyx_n_s_microseconds);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_microseconds);
- __Pyx_INCREF(__pyx_n_s_microsecond);
- __Pyx_GIVEREF(__pyx_n_s_microsecond);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_microsecond);
- __Pyx_INCREF(__pyx_n_s_microsec);
- __Pyx_GIVEREF(__pyx_n_s_microsec);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_microsec);
- __Pyx_INCREF(__pyx_n_s_microsecs);
- __Pyx_GIVEREF(__pyx_n_s_microsecs);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_microsecs);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_microsec_units, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":22
- *
- * microsec_units = ['microseconds','microsecond', 'microsec', 'microsecs']
- * millisec_units = ['milliseconds', 'millisecond', 'millisec', 'millisecs'] # <<<<<<<<<<<<<<
- * sec_units = ['second', 'seconds', 'sec', 'secs', 's']
- * min_units = ['minute', 'minutes', 'min', 'mins']
- */
- __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_milliseconds);
- __Pyx_GIVEREF(__pyx_n_s_milliseconds);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_milliseconds);
- __Pyx_INCREF(__pyx_n_s_millisecond);
- __Pyx_GIVEREF(__pyx_n_s_millisecond);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_millisecond);
- __Pyx_INCREF(__pyx_n_s_millisec);
- __Pyx_GIVEREF(__pyx_n_s_millisec);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_millisec);
- __Pyx_INCREF(__pyx_n_s_millisecs);
- __Pyx_GIVEREF(__pyx_n_s_millisecs);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_millisecs);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_millisec_units, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":23
- * microsec_units = ['microseconds','microsecond', 'microsec', 'microsecs']
- * millisec_units = ['milliseconds', 'millisecond', 'millisec', 'millisecs']
- * sec_units = ['second', 'seconds', 'sec', 'secs', 's'] # <<<<<<<<<<<<<<
- * min_units = ['minute', 'minutes', 'min', 'mins']
- * hr_units = ['hour', 'hours', 'hr', 'hrs', 'h']
- */
- __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_second);
- __Pyx_GIVEREF(__pyx_n_s_second);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_second);
- __Pyx_INCREF(__pyx_n_s_seconds);
- __Pyx_GIVEREF(__pyx_n_s_seconds);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_seconds);
- __Pyx_INCREF(__pyx_n_s_sec);
- __Pyx_GIVEREF(__pyx_n_s_sec);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_sec);
- __Pyx_INCREF(__pyx_n_s_secs);
- __Pyx_GIVEREF(__pyx_n_s_secs);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_secs);
- __Pyx_INCREF(__pyx_n_s_s);
- __Pyx_GIVEREF(__pyx_n_s_s);
- PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_s);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sec_units, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":24
- * millisec_units = ['milliseconds', 'millisecond', 'millisec', 'millisecs']
- * sec_units = ['second', 'seconds', 'sec', 'secs', 's']
- * min_units = ['minute', 'minutes', 'min', 'mins'] # <<<<<<<<<<<<<<
- * hr_units = ['hour', 'hours', 'hr', 'hrs', 'h']
- * day_units = ['day', 'days', 'd']
- */
- __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_minute);
- __Pyx_GIVEREF(__pyx_n_s_minute);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_minute);
- __Pyx_INCREF(__pyx_n_s_minutes);
- __Pyx_GIVEREF(__pyx_n_s_minutes);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_minutes);
- __Pyx_INCREF(__pyx_n_s_min);
- __Pyx_GIVEREF(__pyx_n_s_min);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_min);
- __Pyx_INCREF(__pyx_n_s_mins);
- __Pyx_GIVEREF(__pyx_n_s_mins);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_mins);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_units, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":25
- * sec_units = ['second', 'seconds', 'sec', 'secs', 's']
- * min_units = ['minute', 'minutes', 'min', 'mins']
- * hr_units = ['hour', 'hours', 'hr', 'hrs', 'h'] # <<<<<<<<<<<<<<
- * day_units = ['day', 'days', 'd']
- * _units = microsec_units+millisec_units+sec_units+min_units+hr_units+day_units
- */
- __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_hour);
- __Pyx_GIVEREF(__pyx_n_s_hour);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hour);
- __Pyx_INCREF(__pyx_n_s_hours);
- __Pyx_GIVEREF(__pyx_n_s_hours);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_hours);
- __Pyx_INCREF(__pyx_n_s_hr);
- __Pyx_GIVEREF(__pyx_n_s_hr);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_hr);
- __Pyx_INCREF(__pyx_n_s_hrs);
- __Pyx_GIVEREF(__pyx_n_s_hrs);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_hrs);
- __Pyx_INCREF(__pyx_n_s_h);
- __Pyx_GIVEREF(__pyx_n_s_h);
- PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_h);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_hr_units, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":26
- * min_units = ['minute', 'minutes', 'min', 'mins']
- * hr_units = ['hour', 'hours', 'hr', 'hrs', 'h']
- * day_units = ['day', 'days', 'd'] # <<<<<<<<<<<<<<
- * _units = microsec_units+millisec_units+sec_units+min_units+hr_units+day_units
- * _calendars = ['standard', 'gregorian', 'proleptic_gregorian',
- */
- __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_n_s_day);
- __Pyx_GIVEREF(__pyx_n_s_day);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_day);
- __Pyx_INCREF(__pyx_n_s_days);
- __Pyx_GIVEREF(__pyx_n_s_days);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_days);
- __Pyx_INCREF(__pyx_n_s_d);
- __Pyx_GIVEREF(__pyx_n_s_d);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_d);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_day_units, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":27
- * hr_units = ['hour', 'hours', 'hr', 'hrs', 'h']
- * day_units = ['day', 'days', 'd']
- * _units = microsec_units+millisec_units+sec_units+min_units+hr_units+day_units # <<<<<<<<<<<<<<
- * _calendars = ['standard', 'gregorian', 'proleptic_gregorian',
- * 'noleap', 'julian', 'all_leap', '365_day', '366_day', '360_day']
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_microsec_units); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_millisec_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sec_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hr_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_day_units); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_units, __pyx_t_7) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":28
- * day_units = ['day', 'days', 'd']
- * _units = microsec_units+millisec_units+sec_units+min_units+hr_units+day_units
- * _calendars = ['standard', 'gregorian', 'proleptic_gregorian', # <<<<<<<<<<<<<<
- * 'noleap', 'julian', 'all_leap', '365_day', '366_day', '360_day']
- *
- */
- __pyx_t_7 = PyList_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_n_s_standard);
- __Pyx_GIVEREF(__pyx_n_s_standard);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_standard);
- __Pyx_INCREF(__pyx_n_s_gregorian);
- __Pyx_GIVEREF(__pyx_n_s_gregorian);
- PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_gregorian);
- __Pyx_INCREF(__pyx_n_s_proleptic_gregorian);
- __Pyx_GIVEREF(__pyx_n_s_proleptic_gregorian);
- PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_proleptic_gregorian);
- __Pyx_INCREF(__pyx_n_s_noleap);
- __Pyx_GIVEREF(__pyx_n_s_noleap);
- PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_noleap);
- __Pyx_INCREF(__pyx_n_s_julian);
- __Pyx_GIVEREF(__pyx_n_s_julian);
- PyList_SET_ITEM(__pyx_t_7, 4, __pyx_n_s_julian);
- __Pyx_INCREF(__pyx_n_s_all_leap);
- __Pyx_GIVEREF(__pyx_n_s_all_leap);
- PyList_SET_ITEM(__pyx_t_7, 5, __pyx_n_s_all_leap);
- __Pyx_INCREF(__pyx_kp_s_365_day);
- __Pyx_GIVEREF(__pyx_kp_s_365_day);
- PyList_SET_ITEM(__pyx_t_7, 6, __pyx_kp_s_365_day);
- __Pyx_INCREF(__pyx_kp_s_366_day);
- __Pyx_GIVEREF(__pyx_kp_s_366_day);
- PyList_SET_ITEM(__pyx_t_7, 7, __pyx_kp_s_366_day);
- __Pyx_INCREF(__pyx_kp_s_360_day);
- __Pyx_GIVEREF(__pyx_kp_s_360_day);
- PyList_SET_ITEM(__pyx_t_7, 8, __pyx_kp_s_360_day);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_calendars, __pyx_t_7) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":31
- * 'noleap', 'julian', 'all_leap', '365_day', '366_day', '360_day']
- *
- * __version__ = '1.4.1' # <<<<<<<<<<<<<<
- *
- * # Adapted from http://delete.me.uk/2005/03/iso8601.html
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_1_4_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
-
- /* "netcdftime/_netcdftime.pyx":34
- *
- * # Adapted from http://delete.me.uk/2005/03/iso8601.html
- * ISO8601_REGEX = re.compile(r"(?P<year>[+-]?[0-9]{1,4})(-(?P<month>[0-9]{1,2})(-(?P<day>[0-9]{1,2})" # <<<<<<<<<<<<<<
- * r"(((?P<separator1>.)(?P<hour>[0-9]{1,2}):(?P<minute>[0-9]{1,2})(:(?P<second>[0-9]{1,2})(\.(?P<fraction>[0-9]+))?)?)?"
- * r"((?P<separator2>.?)(?P<timezone>Z|(([-+])([0-9]{1,2}):([0-9]{1,2}))))?)?)?)?"
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ISO8601_REGEX, __pyx_t_7) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":38
- * r"((?P<separator2>.?)(?P<timezone>Z|(([-+])([0-9]{1,2}):([0-9]{1,2}))))?)?)?)?"
- * )
- * TIMEZONE_REGEX = re.compile( # <<<<<<<<<<<<<<
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMEZONE_REGEX, __pyx_t_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":41
- * "(?P<prefix>[+-])(?P<hours>[0-9]{1,2}):(?P<minutes>[0-9]{1,2})")
- *
- * def JulianDayFromDate(date, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
- __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_1JulianDayFromDate, NULL, __pyx_n_s_netcdftime__netcdftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_JulianDayFromDate, __pyx_t_7) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":236
- *
- *
- * def DateFromJulianDay(JD, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- *
- */
- __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_3DateFromJulianDay, NULL, __pyx_n_s_netcdftime__netcdftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DateFromJulianDay, __pyx_t_7) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":565
- *
- *
- * class utime: # <<<<<<<<<<<<<<
- *
- * """
- */
- __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_utime, __pyx_n_s_utime, (PyObject *) NULL, __pyx_n_s_netcdftime__netcdftime, __pyx_kp_s_Performs_conversions_of_netCDF_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "netcdftime/_netcdftime.pyx":666
- * """
- *
- * def __init__(self, unit_string, calendar='standard'): # <<<<<<<<<<<<<<
- * """
- * @param unit_string: a string of the form
- */
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_5utime_1__init__, 0, __pyx_n_s_utime___init, NULL, __pyx_n_s_netcdftime__netcdftime, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__40);
- if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":734
- * self._jd0 = JulianDayFromDate(self.origin, calendar=self.calendar)
- *
- * def date2num(self, date): # <<<<<<<<<<<<<<
- * """
- * Returns C{time_value} in units described by L{unit_string}, using
- */
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_5utime_3date2num, 0, __pyx_n_s_utime_date2num, NULL, __pyx_n_s_netcdftime__netcdftime, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_date2num, __pyx_t_1) < 0) __PYX_ERR(0, 734, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":820
- * return numpy.reshape(jdelta, shape)
- *
- * def num2date(self, time_value): # <<<<<<<<<<<<<<
- * """
- * Return a 'datetime-like' object given a C{time_value} in units
- */
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_5utime_5num2date, 0, __pyx_n_s_utime_num2date, NULL, __pyx_n_s_netcdftime__netcdftime, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_num2date, __pyx_t_1) < 0) __PYX_ERR(0, 820, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":565
- *
- *
- * class utime: # <<<<<<<<<<<<<<
- *
- * """
- */
- __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_utime, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_utime, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1021
- *
- *
- * def date2index(dates, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * date2index(dates, nctime, calendar=None, select='exact')
- */
- __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_7date2index, NULL, __pyx_n_s_netcdftime__netcdftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date2index, __pyx_t_7) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1060
- *
- *
- * def time2index(times, nctime, calendar=None, select='exact'): # <<<<<<<<<<<<<<
- * """
- * time2index(times, nctime, calendar=None, select='exact')
- */
- __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_10netcdftime_11_netcdftime_9time2index, NULL, __pyx_n_s_netcdftime__netcdftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_time2index, __pyx_t_7) < 0) __PYX_ERR(0, 1060, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1184
- * # a cache of converters (utime instances) for different calendars
- * cdef dict _converters
- * _converters = {} # <<<<<<<<<<<<<<
- * for calendar in _calendars:
- * _converters[calendar] = utime("seconds since 1-1-1", calendar)
- */
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1184, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XGOTREF(__pyx_v_10netcdftime_11_netcdftime__converters);
- __Pyx_DECREF_SET(__pyx_v_10netcdftime_11_netcdftime__converters, ((PyObject*)__pyx_t_7));
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1185
- * cdef dict _converters
- * _converters = {}
- * for calendar in _calendars: # <<<<<<<<<<<<<<
- * _converters[calendar] = utime("seconds since 1-1-1", calendar)
- *
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendars); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1185, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- 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_8 = 0;
- __pyx_t_9 = NULL;
- } else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1185, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1185, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1185, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- } else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1185, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1185, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- }
- } else {
- __pyx_t_7 = __pyx_t_9(__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_ERR(0, 1185, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_calendar, __pyx_t_7) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1186
- * _converters = {}
- * for calendar in _calendars:
- * _converters[calendar] = utime("seconds since 1-1-1", calendar) # <<<<<<<<<<<<<<
- *
- * cdef class datetime(object):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_utime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(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);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_s_seconds_since_1_1_1, __pyx_t_10};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
- PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_s_seconds_since_1_1_1, __pyx_t_10};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_11) {
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
- }
- __Pyx_INCREF(__pyx_kp_s_seconds_since_1_1_1);
- __Pyx_GIVEREF(__pyx_kp_s_seconds_since_1_1_1);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_s_seconds_since_1_1_1);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(__pyx_v_10netcdftime_11_netcdftime__converters == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- __PYX_ERR(0, 1186, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(PyDict_SetItem(__pyx_v_10netcdftime_11_netcdftime__converters, __pyx_t_2, __pyx_t_7) < 0)) __PYX_ERR(0, 1186, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1185
- * cdef dict _converters
- * _converters = {}
- * for calendar in _calendars: # <<<<<<<<<<<<<<
- * _converters[calendar] = utime("seconds since 1-1-1", calendar)
- *
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1457
- * is_leap_proleptic_gregorian, False))
- *
- * _illegal_s = re.compile(r"((^|[^%])(%%)*%s)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1457, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_illegal_s, __pyx_t_1) < 0) __PYX_ERR(0, 1457, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1537
- * cdef int[13] month_lengths_365_day, month_lengths_366_day
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]): # <<<<<<<<<<<<<<
- * month_lengths_365_day[j] = N
- *
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_1 = __pyx_int_0;
- __pyx_t_7 = PyList_New(13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1537, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_28);
- __Pyx_GIVEREF(__pyx_int_28);
- PyList_SET_ITEM(__pyx_t_7, 2, __pyx_int_28);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 3, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_7, 4, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 5, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_7, 6, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 7, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 8, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_7, 9, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 10, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_7, 11, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_7, 12, __pyx_int_31);
- __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (__pyx_t_8 >= 13) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __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_ERR(0, 1537, __pyx_L1_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1537, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_N, __pyx_t_7) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_j, __pyx_t_1) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
- __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1537, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1538
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]):
- * month_lengths_365_day[j] = N # <<<<<<<<<<<<<<
- *
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- */
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1538, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1538, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- (__pyx_v_10netcdftime_11_netcdftime_month_lengths_365_day[__pyx_t_13]) = __pyx_t_6;
-
- /* "netcdftime/_netcdftime.pyx":1537
- * cdef int[13] month_lengths_365_day, month_lengths_366_day
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]): # <<<<<<<<<<<<<<
- * month_lengths_365_day[j] = N
- *
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1541
- *
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]): # <<<<<<<<<<<<<<
- * month_lengths_366_day[j] = N
- *
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_1 = __pyx_int_0;
- __pyx_t_2 = PyList_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_29);
- __Pyx_GIVEREF(__pyx_int_29);
- PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_29);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 3, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_2, 4, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 5, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_2, 6, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 7, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 8, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_2, 9, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 10, __pyx_int_31);
- __Pyx_INCREF(__pyx_int_30);
- __Pyx_GIVEREF(__pyx_int_30);
- PyList_SET_ITEM(__pyx_t_2, 11, __pyx_int_30);
- __Pyx_INCREF(__pyx_int_31);
- __Pyx_GIVEREF(__pyx_int_31);
- PyList_SET_ITEM(__pyx_t_2, 12, __pyx_int_31);
- __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (__pyx_t_8 >= 13) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1541, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_N, __pyx_t_2) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_j, __pyx_t_1) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1542
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]):
- * month_lengths_366_day[j] = N # <<<<<<<<<<<<<<
- *
- * cdef int* month_lengths(bint (*is_leap)(int), int year):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1542, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- (__pyx_v_10netcdftime_11_netcdftime_month_lengths_366_day[__pyx_t_13]) = __pyx_t_6;
-
- /* "netcdftime/_netcdftime.pyx":1541
- *
- * # Dummy Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
- * for j,N in enumerate([-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]): # <<<<<<<<<<<<<<
- * month_lengths_366_day[j] = N
- *
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "netcdftime/_netcdftime.pyx":1
- * """ # <<<<<<<<<<<<<<
- * Performs conversions of netCDF time coordinate data to/from datetime objects.
- * """
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /*--- Wrapped vars code ---*/
-
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_12);
- if (__pyx_m) {
- if (__pyx_d) {
- __Pyx_AddTraceback("init netcdftime._netcdftime", __pyx_clineno, __pyx_lineno, __pyx_filename);
- }
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init netcdftime._netcdftime");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-/* --- Runtime support code --- */
-/* Refnanny */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif
-
-/* GetBuiltinName */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-/* RaiseDoubleKeywords */
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-/* ParseKeywords */
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%.200s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%.200s() got an unexpected keyword argument '%.200s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-/* RaiseArgTupleInvalid */
-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)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-/* GetItemInt */
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- return NULL;
- PyErr_Clear();
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-/* SaveResetException */
-#if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-}
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-#endif
-
-/* GetException */
-#if CYTHON_FAST_THREAD_STATE
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-#endif
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_FAST_THREAD_STATE
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_FAST_THREAD_STATE
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (local_tb) {
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- }
- #endif
- Py_XINCREF(local_tb);
- Py_XINCREF(local_type);
- Py_XINCREF(local_value);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_FAST_THREAD_STATE
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-/* GetModuleGlobalName */
- static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
- PyObject *result;
-#if !CYTHON_AVOID_BORROWED_REFS
- result = PyDict_GetItem(__pyx_d, name);
- if (likely(result)) {
- Py_INCREF(result);
- } else {
-#else
- result = PyObject_GetItem(__pyx_d, name);
- if (!result) {
- PyErr_Clear();
-#endif
- result = __Pyx_GetBuiltinName(name);
- }
- return result;
-}
-
-/* PyCFunctionFastCall */
- #if CYTHON_FAST_PYCCALL
-static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
- PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
- PyObject *result;
- int flags;
- assert(PyCFunction_Check(func));
- assert(METH_FASTCALL == PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST));
- assert(nargs >= 0);
- assert(nargs == 0 || args != NULL);
- /* _PyCFunction_FastCallDict() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller loses its exception */
- assert(!PyErr_Occurred());
- return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
-}
-#endif // CYTHON_FAST_PYCCALL
-
-/* PyFunctionFastCall */
- #if CYTHON_FAST_PYCALL
-#include "frameobject.h"
-static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
- PyObject *globals) {
- PyFrameObject *f;
- PyThreadState *tstate = PyThreadState_GET();
- PyObject **fastlocals;
- Py_ssize_t i;
- PyObject *result;
- assert(globals != NULL);
- /* XXX Perhaps we should create a specialized
- PyFrame_New() that doesn't take locals, but does
- take builtins without sanity checking them.
- */
- assert(tstate != NULL);
- f = PyFrame_New(tstate, co, globals, NULL);
- if (f == NULL) {
- return NULL;
- }
- fastlocals = f->f_localsplus;
- for (i = 0; i < na; i++) {
- Py_INCREF(*args);
- fastlocals[i] = *args++;
- }
- result = PyEval_EvalFrameEx(f,0);
- ++tstate->recursion_depth;
- Py_DECREF(f);
- --tstate->recursion_depth;
- return result;
-}
-#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
- PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
- PyObject *globals = PyFunction_GET_GLOBALS(func);
- PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
- PyObject *closure;
-#if PY_MAJOR_VERSION >= 3
- PyObject *kwdefs;
-#endif
- PyObject *kwtuple, **k;
- PyObject **d;
- Py_ssize_t nd;
- Py_ssize_t nk;
- PyObject *result;
- assert(kwargs == NULL || PyDict_Check(kwargs));
- nk = kwargs ? PyDict_Size(kwargs) : 0;
- if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
- return NULL;
- }
- if (
-#if PY_MAJOR_VERSION >= 3
- co->co_kwonlyargcount == 0 &&
-#endif
- likely(kwargs == NULL || nk == 0) &&
- co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
- if (argdefs == NULL && co->co_argcount == nargs) {
- result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
- goto done;
- }
- else if (nargs == 0 && argdefs != NULL
- && co->co_argcount == Py_SIZE(argdefs)) {
- /* function called with no arguments, but all parameters have
- a default value: use default values as arguments .*/
- args = &PyTuple_GET_ITEM(argdefs, 0);
- result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
- goto done;
- }
- }
- if (kwargs != NULL) {
- Py_ssize_t pos, i;
- kwtuple = PyTuple_New(2 * nk);
- if (kwtuple == NULL) {
- result = NULL;
- goto done;
- }
- k = &PyTuple_GET_ITEM(kwtuple, 0);
- pos = i = 0;
- while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
- Py_INCREF(k[i]);
- Py_INCREF(k[i+1]);
- i += 2;
- }
- nk = i / 2;
- }
- else {
- kwtuple = NULL;
- k = NULL;
- }
- closure = PyFunction_GET_CLOSURE(func);
-#if PY_MAJOR_VERSION >= 3
- kwdefs = PyFunction_GET_KW_DEFAULTS(func);
-#endif
- if (argdefs != NULL) {
- d = &PyTuple_GET_ITEM(argdefs, 0);
- nd = Py_SIZE(argdefs);
- }
- else {
- d = NULL;
- nd = 0;
- }
-#if PY_MAJOR_VERSION >= 3
- result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
- args, nargs,
- k, (int)nk,
- d, (int)nd, kwdefs, closure);
-#else
- result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
- args, nargs,
- k, (int)nk,
- d, (int)nd, closure);
-#endif
- Py_XDECREF(kwtuple);
-done:
- Py_LeaveRecursiveCall();
- return result;
-}
-#endif // CPython < 3.6
-#endif // CYTHON_FAST_PYCALL
-
-/* PyObjectCall */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- PyObject *result;
- ternaryfunc call = func->ob_type->tp_call;
- if (unlikely(!call))
- return PyObject_Call(func, arg, kw);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = (*call)(func, arg, kw);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* PyObjectCallMethO */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
- PyObject *self, *result;
- PyCFunction cfunc;
- cfunc = PyCFunction_GET_FUNCTION(func);
- self = PyCFunction_GET_SELF(func);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = cfunc(self, arg);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* PyObjectCallOneArg */
- #if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_New(1);
- if (unlikely(!args)) return NULL;
- Py_INCREF(arg);
- PyTuple_SET_ITEM(args, 0, arg);
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
-#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(func)) {
- return __Pyx_PyFunction_FastCall(func, &arg, 1);
- }
-#endif
-#ifdef __Pyx_CyFunction_USED
- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
-#else
- if (likely(PyCFunction_Check(func))) {
-#endif
- if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
- return __Pyx_PyObject_CallMethO(func, arg);
-#if CYTHON_FAST_PYCCALL
- } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
- return __Pyx_PyCFunction_FastCall(func, &arg, 1);
-#endif
- }
- }
- return __Pyx__PyObject_CallOneArg(func, arg);
-}
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_Pack(1, arg);
- if (unlikely(!args)) return NULL;
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-#endif
-
-/* PyObjectCallNoArg */
- #if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
-#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(func)) {
- return __Pyx_PyFunction_FastCall(func, NULL, 0);
- }
-#endif
-#ifdef __Pyx_CyFunction_USED
- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
-#else
- if (likely(PyCFunction_Check(func))) {
-#endif
- if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
- return __Pyx_PyObject_CallMethO(func, NULL);
- }
- }
- return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
-}
-#endif
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a + b);
- if (likely((x^a) >= 0 || (x^b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- }
- x = a + b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla + llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("add", return NULL)
- result = ((double)a) + (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
-}
-#endif
-
-/* PyFloatBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
- const double b = floatval;
- double a, result;
- if (likely(PyFloat_CheckExact(op1))) {
- a = PyFloat_AS_DOUBLE(op1);
- } else
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- a = (double) PyInt_AS_LONG(op1);
- } else
- #endif
- if (likely(PyLong_CheckExact(op1))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- switch (size) {
- case 0: a = 0.0; break;
- case -1: a = -(double) digits[0]; break;
- case 1: a = (double) digits[0]; break;
- case -2:
- case 2:
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
- a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -2)
- a = -a;
- break;
- }
- }
- case -3:
- case 3:
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
- a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -3)
- a = -a;
- break;
- }
- }
- case -4:
- case 4:
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
- a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -4)
- a = -a;
- break;
- }
- }
- default:
- #else
- {
- #endif
- a = PyLong_AsDouble(op1);
- if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
- }
- } else {
- return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
- }
- PyFPE_START_PROTECT("divide", return NULL)
- result = a / b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
-}
-#endif
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a - b);
- if (likely((x^a) >= 0 || (x^~b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- }
- x = a - b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla - llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("subtract", return NULL)
- result = ((double)a) - (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
-}
-#endif
-
-/* PyFloatBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
- const double b = floatval;
- double a, result;
- if (likely(PyFloat_CheckExact(op1))) {
- a = PyFloat_AS_DOUBLE(op1);
- } else
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- a = (double) PyInt_AS_LONG(op1);
- } else
- #endif
- if (likely(PyLong_CheckExact(op1))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- switch (size) {
- case 0: a = 0.0; break;
- case -1: a = -(double) digits[0]; break;
- case 1: a = (double) digits[0]; break;
- case -2:
- case 2:
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
- a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -2)
- a = -a;
- break;
- }
- }
- case -3:
- case 3:
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
- a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -3)
- a = -a;
- break;
- }
- }
- case -4:
- case 4:
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
- a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -4)
- a = -a;
- break;
- }
- }
- default:
- #else
- {
- #endif
- a = PyLong_AsDouble(op1);
- if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
- }
- } else {
- return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
- }
- PyFPE_START_PROTECT("add", return NULL)
- result = a + b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
-}
-#endif
-
-/* BytesEquals */
- static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
- if (s1 == s2) {
- return (equals == Py_EQ);
- } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
- const char *ps1, *ps2;
- Py_ssize_t length = PyBytes_GET_SIZE(s1);
- if (length != PyBytes_GET_SIZE(s2))
- return (equals == Py_NE);
- ps1 = PyBytes_AS_STRING(s1);
- ps2 = PyBytes_AS_STRING(s2);
- if (ps1[0] != ps2[0]) {
- return (equals == Py_NE);
- } else if (length == 1) {
- return (equals == Py_EQ);
- } else {
- int result = memcmp(ps1, ps2, (size_t)length);
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
- return (equals == Py_NE);
- } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
- return (equals == Py_NE);
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-#endif
-}
-
-/* UnicodeEquals */
- static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
- PyObject* owned_ref = NULL;
-#endif
- int s1_is_unicode, s2_is_unicode;
- if (s1 == s2) {
- goto return_eq;
- }
- s1_is_unicode = PyUnicode_CheckExact(s1);
- s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
- if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
- owned_ref = PyUnicode_FromObject(s2);
- if (unlikely(!owned_ref))
- return -1;
- s2 = owned_ref;
- s2_is_unicode = 1;
- } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
- owned_ref = PyUnicode_FromObject(s1);
- if (unlikely(!owned_ref))
- return -1;
- s1 = owned_ref;
- s1_is_unicode = 1;
- } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
- return __Pyx_PyBytes_Equals(s1, s2, equals);
- }
-#endif
- if (s1_is_unicode & s2_is_unicode) {
- Py_ssize_t length;
- int kind;
- void *data1, *data2;
- if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
- return -1;
- length = __Pyx_PyUnicode_GET_LENGTH(s1);
- if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
- goto return_ne;
- }
- kind = __Pyx_PyUnicode_KIND(s1);
- if (kind != __Pyx_PyUnicode_KIND(s2)) {
- goto return_ne;
- }
- data1 = __Pyx_PyUnicode_DATA(s1);
- data2 = __Pyx_PyUnicode_DATA(s2);
- if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
- goto return_ne;
- } else if (length == 1) {
- goto return_eq;
- } else {
- int result = memcmp(data1, data2, (size_t)(length * kind));
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & s2_is_unicode) {
- goto return_ne;
- } else if ((s2 == Py_None) & s1_is_unicode) {
- goto return_ne;
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-return_eq:
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_EQ);
-return_ne:
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(owned_ref);
- #endif
- return (equals == Py_NE);
-#endif
-}
-
-/* PyErrFetchRestore */
- #if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-}
-#endif
-
-/* RaiseException */
- #if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
- CYTHON_UNUSED PyObject *cause) {
- __Pyx_PyThreadState_declare
- Py_XINCREF(type);
- if (!value || value == Py_None)
- value = NULL;
- else
- Py_INCREF(value);
- if (!tb || tb == Py_None)
- tb = NULL;
- else {
- Py_INCREF(tb);
- if (!PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- }
- if (PyType_Check(type)) {
-#if CYTHON_COMPILING_IN_PYPY
- if (!value) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#endif
- PyErr_NormalizeException(&type, &value, &tb);
- } else {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- value = type;
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- }
- __Pyx_PyThreadState_assign
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-#else
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
- PyObject* owned_instance = NULL;
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (PyExceptionClass_Check(type)) {
- PyObject *instance_class = NULL;
- if (value && PyExceptionInstance_Check(value)) {
- instance_class = (PyObject*) Py_TYPE(value);
- if (instance_class != type) {
- int is_subclass = PyObject_IsSubclass(instance_class, type);
- if (!is_subclass) {
- instance_class = NULL;
- } else if (unlikely(is_subclass == -1)) {
- goto bad;
- } else {
- type = instance_class;
- }
- }
- }
- if (!instance_class) {
- PyObject *args;
- if (!value)
- args = PyTuple_New(0);
- else if (PyTuple_Check(value)) {
- Py_INCREF(value);
- args = value;
- } else
- args = PyTuple_Pack(1, value);
- if (!args)
- goto bad;
- owned_instance = PyObject_Call(type, args, NULL);
- Py_DECREF(args);
- if (!owned_instance)
- goto bad;
- value = owned_instance;
- if (!PyExceptionInstance_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "calling %R should have returned an instance of "
- "BaseException, not %R",
- type, Py_TYPE(value));
- goto bad;
- }
- }
- } else {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-#if PY_VERSION_HEX >= 0x03030000
- if (cause) {
-#else
- if (cause && cause != Py_None) {
-#endif
- PyObject *fixed_cause;
- if (cause == Py_None) {
- fixed_cause = NULL;
- } else if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto bad;
- } else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- Py_INCREF(fixed_cause);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from "
- "BaseException");
- goto bad;
- }
- PyException_SetCause(value, fixed_cause);
- }
- PyErr_SetObject(type, value);
- if (tb) {
-#if CYTHON_COMPILING_IN_PYPY
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
- Py_INCREF(tb);
- PyErr_Restore(tmp_type, tmp_value, tb);
- Py_XDECREF(tmp_tb);
-#else
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
-#endif
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op2))) {
- const long a = intval;
- long x;
- long b = PyInt_AS_LONG(op2);
- x = (long)((unsigned long)a - b);
- if (likely((x^a) >= 0 || (x^~b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op2))) {
- const long a = intval;
- long b, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG lla = intval;
- PY_LONG_LONG llb, llx;
-#endif
- const digit* digits = ((PyLongObject*)op2)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op2);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- b = likely(size) ? digits[0] : 0;
- if (size == -1) b = -b;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- }
- x = a - b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla - llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- if (PyFloat_CheckExact(op2)) {
- const long a = intval;
- double b = PyFloat_AS_DOUBLE(op2);
- double result;
- PyFPE_START_PROTECT("subtract", return NULL)
- result = ((double)a) - (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
-}
-#endif
-
-/* PyFloatBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
- const double b = floatval;
- double a, result;
- if (likely(PyFloat_CheckExact(op1))) {
- a = PyFloat_AS_DOUBLE(op1);
- } else
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- a = (double) PyInt_AS_LONG(op1);
- } else
- #endif
- if (likely(PyLong_CheckExact(op1))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- switch (size) {
- case 0: a = 0.0; break;
- case -1: a = -(double) digits[0]; break;
- case 1: a = (double) digits[0]; break;
- case -2:
- case 2:
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
- a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -2)
- a = -a;
- break;
- }
- }
- case -3:
- case 3:
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
- a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -3)
- a = -a;
- break;
- }
- }
- case -4:
- case 4:
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
- a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
- if (size == -4)
- a = -a;
- break;
- }
- }
- default:
- #else
- {
- #endif
- a = PyLong_AsDouble(op1);
- if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
- }
- } else {
- return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
- }
- PyFPE_START_PROTECT("subtract", return NULL)
- result = a - b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
-}
-#endif
-
-/* PyFloatBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
- const double a = floatval;
- double b, result;
- if (likely(PyFloat_CheckExact(op2))) {
- b = PyFloat_AS_DOUBLE(op2);
- } else
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op2))) {
- b = (double) PyInt_AS_LONG(op2);
- } else
- #endif
- if (likely(PyLong_CheckExact(op2))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)op2)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op2);
- switch (size) {
- case 0: b = 0.0; break;
- case -1: b = -(double) digits[0]; break;
- case 1: b = (double) digits[0]; break;
- case -2:
- case 2:
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
- b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
- if (size == -2)
- b = -b;
- break;
- }
- }
- case -3:
- case 3:
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
- b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
- if (size == -3)
- b = -b;
- break;
- }
- }
- case -4:
- case 4:
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
- b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
- if (size == -4)
- b = -b;
- break;
- }
- }
- default:
- #else
- {
- #endif
- b = PyLong_AsDouble(op2);
- if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
- }
- } else {
- return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
- }
- PyFPE_START_PROTECT("add", return NULL)
- result = a + b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
-}
-#endif
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- if (op1 == op2) {
- Py_RETURN_TRUE;
- }
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long a = PyInt_AS_LONG(op1);
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a;
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
- }
- #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
- default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
- #else
- default: Py_RETURN_FALSE;
- #endif
- }
- }
- if (a == b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- if ((double)a == (double)b) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- return PyObject_RichCompare(op1, op2, Py_EQ);
-}
-#endif
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = a % b;
- x += ((x != 0) & ((x ^ b) < 0)) * b;
- return PyInt_FromLong(x);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
- }
- }
- x = a % b;
- x += ((x != 0) & ((x ^ b) < 0)) * b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla % llb;
- llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
-}
-#endif
-
-/* None */
- static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
- PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-/* PyIntBinop */
- #if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
- return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
- else {
- long q, r;
- q = a / b;
- r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- x = q;
- }
- return PyInt_FromLong(x);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
- }
- }
- {
- long q, r;
- q = a / b;
- r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- x = q;
- }
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- {
- PY_LONG_LONG q, r;
- q = lla / llb;
- r = lla - q*llb;
- q -= ((r != 0) & ((r ^ llb) < 0));
- llx = q;
- }
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
-}
-#endif
-
-/* RaiseTooManyValuesToUnpack */
- static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-/* RaiseNeedMoreValuesToUnpack */
- static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-/* IterFinish */
- static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_FAST_THREAD_STATE
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-/* UnpackItemEndCheck */
- static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- } else {
- return __Pyx_IterFinish();
- }
- return 0;
-}
-
-/* SliceObject */
- 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, CYTHON_UNUSED int wraparound) {
-#if CYTHON_USE_TYPE_SLOTS
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- goto bad;
- PyErr_Clear();
- }
- }
- return ms->sq_slice(obj, cstart, cstop);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_subscript))
-#endif
- {
- PyObject* result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_USE_TYPE_SLOTS
- result = mp->mp_subscript(obj, py_slice);
-#else
- result = PyObject_GetItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
- return NULL;
-}
-
-/* PyObjectCallMethod1 */
- static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
- PyObject *method, *result = NULL;
- method = __Pyx_PyObject_GetAttrStr(obj, method_name);
- if (unlikely(!method)) goto done;
-#if CYTHON_UNPACK_METHODS
- if (likely(PyMethod_Check(method))) {
- PyObject *self = PyMethod_GET_SELF(method);
- if (likely(self)) {
- PyObject *args;
- PyObject *function = PyMethod_GET_FUNCTION(method);
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(function)) {
- PyObject *args[2] = {self, arg};
- result = __Pyx_PyFunction_FastCall(function, args, 2);
- goto done;
- }
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(function)) {
- PyObject *args[2] = {self, arg};
- result = __Pyx_PyCFunction_FastCall(function, args, 2);
- goto done;
- }
- #endif
- args = PyTuple_New(2);
- if (unlikely(!args)) goto done;
- Py_INCREF(self);
- PyTuple_SET_ITEM(args, 0, self);
- Py_INCREF(arg);
- PyTuple_SET_ITEM(args, 1, arg);
- Py_INCREF(function);
- Py_DECREF(method); method = NULL;
- result = __Pyx_PyObject_Call(function, args, NULL);
- Py_DECREF(args);
- Py_DECREF(function);
- return result;
- }
- }
-#endif
- result = __Pyx_PyObject_CallOneArg(method, arg);
-done:
- Py_XDECREF(method);
- return result;
-}
-
-/* append */
- static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
- if (likely(PyList_CheckExact(L))) {
- if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
- } else {
- PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
- if (unlikely(!retval))
- return -1;
- Py_DECREF(retval);
- }
- return 0;
-}
-
-/* PyErrExceptionMatches */
- #if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
- PyObject *exc_type = tstate->curexc_type;
- if (exc_type == err) return 1;
- if (unlikely(!exc_type)) return 0;
- return PyErr_GivenExceptionMatches(exc_type, err);
-}
-#endif
-
-/* GetAttr */
- static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
-#if PY_MAJOR_VERSION >= 3
- if (likely(PyUnicode_Check(n)))
-#else
- if (likely(PyString_Check(n)))
-#endif
- return __Pyx_PyObject_GetAttrStr(o, n);
-#endif
- return PyObject_GetAttr(o, n);
-}
-
-/* GetAttr3 */
- static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
- PyObject *r = __Pyx_GetAttr(o, n);
- if (unlikely(!r)) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError))
- goto bad;
- PyErr_Clear();
- r = d;
- Py_INCREF(d);
- }
- return r;
-bad:
- return NULL;
-}
-
-/* Import */
- static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
- if (!py_import)
- goto bad;
- #endif
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(1);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- #endif
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0;
- }
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-/* pyobject_as_double */
- static double __Pyx__PyObject_AsDouble(PyObject* obj) {
- PyObject* float_value;
-#if !CYTHON_USE_TYPE_SLOTS
- float_value = PyNumber_Float(obj); if (0) goto bad;
-#else
- PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
- if (likely(nb) && likely(nb->nb_float)) {
- float_value = nb->nb_float(obj);
- if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
- PyErr_Format(PyExc_TypeError,
- "__float__ returned non-float (type %.200s)",
- Py_TYPE(float_value)->tp_name);
- Py_DECREF(float_value);
- goto bad;
- }
- } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
-#if PY_MAJOR_VERSION >= 3
- float_value = PyFloat_FromString(obj);
-#else
- float_value = PyFloat_FromString(obj, 0);
-#endif
- } else {
- PyObject* args = PyTuple_New(1);
- if (unlikely(!args)) goto bad;
- PyTuple_SET_ITEM(args, 0, obj);
- float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
- PyTuple_SET_ITEM(args, 0, 0);
- Py_DECREF(args);
- }
-#endif
- if (likely(float_value)) {
- double value = PyFloat_AS_DOUBLE(float_value);
- Py_DECREF(float_value);
- return value;
- }
-bad:
- return (double)-1;
-}
-
-/* KeywordStringCheck */
- static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
- PyObject *kwdict,
- const char* function_name,
- int kw_allowed)
-{
- PyObject* key = 0;
- Py_ssize_t pos = 0;
-#if CYTHON_COMPILING_IN_PYPY
- if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
- goto invalid_keyword;
- return 1;
-#else
- while (PyDict_Next(kwdict, &pos, &key, 0)) {
- #if PY_MAJOR_VERSION < 3
- if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
- #endif
- if (unlikely(!PyUnicode_Check(key)))
- goto invalid_keyword_type;
- }
- if ((!kw_allowed) && unlikely(key))
- goto invalid_keyword;
- return 1;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%.200s() keywords must be strings", function_name);
- return 0;
-#endif
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%.200s() got an unexpected keyword argument '%.200s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
- return 0;
-}
-
-/* UnpackUnboundCMethod */
- static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
- PyObject *method;
- method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
- if (unlikely(!method))
- return -1;
- target->method = method;
-#if CYTHON_COMPILING_IN_CPYTHON
- #if PY_MAJOR_VERSION >= 3
- if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
- #endif
- {
- PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
- target->func = descr->d_method->ml_meth;
- target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
- }
-#endif
- return 0;
-}
-
-/* CallUnboundCMethod0 */
- static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
- PyObject *args, *result = NULL;
- if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
-#if CYTHON_ASSUME_SAFE_MACROS
- args = PyTuple_New(1);
- if (unlikely(!args)) goto bad;
- Py_INCREF(self);
- PyTuple_SET_ITEM(args, 0, self);
-#else
- args = PyTuple_Pack(1, self);
- if (unlikely(!args)) goto bad;
-#endif
- result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
- Py_DECREF(args);
-bad:
- return result;
-}
-
-/* py_dict_items */
- static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
- if (PY_MAJOR_VERSION >= 3)
- return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
- else
- return PyDict_Items(d);
-}
-
-/* ExtTypeTest */
- static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (unlikely(!type)) {
- PyErr_SetString(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (likely(PyObject_TypeCheck(obj, type)))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
- Py_TYPE(obj)->tp_name, type->tp_name);
- return 0;
-}
-
-/* None */
- static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
- long r = a % b;
- r += ((r != 0) & ((r ^ b) < 0)) * b;
- return r;
-}
-
-/* None */
- static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
- long q = a / b;
- long r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- return q;
-}
-
-/* SetVTable */
- static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000
- PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
- PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
- if (!ob)
- goto bad;
- if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
- goto bad;
- Py_DECREF(ob);
- return 0;
-bad:
- Py_XDECREF(ob);
- return -1;
-}
-
-/* ImportFrom */
- static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
- PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
- if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Format(PyExc_ImportError,
- #if PY_MAJOR_VERSION < 3
- "cannot import name %.230s", PyString_AS_STRING(name));
- #else
- "cannot import name %S", name);
- #endif
- }
- return value;
-}
-
-/* FetchCommonType */
- static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
- PyObject* fake_module;
- PyTypeObject* cached_type = NULL;
- fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
- if (!fake_module) return NULL;
- Py_INCREF(fake_module);
- cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
- if (cached_type) {
- if (!PyType_Check((PyObject*)cached_type)) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s is not a type object",
- type->tp_name);
- goto bad;
- }
- if (cached_type->tp_basicsize != type->tp_basicsize) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s has the wrong size, try recompiling",
- type->tp_name);
- goto bad;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
- PyErr_Clear();
- if (PyType_Ready(type) < 0) goto bad;
- if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
- goto bad;
- Py_INCREF(type);
- cached_type = type;
- }
-done:
- Py_DECREF(fake_module);
- return cached_type;
-bad:
- Py_XDECREF(cached_type);
- cached_type = NULL;
- goto done;
-}
-
-/* CythonFunction */
- static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
- if (unlikely(op->func_doc == NULL)) {
- if (op->func.m_ml->ml_doc) {
-#if PY_MAJOR_VERSION >= 3
- op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
-#else
- op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
-#endif
- if (unlikely(op->func_doc == NULL))
- return NULL;
- } else {
- Py_INCREF(Py_None);
- return Py_None;
- }
- }
- Py_INCREF(op->func_doc);
- return op->func_doc;
-}
-static int
-__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp = op->func_doc;
- if (value == NULL) {
- value = Py_None;
- }
- Py_INCREF(value);
- op->func_doc = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
-{
- if (unlikely(op->func_name == NULL)) {
-#if PY_MAJOR_VERSION >= 3
- op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
-#else
- op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
-#endif
- if (unlikely(op->func_name == NULL))
- return NULL;
- }
- Py_INCREF(op->func_name);
- return op->func_name;
-}
-static int
-__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__name__ must be set to a string object");
- return -1;
- }
- tmp = op->func_name;
- Py_INCREF(value);
- op->func_name = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
-{
- Py_INCREF(op->func_qualname);
- return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
- if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
- PyErr_SetString(PyExc_TypeError,
- "__qualname__ must be set to a string object");
- return -1;
- }
- tmp = op->func_qualname;
- Py_INCREF(value);
- op->func_qualname = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
-{
- PyObject *self;
- self = m->func_closure;
- if (self == NULL)
- self = Py_None;
- Py_INCREF(self);
- return self;
-}
-static PyObject *
-__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
-{
- if (unlikely(op->func_dict == NULL)) {
- op->func_dict = PyDict_New();
- if (unlikely(op->func_dict == NULL))
- return NULL;
- }
- Py_INCREF(op->func_dict);
- return op->func_dict;
-}
-static int
-__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
-{
- PyObject *tmp;
- if (unlikely(value == NULL)) {
- PyErr_SetString(PyExc_TypeError,
- "function's dictionary may not be deleted");
- return -1;
- }
- if (unlikely(!PyDict_Check(value))) {
- PyErr_SetString(PyExc_TypeError,
- "setting function's dictionary to a non-dict");
- return -1;
- }
- tmp = op->func_dict;
- Py_INCREF(value);
- op->func_dict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
-{
- Py_INCREF(op->func_globals);
- return op->func_globals;
-}
-static PyObject *
-__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
-{
- Py_INCREF(Py_None);
- return Py_None;
-}
-static PyObject *
-__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
-{
- PyObject* result = (op->func_code) ? op->func_code : Py_None;
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
- int result = 0;
- PyObject *res = op->defaults_getter((PyObject *) op);
- if (unlikely(!res))
- return -1;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
- Py_INCREF(op->defaults_tuple);
- op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
- Py_INCREF(op->defaults_kwdict);
- #else
- op->defaults_tuple = PySequence_ITEM(res, 0);
- if (unlikely(!op->defaults_tuple)) result = -1;
- else {
- op->defaults_kwdict = PySequence_ITEM(res, 1);
- if (unlikely(!op->defaults_kwdict)) result = -1;
- }
- #endif
- Py_DECREF(res);
- return result;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyTuple_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__defaults__ must be set to a tuple object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_tuple;
- op->defaults_tuple = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
- PyObject* result = op->defaults_tuple;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_tuple;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__kwdefaults__ must be set to a dict object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_kwdict;
- op->defaults_kwdict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
- PyObject* result = op->defaults_kwdict;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_kwdict;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
- PyObject* tmp;
- if (!value || value == Py_None) {
- value = NULL;
- } else if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__annotations__ must be set to a dict object");
- return -1;
- }
- Py_XINCREF(value);
- tmp = op->func_annotations;
- op->func_annotations = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
- PyObject* result = op->func_annotations;
- if (unlikely(!result)) {
- result = PyDict_New();
- if (unlikely(!result)) return NULL;
- op->func_annotations = result;
- }
- Py_INCREF(result);
- return result;
-}
-static PyGetSetDef __pyx_CyFunction_getsets[] = {
- {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
- {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
- {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
- {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
- {0, 0, 0, 0, 0}
-};
-static PyMemberDef __pyx_CyFunction_members[] = {
- {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
- {0, 0, 0, 0, 0}
-};
-static PyObject *
-__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
-{
-#if PY_MAJOR_VERSION >= 3
- return PyUnicode_FromString(m->func.m_ml->ml_name);
-#else
- return PyString_FromString(m->func.m_ml->ml_name);
-#endif
-}
-static PyMethodDef __pyx_CyFunction_methods[] = {
- {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
- {0, 0, 0, 0}
-};
-#if PY_VERSION_HEX < 0x030500A0
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
-#else
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
-#endif
-static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
- PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
- __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
- if (op == NULL)
- return NULL;
- op->flags = flags;
- __Pyx_CyFunction_weakreflist(op) = NULL;
- op->func.m_ml = ml;
- op->func.m_self = (PyObject *) op;
- Py_XINCREF(closure);
- op->func_closure = closure;
- Py_XINCREF(module);
- op->func.m_module = module;
- op->func_dict = NULL;
- op->func_name = NULL;
- Py_INCREF(qualname);
- op->func_qualname = qualname;
- op->func_doc = NULL;
- op->func_classobj = NULL;
- op->func_globals = globals;
- Py_INCREF(op->func_globals);
- Py_XINCREF(code);
- op->func_code = code;
- op->defaults_pyobjects = 0;
- op->defaults = NULL;
- op->defaults_tuple = NULL;
- op->defaults_kwdict = NULL;
- op->defaults_getter = NULL;
- op->func_annotations = NULL;
- PyObject_GC_Track(op);
- return (PyObject *) op;
-}
-static int
-__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
-{
- Py_CLEAR(m->func_closure);
- Py_CLEAR(m->func.m_module);
- Py_CLEAR(m->func_dict);
- Py_CLEAR(m->func_name);
- Py_CLEAR(m->func_qualname);
- Py_CLEAR(m->func_doc);
- Py_CLEAR(m->func_globals);
- Py_CLEAR(m->func_code);
- Py_CLEAR(m->func_classobj);
- Py_CLEAR(m->defaults_tuple);
- Py_CLEAR(m->defaults_kwdict);
- Py_CLEAR(m->func_annotations);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_XDECREF(pydefaults[i]);
- PyObject_Free(m->defaults);
- m->defaults = NULL;
- }
- return 0;
-}
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
-{
- PyObject_GC_UnTrack(m);
- if (__Pyx_CyFunction_weakreflist(m) != NULL)
- PyObject_ClearWeakRefs((PyObject *) m);
- __Pyx_CyFunction_clear(m);
- PyObject_GC_Del(m);
-}
-static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
-{
- Py_VISIT(m->func_closure);
- Py_VISIT(m->func.m_module);
- Py_VISIT(m->func_dict);
- Py_VISIT(m->func_name);
- Py_VISIT(m->func_qualname);
- Py_VISIT(m->func_doc);
- Py_VISIT(m->func_globals);
- Py_VISIT(m->func_code);
- Py_VISIT(m->func_classobj);
- Py_VISIT(m->defaults_tuple);
- Py_VISIT(m->defaults_kwdict);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_VISIT(pydefaults[i]);
- }
- return 0;
-}
-static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
-{
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
- Py_INCREF(func);
- return func;
- }
- if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
- if (type == NULL)
- type = (PyObject *)(Py_TYPE(obj));
- return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
- }
- if (obj == Py_None)
- obj = NULL;
- return __Pyx_PyMethod_New(func, obj, type);
-}
-static PyObject*
-__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
-{
-#if PY_MAJOR_VERSION >= 3
- return PyUnicode_FromFormat("<cyfunction %U at %p>",
- op->func_qualname, (void *)op);
-#else
- return PyString_FromFormat("<cyfunction %s at %p>",
- PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
- PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = f->m_ml->ml_meth;
- Py_ssize_t size;
- switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
- case METH_VARARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0))
- return (*meth)(self, arg);
- break;
- case METH_VARARGS | METH_KEYWORDS:
- return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
- case METH_NOARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 0))
- return (*meth)(self, NULL);
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- case METH_O:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 1)) {
- PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
- if (unlikely(!arg0)) return NULL;
- result = (*meth)(self, arg0);
- Py_DECREF(arg0);
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- default:
- PyErr_SetString(PyExc_SystemError, "Bad call flags in "
- "__Pyx_CyFunction_Call. METH_OLDARGS is no "
- "longer supported!");
- return NULL;
- }
- PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- f->m_ml->ml_name);
- return NULL;
-}
-static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
-}
-static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
- PyObject *result;
- __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
- if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
- Py_ssize_t argc;
- PyObject *new_args;
- PyObject *self;
- argc = PyTuple_GET_SIZE(args);
- new_args = PyTuple_GetSlice(args, 1, argc);
- if (unlikely(!new_args))
- return NULL;
- self = PyTuple_GetItem(args, 0);
- if (unlikely(!self)) {
- Py_DECREF(new_args);
- return NULL;
- }
- result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
- Py_DECREF(new_args);
- } else {
- result = __Pyx_CyFunction_Call(func, args, kw);
- }
- return result;
-}
-static PyTypeObject __pyx_CyFunctionType_type = {
- PyVarObject_HEAD_INIT(0, 0)
- "cython_function_or_method",
- sizeof(__pyx_CyFunctionObject),
- 0,
- (destructor) __Pyx_CyFunction_dealloc,
- 0,
- 0,
- 0,
-#if PY_MAJOR_VERSION < 3
- 0,
-#else
- 0,
-#endif
- (reprfunc) __Pyx_CyFunction_repr,
- 0,
- 0,
- 0,
- 0,
- __Pyx_CyFunction_CallAsMethod,
- 0,
- 0,
- 0,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
- 0,
- (traverseproc) __Pyx_CyFunction_traverse,
- (inquiry) __Pyx_CyFunction_clear,
- 0,
-#if PY_VERSION_HEX < 0x030500A0
- offsetof(__pyx_CyFunctionObject, func_weakreflist),
-#else
- offsetof(PyCFunctionObject, m_weakreflist),
-#endif
- 0,
- 0,
- __pyx_CyFunction_methods,
- __pyx_CyFunction_members,
- __pyx_CyFunction_getsets,
- 0,
- 0,
- __Pyx_CyFunction_descr_get,
- 0,
- offsetof(__pyx_CyFunctionObject, func_dict),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-#if PY_VERSION_HEX >= 0x030400a1
- 0,
-#endif
-};
-static int __pyx_CyFunction_init(void) {
- __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
- if (__pyx_CyFunctionType == NULL) {
- return -1;
- }
- return 0;
-}
-static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults = PyObject_Malloc(size);
- if (!m->defaults)
- return PyErr_NoMemory();
- memset(m->defaults, 0, size);
- m->defaults_pyobjects = pyobjects;
- return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_tuple = tuple;
- Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_kwdict = dict;
- Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->func_annotations = dict;
- Py_INCREF(dict);
-}
-
-/* CalculateMetaclass */
- static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
- Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
- for (i=0; i < nbases; i++) {
- PyTypeObject *tmptype;
- PyObject *tmp = PyTuple_GET_ITEM(bases, i);
- tmptype = Py_TYPE(tmp);
-#if PY_MAJOR_VERSION < 3
- if (tmptype == &PyClass_Type)
- continue;
-#endif
- if (!metaclass) {
- metaclass = tmptype;
- continue;
- }
- if (PyType_IsSubtype(metaclass, tmptype))
- continue;
- if (PyType_IsSubtype(tmptype, metaclass)) {
- metaclass = tmptype;
- continue;
- }
- PyErr_SetString(PyExc_TypeError,
- "metaclass conflict: "
- "the metaclass of a derived class "
- "must be a (non-strict) subclass "
- "of the metaclasses of all its bases");
- return NULL;
- }
- if (!metaclass) {
-#if PY_MAJOR_VERSION < 3
- metaclass = &PyClass_Type;
-#else
- metaclass = &PyType_Type;
-#endif
- }
- Py_INCREF((PyObject*) metaclass);
- return (PyObject*) metaclass;
-}
-
-/* Py3ClassCreate */
- static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
- PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
- PyObject *ns;
- if (metaclass) {
- PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
- if (prep) {
- PyObject *pargs = PyTuple_Pack(2, name, bases);
- if (unlikely(!pargs)) {
- Py_DECREF(prep);
- return NULL;
- }
- ns = PyObject_Call(prep, pargs, mkw);
- Py_DECREF(prep);
- Py_DECREF(pargs);
- } else {
- if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
- return NULL;
- PyErr_Clear();
- ns = PyDict_New();
- }
- } else {
- ns = PyDict_New();
- }
- if (unlikely(!ns))
- return NULL;
- if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
- if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
- if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
- return ns;
-bad:
- Py_DECREF(ns);
- return NULL;
-}
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
- PyObject *dict, PyObject *mkw,
- int calculate_metaclass, int allow_py2_metaclass) {
- PyObject *result, *margs;
- PyObject *owned_metaclass = NULL;
- if (allow_py2_metaclass) {
- owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
- if (owned_metaclass) {
- metaclass = owned_metaclass;
- } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
- PyErr_Clear();
- } else {
- return NULL;
- }
- }
- if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
- metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
- Py_XDECREF(owned_metaclass);
- if (unlikely(!metaclass))
- return NULL;
- owned_metaclass = metaclass;
- }
- margs = PyTuple_Pack(3, name, bases, dict);
- if (unlikely(!margs)) {
- result = NULL;
- } else {
- result = PyObject_Call(metaclass, margs, mkw);
- Py_DECREF(margs);
- }
- Py_XDECREF(owned_metaclass);
- return result;
-}
-
-/* CodeObjectCache */
- static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = start + (end - start) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-/* AddTraceback */
- #include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(filename);
- #else
- py_srcfile = PyUnicode_FromString(filename);
- #endif
- if (!py_srcfile) goto bad;
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_code = __Pyx_PyCode_New(
- 0,
- 0,
- 0,
- 0,
- 0,
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line,
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- Py_DECREF(py_funcname);
- return py_code;
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyFrameObject *py_frame = 0;
- py_code = __pyx_find_code_object(c_line ? c_line : py_line);
- if (!py_code) {
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) goto bad;
- __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
- }
- py_frame = PyFrame_New(
- PyThreadState_GET(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- __pyx_d, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-/* CIntFromPyVerify */
- #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
-#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
-#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
- {\
- func_type value = func_value;\
- if (sizeof(target_type) < sizeof(func_type)) {\
- if (unlikely(value != (func_type) (target_type) value)) {\
- func_type zero = 0;\
- if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
- return (target_type) -1;\
- if (is_unsigned && unlikely(value < zero))\
- goto raise_neg_overflow;\
- else\
- goto raise_overflow;\
- }\
- }\
- return (target_type) value;\
- }
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = (long) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(long),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = (int) 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(int) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(int) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(int),
- little, !is_unsigned);
- }
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = (int) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(int) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (int) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
- return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
- return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
- return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (int) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
-#endif
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
- case -2:
- if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(int) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
-#endif
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- int val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (int) -1;
- }
- } else {
- int val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (int) -1;
- val = __Pyx_PyInt_As_int(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to int");
- return (int) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to int");
- return (int) -1;
-}
-
-/* CIntFromPy */
- static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = (long) 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(long) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (long) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
- return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
- return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
- return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (long) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
-#endif
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
- case -2:
- if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(long) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
-#endif
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- long val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (long) -1;
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (long) -1;
- val = __Pyx_PyInt_As_long(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to long");
- return (long) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long) -1;
-}
-
-/* CheckBinaryVersion */
- static int __Pyx_check_binary_version(void) {
- char ctversion[4], rtversion[4];
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
- char message[200];
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- return PyErr_WarnEx(NULL, message, 1);
- }
- return 0;
-}
-
-/* ModuleImport */
- #ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
- PyObject *py_name = 0;
- PyObject *py_module = 0;
- py_name = __Pyx_PyIdentifier_FromString(name);
- if (!py_name)
- goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
-bad:
- Py_XDECREF(py_name);
- return 0;
-}
-#endif
-
-/* TypeImport */
- #ifndef __PYX_HAVE_RT_ImportType
-#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
- size_t size, int strict)
-{
- PyObject *py_module = 0;
- PyObject *result = 0;
- PyObject *py_name = 0;
- char warning[200];
- Py_ssize_t basicsize;
-#ifdef Py_LIMITED_API
- PyObject *py_basicsize;
-#endif
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- py_name = __Pyx_PyIdentifier_FromString(class_name);
- if (!py_name)
- goto bad;
- result = PyObject_GetAttr(py_module, py_name);
- Py_DECREF(py_name);
- py_name = 0;
- Py_DECREF(py_module);
- py_module = 0;
- if (!result)
- goto bad;
- if (!PyType_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "%.200s.%.200s is not a type object",
- module_name, class_name);
- goto bad;
- }
-#ifndef Py_LIMITED_API
- basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
- py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
- if (!py_basicsize)
- goto bad;
- basicsize = PyLong_AsSsize_t(py_basicsize);
- Py_DECREF(py_basicsize);
- py_basicsize = 0;
- if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
- goto bad;
-#endif
- if (!strict && (size_t)basicsize > size) {
- PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
- module_name, class_name, basicsize, size);
- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
- }
- else if ((size_t)basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
- module_name, class_name, basicsize, size);
- goto bad;
- }
- return (PyTypeObject *)result;
-bad:
- Py_XDECREF(py_module);
- Py_XDECREF(result);
- return NULL;
-}
-#endif
-
-/* InitStrings */
- static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-#else
- if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_LENGTH(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif
-#endif
- } else
-#endif
-#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
- if (PyByteArray_Check(o)) {
- *length = PyByteArray_GET_SIZE(o);
- return PyByteArray_AS_STRING(o);
- } else
-#endif
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (unlikely(r < 0)) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
-#if CYTHON_USE_TYPE_SLOTS
- PyNumberMethods *m;
-#endif
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return __Pyx_NewRef(x);
-#if CYTHON_USE_TYPE_SLOTS
- m = Py_TYPE(x)->tp_as_number;
- #if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
- #else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
- #endif
-#else
- res = PyNumber_Int(x);
-#endif
- if (res) {
-#if PY_MAJOR_VERSION < 3
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%.4s__ returned non-%.4s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject *x;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(b))) {
- if (sizeof(Py_ssize_t) >= sizeof(long))
- return PyInt_AS_LONG(b);
- else
- return PyInt_AsSsize_t(x);
- }
-#endif
- if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)b)->ob_digit;
- const Py_ssize_t size = Py_SIZE(b);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- ival = likely(size) ? digits[0] : 0;
- if (size == -1) ival = -ival;
- return ival;
- } else {
- switch (size) {
- case 2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- }
- }
- #endif
- return PyLong_AsSsize_t(b);
- }
- x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
- return PyInt_FromSize_t(ival);
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/setup.py b/setup.py
index c72e880..22d88ce 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import os.path as osp
try:
from setuptools import setup, Extension
setuptools_extra_kwargs = {
- "install_requires": ["numpy>=1.7"],
+ "install_requires": ["numpy>=1.7","cython>=0.19"],
"entry_points": {
'console_scripts': [
'ncinfo = netCDF4.utils:ncinfo',
@@ -23,14 +23,9 @@ from distutils.dist import Distribution
try:
from Cython.Build import cythonize
from Cython import __version__ as cython_version
- if cython_version >= '0.19':
- has_cython = True
- sys.stdout.write('cython version %s found ...\n' % cython_version)
- else:
- sys.stdout.write('cython not found or too old...\n')
- has_cython = False
+ if cython_version < '0.19': raise ImportError
except ImportError:
- has_cython = False
+ raise ImportError('cython >= 0.19 required')
if sys.version_info[0] < 3:
import ConfigParser as configparser
@@ -72,11 +67,16 @@ def check_api(inc_dirs):
has_nc_inq_path = False
has_nc_inq_format_extended = False
has_cdf5_format = False
+ has_nc_open_mem = False
+
for d in inc_dirs:
try:
- f = open(os.path.join(d,'netcdf.h'),**open_kwargs)
+ f = open(os.path.join(d, 'netcdf.h'), **open_kwargs)
except IOError:
continue
+
+ has_nc_open_mem = os.path.exists(os.path.join(d, 'netcdf_mem.h'))
+
for line in f:
if line.startswith('nc_rename_grp'):
has_rename_grp = True
@@ -87,8 +87,9 @@ def check_api(inc_dirs):
if line.startswith('#define NC_FORMAT_64BIT_DATA'):
has_cdf5_format = True
break
+
return has_rename_grp, has_nc_inq_path, has_nc_inq_format_extended,\
- has_cdf5_format
+ has_cdf5_format, has_nc_open_mem
def getnetcdfvers(libdirs):
"""
@@ -215,10 +216,6 @@ if USE_SETUPCFG and os.path.exists(setup_cfg):
try: use_cython = config.getboolean("options", "use_cython")
except: pass
-# turn off cython compilation if desired
-if has_cython and not use_cython:
- has_cython = False
-
# make sure USE_NCCONFIG from environment takes
# precendence over use_ncconfig from setup.cfg (issue #341).
if USE_NCCONFIG is None and use_ncconfig is not None:
@@ -235,7 +232,7 @@ if USE_NCCONFIG:
else: # otherwise, just hope it's in the users PATH.
ncconfig = 'nc-config'
try:
- retcode = subprocess.call([ncconfig,'--libs'],stdout=subprocess.PIPE)
+ retcode = subprocess.call([ncconfig,'--libs'], stdout=subprocess.PIPE)
except:
retcode = 1
else:
@@ -267,7 +264,7 @@ elif HAS_PKG_CONFIG: # Try pkg-config.
inc_dirs.extend([str(i[2:].decode()) for i in dep.split() if i[0:2].decode() == '-I'])
# If nc-config and pkg-config both didn't work (it won't on Windows), fall back on brute force method.
else:
- dirstosearch = [os.path.expanduser('~'),'/usr/local','/sw','/opt','/opt/local', '/usr']
+ dirstosearch = [os.path.expanduser('~'), '/usr/local', '/sw', '/opt', '/opt/local', '/usr']
if HDF5_incdir is None and HDF5_dir is None:
sys.stdout.write("""
@@ -322,12 +319,13 @@ NETCDF4_DIR environment variable not set, checking standard locations.. \n""")
netCDF4_libdir = os.path.join(netCDF4_dir, 'lib')
if sys.platform=='win32':
- libs = ['netcdf','hdf5_hl','hdf5','zlib']
+ libs = ['netcdf', 'hdf5_hl', 'hdf5', 'zlib']
else:
- libs = ['netcdf','hdf5_hl','hdf5','z']
- if netCDF4_libdir is not None: lib_dirs=[netCDF4_libdir]
+ libs = ['netcdf', 'hdf5_hl', 'hdf5', 'z']
+
+ if netCDF4_libdir is not None: lib_dirs = [netCDF4_libdir]
if HDF5_libdir is not None: lib_dirs.append(HDF5_libdir)
- if netCDF4_incdir is not None: inc_dirs=[netCDF4_incdir]
+ if netCDF4_incdir is not None: inc_dirs = [netCDF4_incdir]
if HDF5_incdir is not None: inc_dirs.append(HDF5_incdir)
# add szip to link if desired.
@@ -393,7 +391,7 @@ else:
cmdclass = {}
netcdf4_src_root = osp.join('netCDF4', '_netCDF4')
netcdf4_src_c = netcdf4_src_root + '.c'
-if has_cython and 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
+if 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
sys.stdout.write('using Cython to compile netCDF4.pyx...\n')
extensions = [Extension("netCDF4._netCDF4",
[netcdf4_src_root + '.pyx'],
@@ -409,47 +407,51 @@ if has_cython and 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
os.remove(netcdf4_src_c)
# this determines whether renameGroup and filepath methods will work.
has_rename_grp, has_nc_inq_path, has_nc_inq_format_extended, \
- has_cdf5_format = check_api(inc_dirs)
- f = open(osp.join('include', 'constants.pyx'),'w')
+ has_cdf5_format, has_nc_open_mem = check_api(inc_dirs)
+ f = open(osp.join('include', 'constants.pyx'), 'w')
if has_rename_grp:
sys.stdout.write('netcdf lib has group rename capability\n')
f.write('DEF HAS_RENAME_GRP = 1\n')
else:
sys.stdout.write('netcdf lib does not have group rename capability\n')
f.write('DEF HAS_RENAME_GRP = 0\n')
+
if has_nc_inq_path:
sys.stdout.write('netcdf lib has nc_inq_path function\n')
f.write('DEF HAS_NC_INQ_PATH = 1\n')
else:
sys.stdout.write('netcdf lib does not have nc_inq_path function\n')
f.write('DEF HAS_NC_INQ_PATH = 0\n')
+
if has_nc_inq_format_extended:
sys.stdout.write('netcdf lib has nc_inq_format_extended function\n')
f.write('DEF HAS_NC_INQ_FORMAT_EXTENDED = 1\n')
else:
sys.stdout.write('netcdf lib does not have nc_inq_format_extended function\n')
f.write('DEF HAS_NC_INQ_FORMAT_EXTENDED = 0\n')
+
+ if has_nc_open_mem:
+ sys.stdout.write('netcdf lib has nc_open_mem function\n')
+ f.write('DEF HAS_NC_OPEN_MEM = 1\n')
+ else:
+ sys.stdout.write('netcdf lib does not have nc_open_mem function\n')
+ f.write('DEF HAS_NC_OPEN_MEM = 0\n')
+
if has_cdf5_format:
sys.stdout.write('netcdf lib has cdf-5 format capability\n')
f.write('DEF HAS_CDF5_FORMAT = 1\n')
else:
sys.stdout.write('netcdf lib does not have cdf-5 format capability\n')
f.write('DEF HAS_CDF5_FORMAT = 0\n')
+
f.close()
ext_modules = cythonize(extensions, include_path=['include'])
else:
- extensions = [Extension("netCDF4._netCDF4",
- [netcdf4_src_c],
- libraries=libs,
- library_dirs=lib_dirs,
- include_dirs=inc_dirs,
- runtime_library_dirs=runtime_lib_dirs),
- Extension('netcdftime._netcdftime', ['netcdftime/_netcdftime.c'])]
- ext_modules = extensions
+ ext_modules = None
setup(name = "netCDF4",
cmdclass = cmdclass,
- version = "1.2.7",
+ version = "1.2.8",
long_description = "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 most of the new features, and can read and write netCDF files compatible with older versions of the library. The API is modelled after Scientific.IO.NetCDF, and should be familiar to users of that module.\n\nThis project has a `Sub [...]
author = "Jeff Whitaker",
author_email = "jeffrey.s.whitaker at noaa.gov",
diff --git a/test/tst_Unsigned.py b/test/tst_Unsigned.py
new file mode 100644
index 0000000..ecd9e4d
--- /dev/null
+++ b/test/tst_Unsigned.py
@@ -0,0 +1,27 @@
+import unittest
+import netCDF4
+from numpy.testing import assert_array_equal
+import numpy as np
+
+class Test_Unsigned(unittest.TestCase):
+ """
+ Test autoconversion to unsigned ints when _Unsigned attribute is True.
+ This attribute is is set by netcdf-java to designate unsigned
+ integer data stored with a signed integer type in netcdf-3.
+ If _Unsigned=True, a view to the data as unsigned integers is returned.
+ set_autoscale can be used to turn this off (default is on)
+ See issue #656 (pull reqeust #658).
+ """
+ def test_unsigned(self):
+ f = netCDF4.Dataset("ubyte.nc")
+ data = f['ub'][:]
+ assert data.dtype.str[1:] == 'u1'
+ assert_array_equal(data,np.array([0,255],np.uint8))
+ f.set_auto_scale(False)
+ data2 = f['ub'][:]
+ assert data2.dtype.str[1:] == 'i1'
+ assert_array_equal(data2,np.array([0,-1],np.int8))
+ f.close()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/tst_compoundatt.py b/test/tst_compoundatt.py
index 4ce2516..47eb8af 100644
--- a/test/tst_compoundatt.py
+++ b/test/tst_compoundatt.py
@@ -2,8 +2,7 @@ import sys
import unittest
import os
import tempfile
-from netCDF4 import Dataset, CompoundType, chartostring, stringtoarr, \
-default_encoding
+from netCDF4 import Dataset, CompoundType, chartostring, stringtoarr
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
@@ -66,10 +65,10 @@ class VariablesTestCase(unittest.TestCase):
assert_array_equal(vv.units['speed'], windunits['speed'].squeeze())
assert_array_equal(vv.units['direction'],\
windunits['direction'].squeeze())
- assert(chartostring(v.units['speed']).item().rstrip().decode(default_encoding) == 'm/s')
- assert(chartostring(v.units['direction']).item().rstrip().decode(default_encoding) == 'degrees')
- assert(chartostring(vv.units['speed']).item().rstrip().decode(default_encoding) == 'm/s')
- assert(chartostring(vv.units['direction']).item().rstrip().decode(default_encoding) == 'degrees')
+ assert(chartostring(v.units['speed']).item().rstrip() == 'm/s')
+ assert(chartostring(v.units['direction']).item().rstrip() == 'degrees')
+ assert(chartostring(vv.units['speed']).item().rstrip() == 'm/s')
+ assert(chartostring(vv.units['direction']).item().rstrip() == 'degrees')
f.close()
if __name__ == '__main__':
diff --git a/test/tst_multifile.py b/test/tst_multifile.py
index 9fccbf5..5b8d774 100644
--- a/test/tst_multifile.py
+++ b/test/tst_multifile.py
@@ -5,7 +5,7 @@ from numpy.testing import assert_array_equal, assert_equal
from numpy import ma
import tempfile, unittest, os, datetime
-nx=100; ydim=5; zdim=1
+nx=100; ydim=5; zdim=10
nfiles = 10
ninc = nx/nfiles
files = [tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name for nfile in range(nfiles)]
diff --git a/test/tst_multifile2.py b/test/tst_multifile2.py
index d919d7a..c16ed9a 100644
--- a/test/tst_multifile2.py
+++ b/test/tst_multifile2.py
@@ -5,7 +5,7 @@ from numpy.testing import assert_array_equal, assert_equal
from numpy import ma
import tempfile, unittest, os, datetime
-nx=100; ydim=5; zdim=1
+nx=100; ydim=5; zdim=10
nfiles = 10
ninc = nx/nfiles
files = [tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name for nfile in range(nfiles)]
diff --git a/test/tst_netcdftime.py b/test/tst_netcdftime.py
index 9e5a478..c925c94 100644
--- a/test/tst_netcdftime.py
+++ b/test/tst_netcdftime.py
@@ -476,6 +476,13 @@ class netcdftimeTestCase(unittest.TestCase):
assert (d.month == 1)
assert (d.day == 1)
assert (d.hour == 0)
+ # test fix for issue #659 (proper treatment of negative time values).
+ units = 'days since 1800-01-01 00:00:0.0'
+ d = num2date(-657073, units, calendar='standard')
+ assert (d.year == 1)
+ assert (d.month == 1)
+ assert (d.day == 1)
+ assert (d.hour == 0)
class TestDate2index(unittest.TestCase):
diff --git a/test/tst_open_mem.py b/test/tst_open_mem.py
new file mode 100644
index 0000000..fdad570
--- /dev/null
+++ b/test/tst_open_mem.py
@@ -0,0 +1,32 @@
+import os
+import unittest
+import netCDF4
+
+CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
+
+
+class TestOpenMem(unittest.TestCase):
+ def test_mem_open(self):
+ fpath = os.path.join(CURRENT_DIR, "netcdf_dummy_file.nc")
+
+ with open(fpath, 'rb') as f:
+ nc_bytes = f.read()
+
+ if not netCDF4.__has_nc_open_mem__:
+ with self.assertRaises(ValueError):
+ netCDF4.Dataset('foo_bar', memory=nc_bytes)
+ return
+
+ # Needs: https://github.com/Unidata/netcdf-c/pull/400
+ if netCDF4.__netcdf4libversion__ < '4.4.1.2':
+ with self.assertRaises(IOError):
+ netCDF4.Dataset('foo_bar', memory=nc_bytes)
+ return
+
+ with netCDF4.Dataset('foo_bar', memory=nc_bytes) as nc:
+ print(nc.filepath())
+ assert nc.filepath() == 'foo_bar'
+ assert nc.project_summary == 'Dummy netCDF file'
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/tst_stringarr.py b/test/tst_stringarr.py
index 3c63dfb..6cbe0a6 100644
--- a/test/tst_stringarr.py
+++ b/test/tst_stringarr.py
@@ -1,20 +1,24 @@
from netCDF4 import Dataset, stringtochar, chartostring
-import random, numpy
+import random, numpy, string
import unittest
import os
from numpy.testing import assert_array_equal, assert_array_almost_equal
-# test utilities for converting arrays of fixed-length strings
+def generateString(length, alphabet=string.ascii_letters + string.digits + string.punctuation):
+ return(''.join([random.choice(alphabet) for i in range(length)]))
+
+# test conversion of arrays of fixed-length strings
# to arrays of characters (with an extra dimension), and vice-versa.
FILE_NAME = 'tst_stringarr.nc'
FILE_FORMAT = 'NETCDF4_CLASSIC'
-chars = '1234567890aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
-n2 = 10; nchar = 12; nrecs = 4
+n2 = 20; nchar = 12; nrecs = 4
data = numpy.empty((nrecs,n2),'S'+repr(nchar))
for nrec in range(nrecs):
for n in range(n2):
- data[nrec,n] = ''.join([random.choice(chars) for i in range(nchar)])
+ data[nrec,n] = generateString(nchar)
+datau = data.astype('U')
+datac = stringtochar(data, encoding='ascii')
class StringArrayTestCase(unittest.TestCase):
@@ -25,9 +29,21 @@ class StringArrayTestCase(unittest.TestCase):
nc.createDimension('n2',n2)
nc.createDimension('nchar',nchar)
v = nc.createVariable('strings','S1',('n1','n2','nchar'))
+ v2 = nc.createVariable('strings2','S1',('n1','n2','nchar'))
+ # if _Encoding set, string array should automatically be converted
+ # to a char array and vice-versan
+ v2._Encoding = 'ascii'
+ v3 = nc.createVariable('strings3','S1',('n1','n2','nchar'))
+ v3._Encoding = 'ascii'
for nrec in range(nrecs):
- datac = stringtochar(data)
+ datac = stringtochar(data,encoding='ascii')
v[nrec] = datac[nrec]
+ v2[:-1] = data[:-1]
+ v2[-1] = data[-1]
+ v2[-1,-1] = data[-1,-1] # write single element
+ v2[-1,-1] = data[-1,-1].tostring() # write single python string
+ # _Encoding should be ignored if an array of characters is specified
+ v3[:] = stringtochar(data, encoding='ascii')
nc.close()
def tearDown(self):
@@ -39,11 +55,35 @@ class StringArrayTestCase(unittest.TestCase):
nc = Dataset(FILE_NAME)
assert nc.dimensions['n1'].isunlimited() == True
v = nc.variables['strings']
+ v2 = nc.variables['strings2']
+ v3 = nc.variables['strings3']
assert v.dtype.str[1:] in ['S1','U1']
assert v.shape == (nrecs,n2,nchar)
for nrec in range(nrecs):
- data2 = chartostring(v[nrec])
- assert_array_equal(data2,data[nrec])
+ data2 = chartostring(v[nrec],encoding='ascii')
+ assert_array_equal(data2,datau[nrec])
+ data2 = v2[:]
+ data2[0] = v2[0]
+ data2[0,1] = v2[0,1]
+ assert_array_equal(data2,datau)
+ data3 = v3[:]
+ assert_array_equal(data3,datau)
+ # these slices should return a char array, not a string array
+ data4 = v2[:,:,0]
+ assert(data4.dtype.itemsize == 1)
+ assert_array_equal(data4, datac[:,:,0])
+ data5 = v2[0,0:nchar,0]
+ assert(data5.dtype.itemsize == 1)
+ assert_array_equal(data5, datac[0,0:nchar,0])
+ # test turning auto-conversion off.
+ v2.set_auto_chartostring(False)
+ data6 = v2[:]
+ assert(data6.dtype.itemsize == 1)
+ assert_array_equal(data6, datac)
+ nc.set_auto_chartostring(False)
+ data7 = v3[:]
+ assert(data7.dtype.itemsize == 1)
+ assert_array_equal(data7, datac)
nc.close()
if __name__ == '__main__':
diff --git a/test/tst_unicode.py b/test/tst_unicode.py
index 3f902cd..57a6f87 100644
--- a/test/tst_unicode.py
+++ b/test/tst_unicode.py
@@ -2,8 +2,6 @@ import netCDF4
import numpy as np
import sys, unittest, os, tempfile
-netCDF4.default_encoding = 'utf-8'
-
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
ATT1 = u'\u03a0\u03a3\u03a9'
ATT2 = u'x\xb0'
diff --git a/test/tst_unicode3.py b/test/tst_unicode3.py
index 4661c19..44c7c91 100644
--- a/test/tst_unicode3.py
+++ b/test/tst_unicode3.py
@@ -2,8 +2,6 @@ import netCDF4
import numpy as np
import sys, unittest, os, tempfile
-netCDF4.default_encoding = 'utf-8'
-
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
ATT1 = '\u03a0\u03a3\u03a9'
ATT2 = 'x\xb0'
diff --git a/test/tst_unicodeatt.py b/test/tst_unicodeatt.py
new file mode 100644
index 0000000..6134595
--- /dev/null
+++ b/test/tst_unicodeatt.py
@@ -0,0 +1,35 @@
+from netCDF4 import Dataset
+import sys, unittest, os, tempfile
+
+FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
+
+class UnicodeAttTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.file = FILE_NAME
+ nc = Dataset(self.file,'w')
+ # write as a utf-8 string
+ nc.stratt = b'\xe6\xb7\xb1\xe5\x85\xa5 Python'.decode('utf-8')
+ # write as raw bytes (decoded string is same as above with 'big5' encoding)
+ nc.stratt2 = b'\xb2`\xa4J Python'
+ # same as above, but attribute forced to be of type NC_STRING
+ nc.setncattr_string('stratt3',b'\xb2`\xa4J Python')
+ nc.close()
+
+ def tearDown(self):
+ # Remove the temporary files
+ os.remove(self.file)
+
+ def runTest(self):
+ """testing unicode attributes"""
+ nc = Dataset(self.file, 'r')
+ assert(nc.stratt.encode('utf-8') == b'\xe6\xb7\xb1\xe5\x85\xa5 Python')
+ stratt2 = nc.getncattr('stratt2',encoding='big5') # decodes using big5
+ stratt3 = nc.getncattr('stratt3',encoding='big5') # same as above
+ assert(stratt2.encode('big5') == b'\xb2`\xa4J Python')
+ assert(nc.stratt == stratt2) # decoded strings are the same
+ assert(nc.stratt == stratt3) # decoded strings are the same
+ nc.close()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/ubyte.nc b/test/ubyte.nc
new file mode 100644
index 0000000..920e09c
Binary files /dev/null and b/test/ubyte.nc differ
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/netcdf4-python.git
More information about the Pkg-grass-devel
mailing list