[python-astropy] 01/05: New upstream version 0.4.3

Ole Streicher olebole at moszumanska.debian.org
Mon Jan 19 20:46:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository python-astropy.

commit 7c7cea2e9d4f6266f37d4de72d3c1039fcc65b06
Author: Ole Streicher <olebole at debian.org>
Date:   Fri Jan 16 09:08:12 2015 +0100

    New upstream version 0.4.3
---
 CHANGES.rst                                        |   146 +-
 PKG-INFO                                           |     4 +-
 README.rst                                         |     2 +-
 ah_bootstrap.py                                    |    16 +
 astropy/__init__.py                                |     8 +-
 astropy/convolution/boundary_extend.c              |  5255 ++++-----
 astropy/convolution/boundary_fill.c                |  5558 +++++-----
 astropy/convolution/boundary_none.c                |  5407 +++++-----
 astropy/convolution/boundary_wrap.c                |  5341 ++++-----
 astropy/coordinates/baseframe.py                   |    19 +-
 astropy/coordinates/builtin_frames.py              |    18 +-
 astropy/coordinates/distances.py                   |     9 +-
 astropy/coordinates/representation.py              |     2 +-
 astropy/coordinates/sky_coordinate.py              |    84 +-
 .../coordinates/tests/test_angular_separation.py   |     2 +-
 astropy/coordinates/tests/test_api_ape5.py         |     2 +-
 astropy/coordinates/tests/test_arrays.py           |     4 +-
 astropy/coordinates/tests/test_representation.py   |    10 +
 astropy/coordinates/tests/test_sky_coord.py        |    59 +
 astropy/coordinates/tests/test_transformations.py  |    18 +
 astropy/cosmology/core.py                          |    19 +-
 astropy/cosmology/funcs.py                         |     2 +-
 astropy/cosmology/tests/test_cosmology.py          |     3 +
 astropy/cython_version.py                          |     2 +-
 astropy/extern/setup_package.py                    |     2 +-
 astropy/extern/six.py                              |    48 +-
 astropy/io/ascii/setup_package.py                  |     1 +
 astropy/io/ascii/tests/test_compressed.py          |     9 +
 astropy/io/ascii/tests/test_read.py                |     7 +
 astropy/io/ascii/ui.py                             |    13 +
 astropy/io/fits/hdu/compressed.py                  |     7 +
 astropy/io/fits/hdu/hdulist.py                     |    10 +
 astropy/io/fits/setup_package.py                   |     1 +
 astropy/io/fits/src/compressionmodule.c            |    10 +-
 astropy/io/fits/tests/test_hdulist.py              |    19 +
 astropy/io/fits/util.py                            |    30 +-
 astropy/io/votable/setup_package.py                |     2 +
 astropy/modeling/core.py                           |    14 +
 astropy/modeling/functional_models.py              |    22 +-
 astropy/modeling/tests/test_input.py               |   218 +-
 astropy/modeling/tests/test_rotations.py           |     2 +-
 astropy/stats/funcs.py                             |    17 +-
 astropy/table/_np_utils.c                          |  4441 ++++----
 astropy/table/column.py                            |    14 +
 astropy/table/groups.py                            |     4 +-
 astropy/table/np_utils.py                          |    25 +-
 astropy/table/setup_package.py                     |     2 +
 astropy/table/table.py                             |     6 +-
 astropy/table/tests/test_column.py                 |    27 +
 astropy/table/tests/test_init_table.py             |    27 +
 astropy/table/tests/test_operations.py             |    19 +
 astropy/table/tests/test_table.py                  |     9 +
 astropy/tests/helper.py                            |     5 +-
 astropy/tests/pytest_plugins.py                    |    16 +-
 astropy/time/core.py                               |     5 +-
 astropy/time/erfa_time.c                           | 10727 ++++++++++---------
 astropy/units/core.py                              |    40 +-
 astropy/units/equivalencies.py                     |     5 +-
 astropy/units/quantity.py                          |   346 +-
 astropy/units/tests/test_equivalencies.py          |    56 +-
 astropy/units/tests/test_quantity.py               |    49 +
 astropy/units/tests/test_quantity_array_methods.py |    93 +-
 astropy/units/tests/test_units.py                  |    26 +-
 astropy/units/utils.py                             |    18 +-
 astropy/utils/data.py                              |    35 +-
 astropy/utils/metadata.py                          |     3 +-
 astropy/utils/misc.py                              |    28 +-
 astropy/utils/setup_package.py                     |     2 +
 astropy/utils/tests/test_data.py                   |    30 +-
 astropy/utils/tests/test_metadata.py               |    17 +-
 astropy/utils/tests/test_misc.py                   |    37 +
 astropy/utils/xml/setup_package.py                 |     2 +
 astropy/version.py                                 |    14 +-
 astropy/vo/samp/integrated_client.py               |    36 +-
 astropy/vo/samp/setup_package.py                   |     1 +
 astropy/vo/samp/tests/test_client.py               |    23 +
 astropy/wcs/src/wcslib_wrap.c                      |     2 +-
 astropy/wcs/tests/test_utils.py                    |     4 +-
 astropy/wcs/tests/test_wcs.py                      |    57 +-
 astropy/wcs/wcs.py                                 |     6 +
 astropy_helpers/.coveragerc                        |    21 -
 astropy_helpers/.travis.yml                        |    43 -
 astropy_helpers/CHANGES.rst                        |    61 -
 astropy_helpers/CONTRIBUTING.md                    |    20 -
 astropy_helpers/LICENSE.rst                        |    26 -
 astropy_helpers/MANIFEST.in                        |    10 -
 astropy_helpers/README.rst                         |    26 -
 astropy_helpers/ah_bootstrap.py                    |   748 --
 astropy_helpers/astropy_helpers.egg-info/PKG-INFO  |    46 -
 .../astropy_helpers.egg-info/SOURCES.txt           |    67 -
 .../astropy_helpers.egg-info/dependency_links.txt  |     1 -
 .../astropy_helpers.egg-info/not-zip-safe          |     1 -
 .../astropy_helpers.egg-info/top_level.txt         |     1 -
 astropy_helpers/astropy_helpers/__init__.py        |     4 -
 astropy_helpers/astropy_helpers/compat/__init__.py |    12 -
 .../compat/_subprocess_py2/__init__.py             |    38 -
 .../astropy_helpers/compat/subprocess.py           |    19 -
 astropy_helpers/astropy_helpers/git_helpers.py     |   155 -
 astropy_helpers/astropy_helpers/setup_helpers.py   |  1526 ---
 astropy_helpers/astropy_helpers/sphinx/__init__.py |     6 -
 astropy_helpers/astropy_helpers/sphinx/conf.py     |   310 -
 .../astropy_helpers/sphinx/ext/__init__.py         |     3 -
 .../sphinx/ext/astropyautosummary.py               |    98 -
 .../astropy_helpers/sphinx/ext/automodapi.py       |   350 -
 .../astropy_helpers/sphinx/ext/automodsumm.py      |   581 -
 .../astropy_helpers/sphinx/ext/changelog_links.py  |    78 -
 .../astropy_helpers/sphinx/ext/comment_eater.py    |   169 -
 .../astropy_helpers/sphinx/ext/compiler_unparse.py |   865 --
 .../astropy_helpers/sphinx/ext/docscrape.py        |   531 -
 .../astropy_helpers/sphinx/ext/docscrape_sphinx.py |   274 -
 .../astropy_helpers/sphinx/ext/doctest.py          |    33 -
 .../astropy_helpers/sphinx/ext/edit_on_github.py   |   165 -
 .../astropy_helpers/sphinx/ext/numpydoc.py         |   187 -
 .../astropy_helpers/sphinx/ext/phantom_import.py   |   167 -
 .../astropy_helpers/sphinx/ext/smart_resolver.py   |    69 -
 .../sphinx/ext/templates/autosummary_core/base.rst |    10 -
 .../ext/templates/autosummary_core/class.rst       |    65 -
 .../ext/templates/autosummary_core/module.rst      |    41 -
 .../astropy_helpers/sphinx/ext/tests/__init__.py   |    70 -
 .../sphinx/ext/tests/test_automodapi.py            |   346 -
 .../sphinx/ext/tests/test_automodsumm.py           |   115 -
 .../sphinx/ext/tests/test_docscrape.py             |   762 --
 .../astropy_helpers/sphinx/ext/tests/test_utils.py |    34 -
 .../astropy_helpers/sphinx/ext/tocdepthfix.py      |    18 -
 .../astropy_helpers/sphinx/ext/traitsdoc.py        |   142 -
 .../astropy_helpers/sphinx/ext/utils.py            |    65 -
 .../astropy_helpers/sphinx/ext/viewcode.py         |   216 -
 .../astropy_helpers/sphinx/local/python3links.inv  |     7 -
 .../astropy_helpers/sphinx/local/python3links.txt  |    13 -
 .../astropy_helpers/sphinx/setup_package.py        |    10 -
 .../sphinx/themes/bootstrap-astropy/globaltoc.html |     3 -
 .../sphinx/themes/bootstrap-astropy/layout.html    |    96 -
 .../sphinx/themes/bootstrap-astropy/localtoc.html  |     3 -
 .../sphinx/themes/bootstrap-astropy/searchbox.html |     7 -
 .../static/astropy_linkout_20.png                  |   Bin 1725 -> 0 bytes
 .../bootstrap-astropy/static/astropy_logo.ico      |   Bin 1150 -> 0 bytes
 .../bootstrap-astropy/static/astropy_logo_32.png   |   Bin 1884 -> 0 bytes
 .../bootstrap-astropy/static/bootstrap-astropy.css |   585 -
 .../themes/bootstrap-astropy/static/copybutton.js  |    57 -
 .../themes/bootstrap-astropy/static/sidebar.js     |   160 -
 .../sphinx/themes/bootstrap-astropy/theme.conf     |    10 -
 astropy_helpers/astropy_helpers/src/__init__.py    |     0
 astropy_helpers/astropy_helpers/src/compiler.c     |   129 -
 .../astropy_helpers/src/setup_package.py           |     2 -
 astropy_helpers/astropy_helpers/test_helpers.py    |   207 -
 astropy_helpers/astropy_helpers/tests/__init__.py  |   172 -
 .../astropy_helpers/tests/test_ah_bootstrap.py     |   382 -
 .../astropy_helpers/tests/test_git_helpers.py      |    58 -
 .../astropy_helpers/tests/test_setup_helpers.py    |   119 -
 astropy_helpers/astropy_helpers/utils.py           |   162 -
 astropy_helpers/astropy_helpers/version.py         |   169 -
 astropy_helpers/astropy_helpers/version_helpers.py |   191 -
 .../astropy_helpers/__init__.py                    |     4 -
 .../astropy_helpers/compat/__init__.py             |    12 -
 .../compat/_subprocess_py2/__init__.py             |    38 -
 .../astropy_helpers/compat/subprocess.py           |    19 -
 .../astropy_helpers/git_helpers.py                 |   155 -
 .../astropy_helpers/setup_helpers.py               |  1526 ---
 .../astropy_helpers/sphinx/__init__.py             |     6 -
 .../astropy_helpers/sphinx/conf.py                 |   310 -
 .../astropy_helpers/sphinx/ext/__init__.py         |     3 -
 .../sphinx/ext/astropyautosummary.py               |    98 -
 .../astropy_helpers/sphinx/ext/automodapi.py       |   350 -
 .../astropy_helpers/sphinx/ext/automodsumm.py      |   581 -
 .../astropy_helpers/sphinx/ext/changelog_links.py  |    78 -
 .../astropy_helpers/sphinx/ext/comment_eater.py    |   169 -
 .../astropy_helpers/sphinx/ext/compiler_unparse.py |   865 --
 .../astropy_helpers/sphinx/ext/docscrape.py        |   531 -
 .../astropy_helpers/sphinx/ext/docscrape_sphinx.py |   274 -
 .../astropy_helpers/sphinx/ext/doctest.py          |    33 -
 .../astropy_helpers/sphinx/ext/edit_on_github.py   |   165 -
 .../astropy_helpers/sphinx/ext/numpydoc.py         |   187 -
 .../astropy_helpers/sphinx/ext/phantom_import.py   |   167 -
 .../astropy_helpers/sphinx/ext/smart_resolver.py   |    69 -
 .../sphinx/ext/templates/autosummary_core/base.rst |    10 -
 .../ext/templates/autosummary_core/class.rst       |    65 -
 .../ext/templates/autosummary_core/module.rst      |    41 -
 .../astropy_helpers/sphinx/ext/tests/__init__.py   |    70 -
 .../sphinx/ext/tests/test_automodapi.py            |   346 -
 .../sphinx/ext/tests/test_automodsumm.py           |   115 -
 .../sphinx/ext/tests/test_docscrape.py             |   762 --
 .../astropy_helpers/sphinx/ext/tests/test_utils.py |    34 -
 .../astropy_helpers/sphinx/ext/tocdepthfix.py      |    18 -
 .../astropy_helpers/sphinx/ext/traitsdoc.py        |   142 -
 .../astropy_helpers/sphinx/ext/utils.py            |    65 -
 .../astropy_helpers/sphinx/ext/viewcode.py         |   216 -
 .../astropy_helpers/sphinx/local/python3links.inv  |     7 -
 .../astropy_helpers/sphinx/setup_package.py        |    10 -
 .../sphinx/themes/bootstrap-astropy/globaltoc.html |     3 -
 .../sphinx/themes/bootstrap-astropy/layout.html    |    96 -
 .../sphinx/themes/bootstrap-astropy/localtoc.html  |     3 -
 .../sphinx/themes/bootstrap-astropy/searchbox.html |     7 -
 .../static/astropy_linkout_20.png                  |   Bin 1725 -> 0 bytes
 .../bootstrap-astropy/static/astropy_logo.ico      |   Bin 1150 -> 0 bytes
 .../bootstrap-astropy/static/astropy_logo_32.png   |   Bin 1884 -> 0 bytes
 .../bootstrap-astropy/static/bootstrap-astropy.css |   585 -
 .../themes/bootstrap-astropy/static/copybutton.js  |    57 -
 .../themes/bootstrap-astropy/static/sidebar.js     |   160 -
 .../sphinx/themes/bootstrap-astropy/theme.conf     |    10 -
 .../astropy_helpers/src/__init__.py                |     0
 .../astropy_helpers/src/compiler.c                 |   129 -
 .../astropy_helpers/src/setup_package.py           |     2 -
 .../astropy_helpers/test_helpers.py                |   207 -
 .../lib.linux-x86_64-2.7/astropy_helpers/utils.py  |   162 -
 .../astropy_helpers/version.py                     |   169 -
 .../astropy_helpers/version_helpers.py             |   191 -
 .../dist/astropy_helpers-0.4.2-py2.7.egg           |   Bin 210047 -> 0 bytes
 astropy_helpers/ez_setup.py                        |   382 -
 astropy_helpers/licenses/LICENSE_COPYBUTTON.rst    |    50 -
 astropy_helpers/licenses/LICENSE_NUMPYDOC.rst      |    94 -
 astropy_helpers/setup.cfg                          |     5 -
 astropy_helpers/setup.py                           |    50 -
 astropy_helpers/tox.ini                            |    12 -
 docs/_pkgtemplate.rst                              |     2 +-
 docs/coordinates/formatting.rst                    |     2 +-
 docs/coordinates/frames.rst                        |     2 +-
 docs/coordinates/index.rst                         |     4 +-
 docs/coordinates/representations.rst               |     7 +-
 docs/coordinates/skycoord.rst                      |   223 +-
 docs/coordinates/transforming.rst                  |    10 +-
 docs/cosmology/index.rst                           |     2 +-
 docs/development/docrules.rst                      |     2 +-
 docs/development/testguide.rst                     |    21 +-
 docs/development/workflow/development_workflow.rst |    14 +-
 docs/development/workflow/get_devel_version.rst    |     2 +-
 docs/development/workflow/maintainer_workflow.rst  |     4 +-
 docs/development/workflow/virtual_pythons.rst      |     4 +-
 docs/getting_started.rst                           |    22 +
 docs/install.rst                                   |     2 +-
 docs/io/ascii/base_classes.rst                     |     2 +-
 docs/io/ascii/fixed_width_gallery.rst              |     2 +-
 docs/io/fits/appendix/faq.rst                      |     4 +-
 docs/io/fits/appendix/header_transition.rst        |    12 +-
 docs/io/fits/appendix/history.rst                  |    12 +-
 docs/io/fits/index.rst                             |     2 +-
 docs/io/fits/usage/scripts.rst                     |     2 +
 docs/io/fits/usage/table.rst                       |     4 +-
 docs/io/fits/usage/unfamiliar.rst                  |     4 +-
 docs/known_issues.rst                              |    73 +-
 docs/modeling/algorithms.rst                       |     4 +-
 docs/nddata/nddata.rst                             |     2 +-
 docs/table/construct_table.rst                     |    23 +-
 docs/time/index.rst                                |     2 +-
 docs/units/decomposing_and_composing.rst           |     6 +-
 docs/units/format.rst                              |     2 +-
 docs/vo/samp/example_table_image.rst               |     2 +-
 docs/wcs/examples/from_file.py                     |     2 +-
 docs/wcs/index.rst                                 |     2 +
 setup.py                                           |     2 +-
 249 files changed, 21365 insertions(+), 38853 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index 4cdbc74..85dc16f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,146 @@
+0.4.3 (2015-01-15)
+------------------
+
+Bug Fixes
+^^^^^^^^^
+
+- ``astropy.coordinates``
+
+  - The ``Distance`` class has been fixed to no longer rely on the deprecated
+    cosmology functions. [#2991]
+
+  - Ensure ``float32`` values can be used in coordinate representations. [#2983]
+
+  - Fix frame attribute inheritance in ``SkyCoord.transform_to()`` method so
+    that the default attribute value (e.g. equinox) for the destination frame
+    gets used if no corresponding value was explicitly specified. [#3106]
+
+  - ``Angle`` accepts hours:mins or deg:mins initializers (without
+     seconds). In these cases float minutes are also accepted.
+
+  - ``astropy.coordinates.SkyCoord`` objects are now copyable. [#2888]
+
+  - ``astropy.coordinates.SkyCoord`` object attributes are now
+    immutable.  It is still technically possible to change the
+    internal data for an array-valued coordinate object but this leads
+    to inconsistencies [#2889] and should not be done. [#2888]
+
+- ``astropy.cosmology``
+
+  - The ``ztol`` keyword argument to z_at_value now works correctly [#2993].
+
+- ``astropy.io.ascii``
+
+  - Fix a bug in Python 3 when guessing file format using a file object as
+    input.  Also improve performance in same situation for Python 2. [#3132]
+
+  - Fix a problem where URL was being downloaded for each guess. [#2001]
+
+- ``astropy.io.fits``
+
+  - The ``in`` operator now works correctly for checking if an extension
+    is in an ``HDUList`` (as given via EXTNAME, (EXTNAME, EXTVER) tuples,
+    etc.) [#3060]
+
+  - Added workaround for bug in MacOS X <= 10.8 that caused np.fromfile to
+    fail. [#3078]
+
+  - Added support for the ``RICE_ONE`` compression type synonym. [#3115]
+
+- ``astropy.modeling``
+
+  - Fixed a test failure on Debian/PowerPC and Debian/s390x. [#2708]
+
+  - Fixed crash in evaluating models that have more outputs than inputs--this
+    case may not be handled as desired for all conceivable models of this
+    format (some may have to implement custom ``prepare_inputs`` and
+    ``prepare_outputs`` methods).  But as long as all outputs can be assumed
+    to have a shape determined from the broadcast of all inputs with all
+    parameters then this can be used safely. [#3250]
+
+- ``astropy.table``
+
+  - Fix a bug that caused join to fail for multi-dimensional columns. [#2984]
+
+  - Fix a bug where MaskedColumn attributes which had been changed since
+    the object was created were not being carried through when slicing. [#3023]
+
+  - Fix a bug that prevented initializing a table from a structured array
+    with multi-dimensional columns with copy=True. [#3034]
+
+  - Fixed unnecessarily large unicode columns when instantiating a table from
+    row data on Python 3. [#3052]
+
+  - Improved the warning message when unable to aggregate non-numeric
+    columns. [#2700]
+
+- ``astropy.units``
+
+  - Operations on quantities with incompatible types now raises a much
+    more informative ``TypeError``. [#2934]
+
+  - ``Quantity.tolist`` now overrides the ``ndarray`` method to give a 
+    ``NotImplementedError`` (by renaming the previous ``list`` method). [#3050]
+
+  - ``Quantity.round`` now always returns a ``Quantity`` (previously it
+    returned an ``ndarray`` for ``decimals>0``). [#3062]
+
+  - Ensured ``np.squeeze`` always returns a ``Quantity`` (it only worked if
+    no dimensions were removed). [#3045]
+
+  - Input to ``Quantity`` with a ``unit`` attribute no longer can get mangled
+    with ``copy=False``. [#3051]
+
+  - Remove trailing space in ``__format__`` calls for dimensionless quantities.
+    [#3097]
+
+  - Comparisons between units and non-unit-like objects now works
+    correctly. [#3108]
+
+  - Units with fractional powers are now correctly multiplied together
+    by using rational arithmetic.  [#3121]
+
+  - Removed a few entries from spectral density equivalencies which did not
+    make sense. [#3153]
+
+- ``astropy.utils``
+
+  - Fixed an issue with the ``deprecated`` decorator on classes that invoke
+    ``super()`` in their ``__init__`` method. [#3004]
+
+  - Fixed a bug which caused the ``metadata_conflicts`` parameter to be
+    ignored in the ``astropy.utils.metadata.merge`` function. [#3294]  
+
+- ``astropy.vo``
+
+  - Fixed an issue with reconnecting to a SAMP Hub. [#2674]
+
+- ``astropy.wcs``
+
+- Misc
+
+  - Astropy will now work if your Python interpreter does not have the
+    ``bz2`` module installed. [#3104]
+
+  - Invalid or out of range values passed to ``wcs_world2pix`` will
+    now be correctly identified and returned as ``nan``
+    values. [#2965]
+
+  - Fixed an issue which meant that Python thought ``WCS`` objects were
+    iterable. [#3066]
+
+  - Fixed ``ResourceWarning`` for ``astropy/extern/bundled/six.py`` that could
+    occur sometimes after using Astropy in Python 3.4. [#3156]
+
+Other Changes and Additions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- ``astropy.coordinates``
+
+  - Improved the agreement of the FK5 <-> Galactic conversion with other
+    codes, and with the FK5 <-> FK4 <-> Galactic route. [#3107]
+
+
 0.4.2 (2014-09-23)
 ------------------
 
@@ -80,8 +223,6 @@ Bug Fixes
 
   - Improved error message on Cone Search time out. [#2687]
 
-- ``astropy.wcs``
-
 Other Changes and Additions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -97,7 +238,6 @@ Other Changes and Additions
 - Ensure numpy master is supported, by making ``np.cbrt`` work with quantities.
   [#2937]
 
-
 0.4.1 (2014-08-08)
 ------------------
 
diff --git a/PKG-INFO b/PKG-INFO
index 569d6eb..a495bb1 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: astropy
-Version: 0.4.2
+Version: 0.4.3
 Summary: Community-developed python astronomy tools
 Home-page: http://astropy.org
 Author: The Astropy Developers
 Author-email: astropy.team at gmail.com
 License: BSD
-Download-URL: http://pypi.python.org/packages/source/a/astropy/astropy-0.4.2.tar.gz
+Download-URL: http://pypi.python.org/packages/source/a/astropy/astropy-0.4.3.tar.gz
 Description: 
         Astropy is a package intended to contain core functionality and some
         common tools needed for performing astronomy and astrophysics research with
diff --git a/README.rst b/README.rst
index 3740958..7e813ef 100644
--- a/README.rst
+++ b/README.rst
@@ -13,7 +13,7 @@ the core functionality and some common tools needed for performing
 astronomy and astrophysics with Python.
 
 Releases are `registered on PyPI <http://pypi.python.org/pypi/astropy>`_,
-and development is occuring at the
+and development is occurring at the
 `project's github page <http://github.com/astropy/astropy>`_.
 
 For installation instructions, see the `online documentation <http://docs.astropy.org/>`_
diff --git a/ah_bootstrap.py b/ah_bootstrap.py
index fdf64fb..6888c3e 100644
--- a/ah_bootstrap.py
+++ b/ah_bootstrap.py
@@ -94,6 +94,16 @@ from setuptools import Distribution
 from setuptools.package_index import PackageIndex
 from setuptools.sandbox import run_setup
 
+# Note: The following import is required as a workaround to
+# https://github.com/astropy/astropy-helpers/issues/89; if we don't import this
+# module now, it will get cleaned up after `run_setup` is called, but that will
+# later cause the TemporaryDirectory class defined in it to stop working when
+# used later on by setuptools
+try:
+    import setuptools.py31compat
+except ImportError:
+    pass
+
 # TODO: Maybe enable checking for a specific version of astropy_helpers?
 DIST_NAME = 'astropy-helpers'
 PACKAGE_NAME = 'astropy_helpers'
@@ -180,6 +190,12 @@ def use_astropy_helpers(path=None, download_if_needed=None, index_url=None,
     if index_url is None:
         index_url = INDEX_URL
 
+    # If this is a release then the .git directory will not exist so we
+    # should not use git.
+    git_dir_exists = os.path.exists(os.path.join(os.path.dirname(__file__), '.git'))
+    if use_git is None and not git_dir_exists:
+        use_git = False
+
     if use_git is None:
         use_git = USE_GIT
 
diff --git a/astropy/__init__.py b/astropy/__init__.py
index 3cac206..af955ac 100644
--- a/astropy/__init__.py
+++ b/astropy/__init__.py
@@ -126,7 +126,7 @@ def _get_test_runner():
 def test(package=None, test_path=None, args=None, plugins=None,
          verbose=False, pastebin=None, remote_data=False, pep8=False,
          pdb=False, open_files=False, parallel=0, docs_path=None,
-         skip_docs=False):
+         skip_docs=False, repeat=None):
     """
     Run Astropy tests using py.test. A proper set of arguments is
     constructed and passed to `pytest.main`.
@@ -189,6 +189,10 @@ def test(package=None, test_path=None, args=None, plugins=None,
     skip_docs : bool, optional
         When `True`, skips running the doctests in the .rst files.
 
+    repeat : int, optional
+        If set, specifies how many times each test should be run. This is
+        useful for diagnosing sporadic failures.
+
     See Also
     --------
     pytest.main : py.test function wrapped by `run_tests`.
@@ -200,7 +204,7 @@ def test(package=None, test_path=None, args=None, plugins=None,
         plugins=plugins, verbose=verbose, pastebin=pastebin,
         remote_data=remote_data, pep8=pep8, pdb=pdb,
         open_files=open_files, parallel=parallel, docs_path=docs_path,
-        skip_docs=skip_docs)
+        skip_docs=skip_docs, repeat=repeat)
 
 
 # if we are *not* in setup mode, import the logger and possibly populate the
diff --git a/astropy/convolution/boundary_extend.c b/astropy/convolution/boundary_extend.c
index 9d49928..90ae14c 100644
--- a/astropy/convolution/boundary_extend.c
+++ b/astropy/convolution/boundary_extend.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -265,17 +247,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -289,40 +260,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -354,20 +442,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "boundary_extend.pyx",
-  "numpy.pxd",
+  "astropy/convolution/boundary_extend.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -394,7 +482,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -403,7 +491,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -412,7 +500,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -421,7 +509,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -430,7 +518,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -439,7 +527,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -448,7 +536,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -457,7 +545,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -466,7 +554,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -475,7 +563,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -484,7 +572,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -493,7 +581,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -502,7 +590,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -511,7 +599,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -520,7 +608,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -529,7 +617,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -538,7 +626,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -547,7 +635,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -556,7 +644,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -565,7 +653,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -574,7 +662,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -614,7 +702,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_15boundary_extend_
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -623,7 +711,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_15boundary_extend_
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -632,7 +720,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -641,7 +729,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -662,7 +750,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -699,23 +787,46 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
@@ -723,16 +834,28 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+#ifndef __PYX_FORCE_INIT_THREADS
+  #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -741,9 +864,22 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -770,7 +906,13 @@ typedef struct {
 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -784,7 +926,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -870,37 +1012,9 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -912,28 +1026,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+static PyObject *__Pyx_ImportModule(const char *name);
 
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -981,146 +1078,147 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
 static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_boundary_extend(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "Convolution kernel must have odd dimensions";
-static char __pyx_k_5[] = "ndarray is not C contiguous";
-static char __pyx_k_7[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_9[] = "Non-native byte order not supported";
-static char __pyx_k_11[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_12[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_15[] = "Format string allocated too short.";
-static char __pyx_k_19[] = "convolve1d_boundary_extend";
-static char __pyx_k_20[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_extend.pyx";
-static char __pyx_k_21[] = "astropy.convolution.boundary_extend";
-static char __pyx_k_24[] = "convolve2d_boundary_extend";
-static char __pyx_k_27[] = "convolve3d_boundary_extend";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__ii[] = "ii";
-static char __pyx_k__jj[] = "jj";
-static char __pyx_k__kk[] = "kk";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__nx[] = "nx";
-static char __pyx_k__ny[] = "ny";
-static char __pyx_k__nz[] = "nz";
-static char __pyx_k__bot[] = "bot";
-static char __pyx_k__iii[] = "iii";
-static char __pyx_k__jjj[] = "jjj";
-static char __pyx_k__ker[] = "ker";
-static char __pyx_k__kkk[] = "kkk";
-static char __pyx_k__nkx[] = "nkx";
-static char __pyx_k__nky[] = "nky";
-static char __pyx_k__nkz[] = "nkz";
-static char __pyx_k__top[] = "top";
-static char __pyx_k__val[] = "val";
-static char __pyx_k__wkx[] = "wkx";
-static char __pyx_k__wky[] = "wky";
-static char __pyx_k__wkz[] = "wkz";
-static char __pyx_k__conv[] = "conv";
-static char __pyx_k__DTYPE[] = "DTYPE";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__fixed[] = "fixed";
-static char __pyx_k__float[] = "float";
-static char __pyx_k__iimax[] = "iimax";
-static char __pyx_k__iimin[] = "iimin";
-static char __pyx_k__jjmax[] = "jjmax";
-static char __pyx_k__jjmin[] = "jjmin";
-static char __pyx_k__kkmax[] = "kkmax";
-static char __pyx_k__kkmin[] = "kkmin";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_n_s_19;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_n_s_21;
-static PyObject *__pyx_n_s_24;
-static PyObject *__pyx_n_s_27;
-static PyObject *__pyx_kp_u_5;
-static PyObject *__pyx_kp_u_7;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__DTYPE;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bot;
-static PyObject *__pyx_n_s__conv;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__f;
-static PyObject *__pyx_n_s__fixed;
-static PyObject *__pyx_n_s__float;
-static PyObject *__pyx_n_s__g;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__ii;
-static PyObject *__pyx_n_s__iii;
-static PyObject *__pyx_n_s__iimax;
-static PyObject *__pyx_n_s__iimin;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__jj;
-static PyObject *__pyx_n_s__jjj;
-static PyObject *__pyx_n_s__jjmax;
-static PyObject *__pyx_n_s__jjmin;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__ker;
-static PyObject *__pyx_n_s__kk;
-static PyObject *__pyx_n_s__kkk;
-static PyObject *__pyx_n_s__kkmax;
-static PyObject *__pyx_n_s__kkmin;
-static PyObject *__pyx_n_s__nkx;
-static PyObject *__pyx_n_s__nky;
-static PyObject *__pyx_n_s__nkz;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__nx;
-static PyObject *__pyx_n_s__ny;
-static PyObject *__pyx_n_s__nz;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__top;
-static PyObject *__pyx_n_s__val;
-static PyObject *__pyx_n_s__wkx;
-static PyObject *__pyx_n_s__wky;
-static PyObject *__pyx_n_s__wkz;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_codeobj_18;
-static PyObject *__pyx_k_codeobj_23;
-static PyObject *__pyx_k_codeobj_26;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_ii[] = "ii";
+static char __pyx_k_jj[] = "jj";
+static char __pyx_k_kk[] = "kk";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_nx[] = "nx";
+static char __pyx_k_ny[] = "ny";
+static char __pyx_k_nz[] = "nz";
+static char __pyx_k_bot[] = "bot";
+static char __pyx_k_iii[] = "iii";
+static char __pyx_k_jjj[] = "jjj";
+static char __pyx_k_ker[] = "ker";
+static char __pyx_k_kkk[] = "kkk";
+static char __pyx_k_nkx[] = "nkx";
+static char __pyx_k_nky[] = "nky";
+static char __pyx_k_nkz[] = "nkz";
+static char __pyx_k_top[] = "top";
+static char __pyx_k_val[] = "val";
+static char __pyx_k_wkx[] = "wkx";
+static char __pyx_k_wky[] = "wky";
+static char __pyx_k_wkz[] = "wkz";
+static char __pyx_k_conv[] = "conv";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_DTYPE[] = "DTYPE";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_fixed[] = "fixed";
+static char __pyx_k_float[] = "float";
+static char __pyx_k_iimax[] = "iimax";
+static char __pyx_k_iimin[] = "iimin";
+static char __pyx_k_jjmax[] = "jjmax";
+static char __pyx_k_jjmin[] = "jjmin";
+static char __pyx_k_kkmax[] = "kkmax";
+static char __pyx_k_kkmin[] = "kkmin";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_convolve1d_boundary_extend[] = "convolve1d_boundary_extend";
+static char __pyx_k_convolve2d_boundary_extend[] = "convolve2d_boundary_extend";
+static char __pyx_k_convolve3d_boundary_extend[] = "convolve3d_boundary_extend";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_extend.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Convolution_kernel_must_have_odd[] = "Convolution kernel must have odd dimensions";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_astropy_convolution_boundary_ext[] = "astropy.convolution.boundary_extend";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_Convolution_kernel_must_have_odd;
+static PyObject *__pyx_n_s_DTYPE;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_astropy_convolution_boundary_ext;
+static PyObject *__pyx_n_s_bot;
+static PyObject *__pyx_n_s_conv;
+static PyObject *__pyx_n_s_convolve1d_boundary_extend;
+static PyObject *__pyx_n_s_convolve2d_boundary_extend;
+static PyObject *__pyx_n_s_convolve3d_boundary_extend;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_fixed;
+static PyObject *__pyx_n_s_float;
+static PyObject *__pyx_n_s_g;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_ii;
+static PyObject *__pyx_n_s_iii;
+static PyObject *__pyx_n_s_iimax;
+static PyObject *__pyx_n_s_iimin;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_jj;
+static PyObject *__pyx_n_s_jjj;
+static PyObject *__pyx_n_s_jjmax;
+static PyObject *__pyx_n_s_jjmin;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_ker;
+static PyObject *__pyx_n_s_kk;
+static PyObject *__pyx_n_s_kkk;
+static PyObject *__pyx_n_s_kkmax;
+static PyObject *__pyx_n_s_kkmin;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_nkx;
+static PyObject *__pyx_n_s_nky;
+static PyObject *__pyx_n_s_nkz;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_nx;
+static PyObject *__pyx_n_s_ny;
+static PyObject *__pyx_n_s_nz;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_top;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_wkx;
+static PyObject *__pyx_n_s_wky;
+static PyObject *__pyx_n_s_wkz;
+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_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
 
 /* "astropy/convolution/boundary_extend.pyx":9
  * ctypedef np.float_t DTYPE_t
@@ -1135,7 +1233,7 @@ static CYTHON_INLINE int __pyx_f_7astropy_11convolution_15boundary_extend_int_ma
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("int_max", 0);
-  if ((__pyx_v_a >= __pyx_v_b)) {
+  if (((__pyx_v_a >= __pyx_v_b) != 0)) {
     __pyx_t_1 = __pyx_v_a;
   } else {
     __pyx_t_1 = __pyx_v_b;
@@ -1143,7 +1241,7 @@ static CYTHON_INLINE int __pyx_f_7astropy_11convolution_15boundary_extend_int_ma
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  __pyx_r = 0;
+  /* function exit code */
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -1162,7 +1260,7 @@ static CYTHON_INLINE int __pyx_f_7astropy_11convolution_15boundary_extend_int_mi
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("int_min", 0);
-  if ((__pyx_v_a <= __pyx_v_b)) {
+  if (((__pyx_v_a <= __pyx_v_b) != 0)) {
     __pyx_t_1 = __pyx_v_a;
   } else {
     __pyx_t_1 = __pyx_v_b;
@@ -1170,23 +1268,34 @@ static CYTHON_INLINE int __pyx_f_7astropy_11convolution_15boundary_extend_int_mi
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  __pyx_r = 0;
+  /* function exit code */
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_extend.pyx":19
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_extend(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend = {__Pyx_NAMESTR("convolve1d_boundary_extend"), (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend = {"convolve1d_boundary_extend", (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve1d_boundary_extend (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1200,10 +1309,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_b
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve1d_boundary_extend", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1231,6 +1340,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_b
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_boundary_extend(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1239,14 +1350,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_1convolve1d_b
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_extend.pyx":19
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve1d_boundary_extend(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
- *                                np.ndarray[DTYPE_t, ndim=1] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_boundary_extend(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_nkx;
@@ -1277,15 +1380,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
   unsigned int __pyx_t_11;
-  unsigned int __pyx_t_12;
+  int __pyx_t_12;
   int __pyx_t_13;
-  int __pyx_t_14;
+  unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
   unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
@@ -1300,7 +1403,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
   unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
-  unsigned int __pyx_t_29;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1339,7 +1441,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
+  __pyx_t_1 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
   if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_extend.pyx":23
@@ -1349,14 +1451,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_extend.pyx":25
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -1366,32 +1466,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_1) {
-    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_5) {
+    } else {
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L4_bool_binop_done;
+    }
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __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_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_1;
-  }
-  if (unlikely(!__pyx_t_6)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L4_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -1429,12 +1533,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *     cdef np.ndarray[DTYPE_t, ndim=1] conv = np.empty([nx], dtype=DTYPE)
  *     cdef unsigned int i, iii
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -1443,33 +1547,33 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
   __pyx_t_2 = 0;
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
   __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":31
  *     cdef int wkx = nkx // 2
@@ -1478,45 +1582,45 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *     cdef unsigned int i, iii
  *     cdef int ii
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
   __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
@@ -1527,9 +1631,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *         if npy_isnan(f[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_extend.pyx":42
  *     # neighboring values
@@ -1538,9 +1642,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_12 = __pyx_v_i;
-    __pyx_t_6 = npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_f.diminfo[0].strides)));
-    if (__pyx_t_6) {
+    __pyx_t_11 = __pyx_v_i;
+    __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_f.diminfo[0].strides))) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_extend.pyx":43
  *     for i in range(nx):
@@ -1585,9 +1689,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 iii = int_min(int_max(ii, 0), nx - 1)
  *                 val = f[iii]
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_extend.pyx":48
  *             iimax = i + wkx + 1
@@ -1605,8 +1709,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 if not npy_isnan(val):
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  */
-        __pyx_t_15 = __pyx_v_iii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f.diminfo[0].strides));
+        __pyx_t_14 = __pyx_v_iii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_extend.pyx":50
  *                 iii = int_min(int_max(ii, 0), nx - 1)
@@ -1615,8 +1719,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  *                     top += val * ker
  */
-        __pyx_t_6 = (!npy_isnan(__pyx_v_val));
-        if (__pyx_t_6) {
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":51
  *                 val = f[iii]
@@ -1625,8 +1729,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                     top += val * ker
  *                     bot += ker
  */
-          __pyx_t_16 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_g.diminfo[0].strides));
+          __pyx_t_15 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_g.diminfo[0].strides));
 
           /* "astropy/convolution/boundary_extend.pyx":52
  *                 if not npy_isnan(val):
@@ -1645,9 +1749,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *             if bot != 0.:
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L9;
+          goto __pyx_L11;
         }
-        __pyx_L9:;
+        __pyx_L11:;
       }
 
       /* "astropy/convolution/boundary_extend.pyx":55
@@ -1657,8 +1761,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 fixed[i] = top / bot
  *             else:
  */
-      __pyx_t_6 = (__pyx_v_bot != 0.);
-      if (__pyx_t_6) {
+      __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_extend.pyx":56
  * 
@@ -1668,12 +1772,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 fixed[i] = f[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_17 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L10;
+        __pyx_t_16 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -1684,12 +1794,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *         else:
  *             fixed[i] = f[i]
  */
+        __pyx_t_17 = __pyx_v_i;
         __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_f.diminfo[0].strides));
       }
-      __pyx_L10:;
-      goto __pyx_L6;
+      __pyx_L12:;
+      goto __pyx_L8;
     }
     /*else*/ {
 
@@ -1700,11 +1810,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  * 
  *     # Now run the proper convolution
  */
+      __pyx_t_19 = __pyx_v_i;
       __pyx_t_20 = __pyx_v_i;
-      __pyx_t_21 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides));
     }
-    __pyx_L6:;
+    __pyx_L8:;
   }
 
   /* "astropy/convolution/boundary_extend.pyx":63
@@ -1714,9 +1824,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *         if not npy_isnan(fixed[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_extend.pyx":64
  *     # Now run the proper convolution
@@ -1725,9 +1835,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_22 = __pyx_v_i;
-    __pyx_t_6 = (!npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides))));
-    if (__pyx_t_6) {
+    __pyx_t_21 = __pyx_v_i;
+    __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides))) != 0)) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_extend.pyx":65
  *     for i in range(nx):
@@ -1772,9 +1882,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 iii = int_min(int_max(ii, 0), nx - 1)
  *                 val = fixed[iii]
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_extend.pyx":70
  *             iimax = i + wkx + 1
@@ -1792,8 +1902,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  *                 if not npy_isnan(val):
  */
-        __pyx_t_23 = __pyx_v_iii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        __pyx_t_22 = __pyx_v_iii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_extend.pyx":72
  *                 iii = int_min(int_max(ii, 0), nx - 1)
@@ -1802,8 +1912,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 if not npy_isnan(val):
  *                     top += val * ker
  */
-        __pyx_t_24 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_g.diminfo[0].strides));
+        __pyx_t_23 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_g.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_extend.pyx":73
  *                 val = fixed[iii]
@@ -1812,8 +1922,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                     top += val * ker
  *                     bot += ker
  */
-        __pyx_t_6 = (!npy_isnan(__pyx_v_val));
-        if (__pyx_t_6) {
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":74
  *                 ker = g[<unsigned int>(wkx + ii - i)]
@@ -1832,9 +1942,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 conv[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L16;
+          goto __pyx_L18;
         }
-        __pyx_L16:;
+        __pyx_L18:;
       }
 
       /* "astropy/convolution/boundary_extend.pyx":76
@@ -1844,8 +1954,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 conv[i] = top / bot
  *             else:
  */
-      __pyx_t_6 = (__pyx_v_bot != 0.0);
-      if (__pyx_t_6) {
+      __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_extend.pyx":77
  *                     bot += ker
@@ -1855,12 +1965,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *                 conv[i] = fixed[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_25 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L17;
+        __pyx_t_24 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L19;
       }
       /*else*/ {
 
@@ -1871,12 +1987,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  *         else:
  *             conv[i] = fixed[i]
  */
+        __pyx_t_25 = __pyx_v_i;
         __pyx_t_26 = __pyx_v_i;
-        __pyx_t_27 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[0].strides));
       }
-      __pyx_L17:;
-      goto __pyx_L13;
+      __pyx_L19:;
+      goto __pyx_L15;
     }
     /*else*/ {
 
@@ -1887,11 +2003,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
  * 
  *     return conv
  */
+      __pyx_t_27 = __pyx_v_i;
       __pyx_t_28 = __pyx_v_i;
-      __pyx_t_29 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides));
     }
-    __pyx_L13:;
+    __pyx_L15:;
   }
 
   /* "astropy/convolution/boundary_extend.pyx":83
@@ -1906,13 +2022,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
+  /* "astropy/convolution/boundary_extend.pyx":19
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_extend(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
+
+  /* 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_7);
+  __Pyx_XDECREF(__pyx_t_6);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -1936,17 +2059,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_convolve1d_bo
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_extend.pyx":87
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_extend(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend = {__Pyx_NAMESTR("convolve2d_boundary_extend"), (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend = {"convolve2d_boundary_extend", (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve2d_boundary_extend (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1960,10 +2094,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_b
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve2d_boundary_extend", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1991,6 +2125,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_b
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_boundary_extend(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1999,14 +2135,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_3convolve2d_b
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_extend.pyx":87
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve2d_boundary_extend(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
- *                                np.ndarray[DTYPE_t, ndim=2] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_boundary_extend(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -2042,23 +2170,23 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
+  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;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  unsigned int __pyx_t_11;
-  int __pyx_t_12;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
+  int __pyx_t_11;
+  unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
-  unsigned int __pyx_t_15;
+  int __pyx_t_15;
   int __pyx_t_16;
   int __pyx_t_17;
   int __pyx_t_18;
-  int __pyx_t_19;
+  unsigned int __pyx_t_19;
   unsigned int __pyx_t_20;
   unsigned int __pyx_t_21;
   unsigned int __pyx_t_22;
@@ -2088,7 +2216,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
   unsigned int __pyx_t_46;
   unsigned int __pyx_t_47;
   unsigned int __pyx_t_48;
-  unsigned int __pyx_t_49;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2127,14 +2254,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    __pyx_t_3 = __pyx_t_2;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_3 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_extend.pyx":91
  * 
@@ -2143,14 +2272,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_extend.pyx":93
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -2160,32 +2287,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __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_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (unlikely(!__pyx_t_2)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -2250,52 +2381,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *     cdef np.ndarray[DTYPE_t, ndim=2] conv = np.empty([nx, ny], dtype=DTYPE)
  *     cdef unsigned int i, j, iii, jjj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_4 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":102
  *     cdef int wky = nky // 2
@@ -2304,52 +2435,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *     cdef unsigned int i, j, iii, jjj
  *     cdef int ii, jj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_4 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_9 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":112
  *     # Need a first pass to replace NaN values with value convolved from
@@ -2358,9 +2489,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *         for j in range(ny):
  *             if npy_isnan(f[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_extend.pyx":113
  *     # neighboring values
@@ -2369,9 +2500,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *             if npy_isnan(f[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_extend.pyx":114
  *     for i in range(nx):
@@ -2380,10 +2511,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_14 = __pyx_v_i;
-      __pyx_t_15 = __pyx_v_j;
-      __pyx_t_2 = npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_f.diminfo[1].strides)));
-      if (__pyx_t_2) {
+      __pyx_t_13 = __pyx_v_i;
+      __pyx_t_14 = __pyx_v_j;
+      __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_f.diminfo[1].strides))) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_extend.pyx":115
  *         for j in range(ny):
@@ -2446,9 +2577,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     for jj in range(jjmin, jjmax):
  *                         iii = int_min(int_max(ii, 0), nx - 1)
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_extend.pyx":122
  *                 jjmax = j + wky + 1
@@ -2457,9 +2588,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                         iii = int_min(int_max(ii, 0), nx - 1)
  *                         jjj = int_min(int_max(jj, 0), ny - 1)
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_extend.pyx":123
  *                 for ii in range(iimin, iimax):
@@ -2486,9 +2617,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                         if not npy_isnan(val):
  *                             ker = g[<unsigned int>(wkx + ii - i),
  */
-            __pyx_t_20 = __pyx_v_iii;
-            __pyx_t_21 = __pyx_v_jjj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_f.diminfo[1].strides));
+            __pyx_t_19 = __pyx_v_iii;
+            __pyx_t_20 = __pyx_v_jjj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_extend.pyx":126
  *                         jjj = int_min(int_max(jj, 0), ny - 1)
@@ -2497,19 +2628,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                             ker = g[<unsigned int>(wkx + ii - i),
  *                                     <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_2) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
-              /* "astropy/convolution/boundary_extend.pyx":128
+              /* "astropy/convolution/boundary_extend.pyx":127
+ *                         val = f[iii, jjj]
  *                         if not npy_isnan(val):
- *                             ker = g[<unsigned int>(wkx + ii - i),
- *                                     <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                             ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                     <unsigned int>(wky + jj - j)]
  *                             top += val * ker
- *                             bot += ker
  */
-              __pyx_t_22 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-              __pyx_t_23 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_g.diminfo[1].strides));
+              __pyx_t_21 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+              __pyx_t_22 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_g.diminfo[1].strides));
 
               /* "astropy/convolution/boundary_extend.pyx":129
  *                             ker = g[<unsigned int>(wkx + ii - i),
@@ -2528,9 +2659,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                 if bot != 0.:
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L13;
+              goto __pyx_L17;
             }
-            __pyx_L13:;
+            __pyx_L17:;
           }
         }
 
@@ -2541,8 +2672,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     fixed[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_2 = (__pyx_v_bot != 0.);
-        if (__pyx_t_2) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":133
  * 
@@ -2552,13 +2683,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     fixed[i, j] = f[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_24 = __pyx_v_i;
-          __pyx_t_25 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L14;
+          __pyx_t_23 = __pyx_v_i;
+          __pyx_t_24 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L18;
         }
         /*else*/ {
 
@@ -2569,14 +2706,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *             else:
  *                 fixed[i, j] = f[i, j]
  */
-          __pyx_t_26 = __pyx_v_i;
-          __pyx_t_27 = __pyx_v_j;
-          __pyx_t_28 = __pyx_v_i;
-          __pyx_t_29 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[1].strides));
+          __pyx_t_25 = __pyx_v_i;
+          __pyx_t_26 = __pyx_v_j;
+          __pyx_t_27 = __pyx_v_i;
+          __pyx_t_28 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides));
         }
-        __pyx_L14:;
-        goto __pyx_L8;
+        __pyx_L18:;
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -2587,13 +2724,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  * 
  *     # Now run the proper convolution
  */
-        __pyx_t_30 = __pyx_v_i;
-        __pyx_t_31 = __pyx_v_j;
-        __pyx_t_32 = __pyx_v_i;
-        __pyx_t_33 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_f.diminfo[1].strides));
+        __pyx_t_29 = __pyx_v_i;
+        __pyx_t_30 = __pyx_v_j;
+        __pyx_t_31 = __pyx_v_i;
+        __pyx_t_32 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_f.diminfo[1].strides));
       }
-      __pyx_L8:;
+      __pyx_L12:;
     }
   }
 
@@ -2604,9 +2741,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *         for j in range(ny):
  *             if not npy_isnan(fixed[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_extend.pyx":141
  *     # Now run the proper convolution
@@ -2615,9 +2752,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *             if not npy_isnan(fixed[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_extend.pyx":142
  *     for i in range(nx):
@@ -2626,10 +2763,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_34 = __pyx_v_i;
-      __pyx_t_35 = __pyx_v_j;
-      __pyx_t_2 = (!npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[1].strides))));
-      if (__pyx_t_2) {
+      __pyx_t_33 = __pyx_v_i;
+      __pyx_t_34 = __pyx_v_j;
+      __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides))) != 0)) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_extend.pyx":143
  *         for j in range(ny):
@@ -2692,9 +2829,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     for jj in range(jjmin, jjmax):
  *                         iii = int_min(int_max(ii, 0), nx - 1)
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_extend.pyx":150
  *                 jjmax = j + wky + 1
@@ -2703,9 +2840,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                         iii = int_min(int_max(ii, 0), nx - 1)
  *                         jjj = int_min(int_max(jj, 0), ny - 1)
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_extend.pyx":151
  *                 for ii in range(iimin, iimax):
@@ -2732,20 +2869,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                         ker = g[<unsigned int>(wkx + ii - i),
  *                                 <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_36 = __pyx_v_iii;
-            __pyx_t_37 = __pyx_v_jjj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[1].strides));
+            __pyx_t_35 = __pyx_v_iii;
+            __pyx_t_36 = __pyx_v_jjj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[1].strides));
 
-            /* "astropy/convolution/boundary_extend.pyx":155
+            /* "astropy/convolution/boundary_extend.pyx":154
+ *                         jjj = int_min(int_max(jj, 0), ny - 1)
  *                         val = fixed[iii, jjj]
- *                         ker = g[<unsigned int>(wkx + ii - i),
- *                                 <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                         ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                 <unsigned int>(wky + jj - j)]
  *                         if not npy_isnan(val):
- *                             top += val * ker
  */
-            __pyx_t_38 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-            __pyx_t_39 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_g.diminfo[1].strides));
+            __pyx_t_37 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+            __pyx_t_38 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_g.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_extend.pyx":156
  *                         ker = g[<unsigned int>(wkx + ii - i),
@@ -2754,8 +2891,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                             top += val * ker
  *                             bot += ker
  */
-            __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_2) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_extend.pyx":157
  *                                 <unsigned int>(wky + jj - j)]
@@ -2774,9 +2911,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     conv[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L24;
+              goto __pyx_L28;
             }
-            __pyx_L24:;
+            __pyx_L28:;
           }
         }
 
@@ -2787,8 +2924,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     conv[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_2 = (__pyx_v_bot != 0.0);
-        if (__pyx_t_2) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":160
  *                             bot += ker
@@ -2798,13 +2935,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *                     conv[i, j] = fixed[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_40 = __pyx_v_i;
-          __pyx_t_41 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L25;
+          __pyx_t_39 = __pyx_v_i;
+          __pyx_t_40 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L29;
         }
         /*else*/ {
 
@@ -2815,14 +2958,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  *             else:
  *                 conv[i, j] = fixed[i, j]
  */
-          __pyx_t_42 = __pyx_v_i;
-          __pyx_t_43 = __pyx_v_j;
-          __pyx_t_44 = __pyx_v_i;
-          __pyx_t_45 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[1].strides));
+          __pyx_t_41 = __pyx_v_i;
+          __pyx_t_42 = __pyx_v_j;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[1].strides));
         }
-        __pyx_L25:;
-        goto __pyx_L19;
+        __pyx_L29:;
+        goto __pyx_L23;
       }
       /*else*/ {
 
@@ -2833,13 +2976,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
  * 
  *     return conv
  */
-        __pyx_t_46 = __pyx_v_i;
-        __pyx_t_47 = __pyx_v_j;
-        __pyx_t_48 = __pyx_v_i;
-        __pyx_t_49 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides));
+        __pyx_t_45 = __pyx_v_i;
+        __pyx_t_46 = __pyx_v_j;
+        __pyx_t_47 = __pyx_v_i;
+        __pyx_t_48 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[1].strides));
       }
-      __pyx_L19:;
+      __pyx_L23:;
     }
   }
 
@@ -2855,13 +2998,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_extend.pyx":87
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_extend(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -2885,17 +3035,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_2convolve2d_b
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_extend.pyx":170
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_extend(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend = {__Pyx_NAMESTR("convolve3d_boundary_extend"), (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend = {"convolve3d_boundary_extend", (PyCFunction)__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve3d_boundary_extend (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2909,10 +3070,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_b
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve3d_boundary_extend", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -2940,6 +3101,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_b
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_boundary_extend(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2948,14 +3111,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_15boundary_extend_5convolve3d_b
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_extend.pyx":170
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve3d_boundary_extend(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
- *                                np.ndarray[DTYPE_t, ndim=3] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_boundary_extend(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -2999,30 +3154,30 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
+  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;
-  PyArrayObject *__pyx_t_10 = NULL;
-  PyArrayObject *__pyx_t_11 = NULL;
+  PyArrayObject *__pyx_t_8 = NULL;
+  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
+  unsigned int __pyx_t_11;
   int __pyx_t_12;
   unsigned int __pyx_t_13;
   int __pyx_t_14;
   unsigned int __pyx_t_15;
-  int __pyx_t_16;
+  unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
-  unsigned int __pyx_t_19;
-  unsigned int __pyx_t_20;
+  int __pyx_t_19;
+  int __pyx_t_20;
   int __pyx_t_21;
   int __pyx_t_22;
   int __pyx_t_23;
   int __pyx_t_24;
-  int __pyx_t_25;
-  int __pyx_t_26;
+  unsigned int __pyx_t_25;
+  unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
   unsigned int __pyx_t_29;
@@ -3066,8 +3221,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
   unsigned int __pyx_t_67;
   unsigned int __pyx_t_68;
   unsigned int __pyx_t_69;
-  unsigned int __pyx_t_70;
-  unsigned int __pyx_t_71;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3106,20 +3259,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    if (!__pyx_t_2) {
-      __pyx_t_3 = (__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1);
-      __pyx_t_4 = __pyx_t_3;
-    } else {
-      __pyx_t_4 = __pyx_t_2;
-    }
-    __pyx_t_2 = __pyx_t_4;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_2 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_extend.pyx":174
  * 
@@ -3128,14 +3283,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_extend.pyx":176
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -3145,32 +3298,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __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_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_4 = __pyx_t_1;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (unlikely(!__pyx_t_4)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L7_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3262,57 +3419,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *     cdef np.ndarray[DTYPE_t, ndim=3] conv = np.empty([nx, ny, nz], dtype=DTYPE)
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_3 = 0;
   __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
-  __pyx_t_9 = 0;
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fixed.diminfo[2].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[2] [...]
     }
   }
-  __pyx_t_10 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":188
  *     cdef int wkz = nkz // 2
@@ -3321,57 +3478,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  *     cdef int ii, jj, kk
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
+  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_5 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_11 = ((PyArrayObject *)__pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_conv.diminfo[2].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[2]; __pyx_py [...]
     }
   }
-  __pyx_t_11 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_8);
-  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":198
  *     # Need a first pass to replace NaN values with value convolved from
@@ -3380,9 +3537,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_extend.pyx":199
  *     # neighboring values
@@ -3391,9 +3548,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *             for k in range(nz):
  *                 if npy_isnan(f[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_extend.pyx":200
  *     for i in range(nx):
@@ -3402,9 +3559,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                 if npy_isnan(f[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_extend.pyx":201
  *         for j in range(ny):
@@ -3413,11 +3570,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_j;
-        __pyx_t_20 = __pyx_v_k;
-        __pyx_t_4 = npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[2].strides)));
-        if (__pyx_t_4) {
+        __pyx_t_16 = __pyx_v_i;
+        __pyx_t_17 = __pyx_v_j;
+        __pyx_t_18 = __pyx_v_k;
+        __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_f.diminfo[2].strides))) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":202
  *             for k in range(nz):
@@ -3498,9 +3655,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_extend.pyx":211
  *                     kkmax = k + wkz + 1
@@ -3509,9 +3666,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                             for kk in range(kkmin, kkmax):
  *                                 iii = int_min(int_max(ii, 0), nx - 1)
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_extend.pyx":212
  *                     for ii in range(iimin, iimax):
@@ -3520,9 +3677,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                 iii = int_min(int_max(ii, 0), nx - 1)
  *                                 jjj = int_min(int_max(jj, 0), ny - 1)
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_extend.pyx":213
  *                         for jj in range(jjmin, jjmax):
@@ -3558,10 +3715,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                 if not npy_isnan(val):
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  */
-                __pyx_t_27 = __pyx_v_iii;
-                __pyx_t_28 = __pyx_v_jjj;
-                __pyx_t_29 = __pyx_v_kkk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_f.diminfo[2].strides));
+                __pyx_t_25 = __pyx_v_iii;
+                __pyx_t_26 = __pyx_v_jjj;
+                __pyx_t_27 = __pyx_v_kkk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_extend.pyx":217
  *                                 kkk = int_min(int_max(kk, 0), nz - 1)
@@ -3570,20 +3727,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  *                                             <unsigned int>(wky + jj - j),
  */
-                __pyx_t_4 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_4) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
-                  /* "astropy/convolution/boundary_extend.pyx":220
- *                                     ker = g[<unsigned int>(wkx + ii - i),
+                  /* "astropy/convolution/boundary_extend.pyx":218
+ *                                 val = f[iii, jjj, kkk]
+ *                                 if not npy_isnan(val):
+ *                                     ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                             <unsigned int>(wky + jj - j),
- *                                             <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                     top += val * ker
- *                                     bot += ker
+ *                                             <unsigned int>(wkz + kk - k)]
  */
-                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                  __pyx_t_31 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                  __pyx_t_32 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_g.diminfo[2].strides));
+                  __pyx_t_28 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                  __pyx_t_29 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_g.diminfo[2].strides));
 
                   /* "astropy/convolution/boundary_extend.pyx":221
  *                                             <unsigned int>(wky + jj - j),
@@ -3602,9 +3759,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                     if bot != 0.:
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L17;
+                  goto __pyx_L22;
                 }
-                __pyx_L17:;
+                __pyx_L22:;
               }
             }
           }
@@ -3616,8 +3773,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         fixed[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_4 = (__pyx_v_bot != 0.);
-          if (__pyx_t_4) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_extend.pyx":225
  * 
@@ -3627,14 +3784,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         fixed[i, j, k] = f[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_33 = __pyx_v_i;
-            __pyx_t_34 = __pyx_v_j;
-            __pyx_t_35 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L18;
+            __pyx_t_31 = __pyx_v_i;
+            __pyx_t_32 = __pyx_v_j;
+            __pyx_t_33 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L23;
           }
           /*else*/ {
 
@@ -3645,16 +3808,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                 else:
  *                     fixed[i, j, k] = f[i, j, k]
  */
-            __pyx_t_36 = __pyx_v_i;
-            __pyx_t_37 = __pyx_v_j;
-            __pyx_t_38 = __pyx_v_k;
-            __pyx_t_39 = __pyx_v_i;
-            __pyx_t_40 = __pyx_v_j;
-            __pyx_t_41 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_f.diminfo[0].strides, __pyx [...]
+            __pyx_t_34 = __pyx_v_i;
+            __pyx_t_35 = __pyx_v_j;
+            __pyx_t_36 = __pyx_v_k;
+            __pyx_t_37 = __pyx_v_i;
+            __pyx_t_38 = __pyx_v_j;
+            __pyx_t_39 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_f.diminfo[0].strides, __pyx [...]
           }
-          __pyx_L18:;
-          goto __pyx_L10;
+          __pyx_L23:;
+          goto __pyx_L15;
         }
         /*else*/ {
 
@@ -3665,15 +3828,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  * 
  *     # Now run the proper convolution
  */
-          __pyx_t_42 = __pyx_v_i;
-          __pyx_t_43 = __pyx_v_j;
-          __pyx_t_44 = __pyx_v_k;
-          __pyx_t_45 = __pyx_v_i;
-          __pyx_t_46 = __pyx_v_j;
-          __pyx_t_47 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t [...]
+          __pyx_t_40 = __pyx_v_i;
+          __pyx_t_41 = __pyx_v_j;
+          __pyx_t_42 = __pyx_v_k;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          __pyx_t_45 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t [...]
         }
-        __pyx_L10:;
+        __pyx_L15:;
       }
     }
   }
@@ -3685,9 +3848,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_extend.pyx":233
  *     # Now run the proper convolution
@@ -3696,9 +3859,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *             for k in range(nz):
  *                 if not npy_isnan(fixed[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_extend.pyx":234
  *     for i in range(nx):
@@ -3707,9 +3870,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                 if not npy_isnan(fixed[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_extend.pyx":235
  *         for j in range(ny):
@@ -3718,11 +3881,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_48 = __pyx_v_i;
-        __pyx_t_49 = __pyx_v_j;
-        __pyx_t_50 = __pyx_v_k;
-        __pyx_t_4 = (!npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[2].strides))));
-        if (__pyx_t_4) {
+        __pyx_t_46 = __pyx_v_i;
+        __pyx_t_47 = __pyx_v_j;
+        __pyx_t_48 = __pyx_v_k;
+        __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[2].strides))) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_extend.pyx":236
  *             for k in range(nz):
@@ -3803,9 +3966,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_extend.pyx":245
  *                     kkmax = k + wkz + 1
@@ -3814,9 +3977,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                             for kk in range(kkmin, kkmax):
  *                                 iii = int_min(int_max(ii, 0), nx - 1)
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_extend.pyx":246
  *                     for ii in range(iimin, iimax):
@@ -3825,9 +3988,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                 iii = int_min(int_max(ii, 0), nx - 1)
  *                                 jjj = int_min(int_max(jj, 0), ny - 1)
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_extend.pyx":247
  *                         for jj in range(jjmin, jjmax):
@@ -3863,22 +4026,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  *                                         <unsigned int>(wky + jj - j),
  */
-                __pyx_t_51 = __pyx_v_iii;
-                __pyx_t_52 = __pyx_v_jjj;
-                __pyx_t_53 = __pyx_v_kkk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_fixed.diminfo[2].strides));
+                __pyx_t_49 = __pyx_v_iii;
+                __pyx_t_50 = __pyx_v_jjj;
+                __pyx_t_51 = __pyx_v_kkk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[2].strides));
 
-                /* "astropy/convolution/boundary_extend.pyx":253
- *                                 ker = g[<unsigned int>(wkx + ii - i),
+                /* "astropy/convolution/boundary_extend.pyx":251
+ *                                 kkk = int_min(int_max(kk, 0), nz - 1)
+ *                                 val = fixed[iii, jjj, kkk]
+ *                                 ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                         <unsigned int>(wky + jj - j),
- *                                         <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                 if not npy_isnan(val):
- *                                     top += val * ker
+ *                                         <unsigned int>(wkz + kk - k)]
  */
-                __pyx_t_54 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                __pyx_t_55 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                __pyx_t_56 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_g.diminfo[2].strides));
+                __pyx_t_52 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                __pyx_t_53 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                __pyx_t_54 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_g.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_extend.pyx":254
  *                                         <unsigned int>(wky + jj - j),
@@ -3887,8 +4050,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                                     top += val * ker
  *                                     bot += ker
  */
-                __pyx_t_4 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_4) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_extend.pyx":255
  *                                         <unsigned int>(wkz + kk - k)]
@@ -3907,9 +4070,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         conv[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L32;
+                  goto __pyx_L37;
                 }
-                __pyx_L32:;
+                __pyx_L37:;
               }
             }
           }
@@ -3921,8 +4084,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         conv[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_4 = (__pyx_v_bot != 0.0);
-          if (__pyx_t_4) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_extend.pyx":258
  *                                     bot += ker
@@ -3932,14 +4095,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                         conv[i, j, k] = fixed[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_57 = __pyx_v_i;
-            __pyx_t_58 = __pyx_v_j;
-            __pyx_t_59 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L33;
+            __pyx_t_55 = __pyx_v_i;
+            __pyx_t_56 = __pyx_v_j;
+            __pyx_t_57 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L38;
           }
           /*else*/ {
 
@@ -3950,16 +4119,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  *                 else:
  *                     conv[i, j, k] = fixed[i, j, k]
  */
-            __pyx_t_60 = __pyx_v_i;
-            __pyx_t_61 = __pyx_v_j;
-            __pyx_t_62 = __pyx_v_k;
-            __pyx_t_63 = __pyx_v_i;
-            __pyx_t_64 = __pyx_v_j;
-            __pyx_t_65 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_fixed.diminfo[0].strides, _ [...]
+            __pyx_t_58 = __pyx_v_i;
+            __pyx_t_59 = __pyx_v_j;
+            __pyx_t_60 = __pyx_v_k;
+            __pyx_t_61 = __pyx_v_i;
+            __pyx_t_62 = __pyx_v_j;
+            __pyx_t_63 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_fixed.diminfo[0].strides, _ [...]
           }
-          __pyx_L33:;
-          goto __pyx_L25;
+          __pyx_L38:;
+          goto __pyx_L30;
         }
         /*else*/ {
 
@@ -3970,15 +4139,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
  * 
  *     return conv
  */
-          __pyx_t_66 = __pyx_v_i;
-          __pyx_t_67 = __pyx_v_j;
-          __pyx_t_68 = __pyx_v_k;
-          __pyx_t_69 = __pyx_v_i;
-          __pyx_t_70 = __pyx_v_j;
-          __pyx_t_71 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_71, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_fixed.diminfo[0].strides, __p [...]
+          __pyx_t_64 = __pyx_v_i;
+          __pyx_t_65 = __pyx_v_j;
+          __pyx_t_66 = __pyx_v_k;
+          __pyx_t_67 = __pyx_v_i;
+          __pyx_t_68 = __pyx_v_j;
+          __pyx_t_69 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_15boundary_extend_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_fixed.diminfo[0].strides, __p [...]
         }
-        __pyx_L25:;
+        __pyx_L30:;
       }
     }
   }
@@ -3993,14 +4162,21 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_extend.pyx":170
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_extend(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                                np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -4024,6 +4200,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_15boundary_extend_4convolve3d_b
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -4031,18 +4215,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -4058,13 +4236,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4074,22 +4250,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -4098,7 +4272,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -4107,7 +4281,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -4116,17 +4290,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -4138,7 +4312,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -4149,87 +4323,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -4238,7 +4412,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -4247,16 +4421,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -4265,7 +4440,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -4274,18 +4449,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -4294,7 +4469,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -4303,11 +4478,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -4316,7 +4491,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -4325,9 +4500,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -4336,7 +4511,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -4345,16 +4520,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -4363,19 +4538,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -4384,23 +4559,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -4412,11 +4589,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -4429,328 +4606,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -4759,7 +4912,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -4768,11 +4921,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -4781,7 +4933,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -4790,7 +4942,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -4799,17 +4951,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -4818,13 +4970,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -4843,39 +5003,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -4887,17 +5049,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -4909,10 +5071,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -4929,7 +5100,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -4943,8 +5114,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4955,7 +5133,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -4972,7 +5150,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -4986,8 +5164,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4998,7 +5183,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -5015,7 +5200,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -5029,8 +5214,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5041,7 +5233,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -5058,7 +5250,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -5072,8 +5264,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5084,7 +5283,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -5101,7 +5300,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -5115,8 +5314,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5127,7 +5333,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -5149,20 +5355,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -5171,7 +5374,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -5180,18 +5383,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -5199,33 +5402,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -5247,129 +5448,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
     } else {
-      __pyx_t_8 = __pyx_t_7;
     }
-    if (!__pyx_t_8) {
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
+    } else {
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -5377,15 +5548,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -5394,7 +5565,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5403,413 +5574,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5817,25 +5985,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -5845,13 +6021,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -5864,7 +6046,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -5876,9 +6058,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -5886,9 +6069,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -5900,7 +6084,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -5909,7 +6093,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -5920,7 +6104,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -5929,7 +6113,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -5938,10 +6122,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -5955,17 +6148,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -5976,11 +6169,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -5990,9 +6182,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -6010,7 +6209,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("boundary_extend"),
+    "boundary_extend",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -6022,67 +6221,68 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
-  {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
-  {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
-  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
-  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
-  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
-  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
-  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
-  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
-  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
-  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
-  {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bot, __pyx_k__bot, sizeof(__pyx_k__bot), 0, 0, 1, 1},
-  {&__pyx_n_s__conv, __pyx_k__conv, sizeof(__pyx_k__conv), 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__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
-  {&__pyx_n_s__fixed, __pyx_k__fixed, sizeof(__pyx_k__fixed), 0, 0, 1, 1},
-  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
-  {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 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__iii, __pyx_k__iii, sizeof(__pyx_k__iii), 0, 0, 1, 1},
-  {&__pyx_n_s__iimax, __pyx_k__iimax, sizeof(__pyx_k__iimax), 0, 0, 1, 1},
-  {&__pyx_n_s__iimin, __pyx_k__iimin, sizeof(__pyx_k__iimin), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__jj, __pyx_k__jj, sizeof(__pyx_k__jj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjj, __pyx_k__jjj, sizeof(__pyx_k__jjj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmax, __pyx_k__jjmax, sizeof(__pyx_k__jjmax), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmin, __pyx_k__jjmin, sizeof(__pyx_k__jjmin), 0, 0, 1, 1},
-  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
-  {&__pyx_n_s__ker, __pyx_k__ker, sizeof(__pyx_k__ker), 0, 0, 1, 1},
-  {&__pyx_n_s__kk, __pyx_k__kk, sizeof(__pyx_k__kk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkk, __pyx_k__kkk, sizeof(__pyx_k__kkk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmax, __pyx_k__kkmax, sizeof(__pyx_k__kkmax), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmin, __pyx_k__kkmin, sizeof(__pyx_k__kkmin), 0, 0, 1, 1},
-  {&__pyx_n_s__nkx, __pyx_k__nkx, sizeof(__pyx_k__nkx), 0, 0, 1, 1},
-  {&__pyx_n_s__nky, __pyx_k__nky, sizeof(__pyx_k__nky), 0, 0, 1, 1},
-  {&__pyx_n_s__nkz, __pyx_k__nkz, sizeof(__pyx_k__nkz), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__nx, __pyx_k__nx, sizeof(__pyx_k__nx), 0, 0, 1, 1},
-  {&__pyx_n_s__ny, __pyx_k__ny, sizeof(__pyx_k__ny), 0, 0, 1, 1},
-  {&__pyx_n_s__nz, __pyx_k__nz, sizeof(__pyx_k__nz), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1},
-  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
-  {&__pyx_n_s__wkx, __pyx_k__wkx, sizeof(__pyx_k__wkx), 0, 0, 1, 1},
-  {&__pyx_n_s__wky, __pyx_k__wky, sizeof(__pyx_k__wky), 0, 0, 1, 1},
-  {&__pyx_n_s__wkz, __pyx_k__wkz, sizeof(__pyx_k__wkz), 0, 0, 1, 1},
+  {&__pyx_kp_s_Convolution_kernel_must_have_odd, __pyx_k_Convolution_kernel_must_have_odd, sizeof(__pyx_k_Convolution_kernel_must_have_odd), 0, 0, 1, 0},
+  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s_astropy_convolution_boundary_ext, __pyx_k_astropy_convolution_boundary_ext, sizeof(__pyx_k_astropy_convolution_boundary_ext), 0, 0, 1, 1},
+  {&__pyx_n_s_bot, __pyx_k_bot, sizeof(__pyx_k_bot), 0, 0, 1, 1},
+  {&__pyx_n_s_conv, __pyx_k_conv, sizeof(__pyx_k_conv), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve1d_boundary_extend, __pyx_k_convolve1d_boundary_extend, sizeof(__pyx_k_convolve1d_boundary_extend), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve2d_boundary_extend, __pyx_k_convolve2d_boundary_extend, sizeof(__pyx_k_convolve2d_boundary_extend), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve3d_boundary_extend, __pyx_k_convolve3d_boundary_extend, sizeof(__pyx_k_convolve3d_boundary_extend), 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_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
+  {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
+  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
+  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 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_iii, __pyx_k_iii, sizeof(__pyx_k_iii), 0, 0, 1, 1},
+  {&__pyx_n_s_iimax, __pyx_k_iimax, sizeof(__pyx_k_iimax), 0, 0, 1, 1},
+  {&__pyx_n_s_iimin, __pyx_k_iimin, sizeof(__pyx_k_iimin), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjj, __pyx_k_jjj, sizeof(__pyx_k_jjj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmax, __pyx_k_jjmax, sizeof(__pyx_k_jjmax), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmin, __pyx_k_jjmin, sizeof(__pyx_k_jjmin), 0, 0, 1, 1},
+  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+  {&__pyx_n_s_ker, __pyx_k_ker, sizeof(__pyx_k_ker), 0, 0, 1, 1},
+  {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkk, __pyx_k_kkk, sizeof(__pyx_k_kkk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmax, __pyx_k_kkmax, sizeof(__pyx_k_kkmax), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmin, __pyx_k_kkmin, sizeof(__pyx_k_kkmin), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_nkx, __pyx_k_nkx, sizeof(__pyx_k_nkx), 0, 0, 1, 1},
+  {&__pyx_n_s_nky, __pyx_k_nky, sizeof(__pyx_k_nky), 0, 0, 1, 1},
+  {&__pyx_n_s_nkz, __pyx_k_nkz, sizeof(__pyx_k_nkz), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
+  {&__pyx_n_s_ny, __pyx_k_ny, sizeof(__pyx_k_ny), 0, 0, 1, 1},
+  {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
+  {&__pyx_n_s_wkx, __pyx_k_wkx, sizeof(__pyx_k_wkx), 0, 0, 1, 1},
+  {&__pyx_n_s_wky, __pyx_k_wky, sizeof(__pyx_k_wky), 0, 0, 1, 1},
+  {&__pyx_n_s_wkz, __pyx_k_wkz, sizeof(__pyx_k_wkz), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6099,9 +6299,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_2);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
   /* "astropy/convolution/boundary_extend.pyx":91
  * 
@@ -6110,9 +6310,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_3);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
   /* "astropy/convolution/boundary_extend.pyx":174
  * 
@@ -6121,75 +6321,75 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_6);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_8);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_14);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_16);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
   /* "astropy/convolution/boundary_extend.pyx":19
  * 
@@ -6198,10 +6398,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                                np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_k_tuple_17 = PyTuple_Pack(16, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__iimin), ((PyObject *)__pyx_n_s__iimax), ((PyObject *)__pyx_n_s__top), ((PyObject *)__pyx_n_s__bot), ((PyObject *)__pyx_n_s__ker), ((PyO [...]
-  __Pyx_GOTREF(__pyx_k_tuple_17);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-  __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_19, 19, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(16, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_nkx, __pyx_n_s_wkx, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_iii, __pyx_n_s_ii, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve1d_boundary_extend, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_extend.pyx":87
  * 
@@ -6210,10 +6410,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                                np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_k_tuple_22 = PyTuple_Pack(24, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__jjj), ((PyObject *)__pyx_n_s__ii), ((PyObject * [...]
-  __Pyx_GOTREF(__pyx_k_tuple_22);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
-  __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(2, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_24, 87, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(24, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno  [...]
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve2d_boundary_extend, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_extend.pyx":170
  * 
@@ -6222,10 +6422,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                                np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_k_tuple_25 = PyTuple_Pack(32, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nz), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__nkz), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__wkz), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject * [...]
-  __Pyx_GOTREF(__pyx_k_tuple_25);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-  __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(2, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_27, 170, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__14 = PyTuple_Pack(32, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_nkz, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_wkz, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_kkk, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_kkmin, __pyx_n_s_kkmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_ [...]
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve3d_boundary_extend, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -6235,7 +6435,6 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6251,6 +6450,9 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -6283,11 +6485,26 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("boundary_extend"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("boundary_extend", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__convolution__boundary_extend) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -6296,16 +6513,6 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__convolution__boundary_extend) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -6338,9 +6545,9 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  * cimport numpy as np
  * 
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":6
@@ -6350,12 +6557,12 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  * ctypedef np.float_t DTYPE_t
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":19
@@ -6365,9 +6572,9 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  *                                np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_1convolve1d_boundary_extend, NULL, __pyx_n_s_astropy_convolution_boundary_ext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve1d_boundary_extend, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":87
@@ -6377,9 +6584,9 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  *                                np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_3convolve2d_boundary_extend, NULL, __pyx_n_s_astropy_convolution_boundary_ext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_24, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve2d_boundary_extend, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":170
@@ -6389,9 +6596,9 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  *                                np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_15boundary_extend_5convolve3d_boundary_extend, NULL, __pyx_n_s_astropy_convolution_boundary_ext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_27, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve3d_boundary_extend, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_extend.pyx":1
@@ -6400,23 +6607,28 @@ PyMODINIT_FUNC PyInit_boundary_extend(void)
  * import numpy as np
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.convolution.boundary_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.convolution.boundary_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.convolution.boundary_extend");
@@ -6445,19 +6657,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -6482,7 +6692,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -6586,12 +6796,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -6601,23 +6811,29 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -6669,7 +6885,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -6914,7 +7130,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -6922,7 +7138,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -6931,7 +7147,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -6961,8 +7177,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -7002,10 +7220,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -7030,7 +7248,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -7042,7 +7260,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -7055,12 +7273,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -7081,21 +7299,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -7170,6 +7392,25 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
     return r;
 }
 
+#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
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -7219,11 +7460,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -7238,26 +7475,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -7267,7 +7491,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -7288,46 +7512,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -7337,6 +7577,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -7344,6 +7591,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -7351,6 +7599,23 @@ bad:
 }
 #endif
 
+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;
+}
+
 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
@@ -7360,7 +7625,7 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -7377,7 +7642,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -7385,133 +7650,195 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-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;
+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) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    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;
     }
-    return 0;
-#endif
+    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);
 }
 
-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();
+#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
     }
-    return 0;
+    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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
-    PyErr_WriteUnraisable(obj);
-nofail:
     Py_DECREF(obj);
     view->obj = NULL;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
+#endif
 
 
-    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+      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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -7529,7 +7856,6 @@ nofail:
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -7551,7 +7877,7 @@ nofail:
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -7568,14 +7894,6 @@ nofail:
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -7585,6 +7903,243 @@ bad:
     return module;
 }
 
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
+    }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (unsigned int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(unsigned int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, 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
+            unsigned int val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (unsigned int) -1;
+        }
+    } else {
+        unsigned int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned int) -1;
+        val = __Pyx_PyInt_As_unsigned_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to unsigned int");
+    return (unsigned int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to unsigned int");
+    return (unsigned int) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, 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_Int(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_Int(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;
+}
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
@@ -7813,416 +8368,137 @@ bad:
                 theta = 0;
             } else {
                 r = __Pyx_c_abs(a);
-                theta = atan2(a.imag, a.real);
-            }
-            lnr = log(r);
-            z_r = exp(lnr * b.real - theta * b.imag);
-            z_theta = theta * b.real + lnr * b.imag;
-            z.real = z_r * cos(z_theta);
-            z.imag = z_r * sin(z_theta);
-            return z;
-        }
-    #endif
-#endif
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+                theta = atan2(a.imag, a.real);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
+            lnr = log(r);
+            z_r = exp(lnr * b.real - theta * b.imag);
+            z_theta = theta * b.real + lnr * b.imag;
+            z.real = z_r * cos(z_theta);
+            z.imag = z_r * sin(z_theta);
+            return z;
         }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
+    #endif
+#endif
 
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
-            }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
+    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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
     } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
     }
 }
 
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
+        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;
         }
-        return (signed long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
-        }
-        return (signed PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, 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_Int(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 {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        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;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -8235,11 +8511,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -8289,7 +8561,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -8309,15 +8581,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -8329,168 +8597,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -8501,7 +8607,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -8521,6 +8627,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -8530,14 +8701,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -8553,13 +8724,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -8573,35 +8744,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/convolution/boundary_fill.c b/astropy/convolution/boundary_fill.c
index cc933e6..22144bb 100644
--- a/astropy/convolution/boundary_fill.c
+++ b/astropy/convolution/boundary_fill.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -265,17 +247,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -289,40 +260,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -354,20 +442,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "boundary_fill.pyx",
-  "numpy.pxd",
+  "astropy/convolution/boundary_fill.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -394,7 +482,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -403,7 +491,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -412,7 +500,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -421,7 +509,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -430,7 +518,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -439,7 +527,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -448,7 +536,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -457,7 +545,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -466,7 +554,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -475,7 +563,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -484,7 +572,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -493,7 +581,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -502,7 +590,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -511,7 +599,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -520,7 +608,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -529,7 +617,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -538,7 +626,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -547,7 +635,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -556,7 +644,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -565,7 +653,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -574,7 +662,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -614,7 +702,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_fill_DT
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -623,7 +711,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_fill_DT
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -632,7 +720,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -641,7 +729,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -662,7 +750,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -699,23 +787,46 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
@@ -723,16 +834,28 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+#ifndef __PYX_FORCE_INIT_THREADS
+  #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -741,9 +864,22 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -770,7 +906,13 @@ typedef struct {
 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -784,7 +926,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -870,37 +1012,9 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -912,28 +1026,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+static PyObject *__Pyx_ImportModule(const char *name);
 
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -979,161 +1076,173 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_boundary_fill(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g, float __pyx_v_fill_value); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "Convolution kernel must have odd dimensions";
-static char __pyx_k_5[] = "ndarray is not C contiguous";
-static char __pyx_k_7[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_9[] = "Non-native byte order not supported";
-static char __pyx_k_11[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_12[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_15[] = "Format string allocated too short.";
-static char __pyx_k_19[] = "convolve1d_boundary_fill";
-static char __pyx_k_20[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_fill.pyx";
-static char __pyx_k_21[] = "astropy.convolution.boundary_fill";
-static char __pyx_k_24[] = "convolve2d_boundary_fill";
-static char __pyx_k_27[] = "convolve3d_boundary_fill";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__ii[] = "ii";
-static char __pyx_k__jj[] = "jj";
-static char __pyx_k__kk[] = "kk";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__nx[] = "nx";
-static char __pyx_k__ny[] = "ny";
-static char __pyx_k__nz[] = "nz";
-static char __pyx_k__bot[] = "bot";
-static char __pyx_k__iii[] = "iii";
-static char __pyx_k__jjj[] = "jjj";
-static char __pyx_k__ker[] = "ker";
-static char __pyx_k__kkk[] = "kkk";
-static char __pyx_k__nkx[] = "nkx";
-static char __pyx_k__nky[] = "nky";
-static char __pyx_k__nkz[] = "nkz";
-static char __pyx_k__top[] = "top";
-static char __pyx_k__val[] = "val";
-static char __pyx_k__wkx[] = "wkx";
-static char __pyx_k__wky[] = "wky";
-static char __pyx_k__wkz[] = "wkz";
-static char __pyx_k__conv[] = "conv";
-static char __pyx_k__DTYPE[] = "DTYPE";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__fixed[] = "fixed";
-static char __pyx_k__float[] = "float";
-static char __pyx_k__iimax[] = "iimax";
-static char __pyx_k__iimin[] = "iimin";
-static char __pyx_k__jjmax[] = "jjmax";
-static char __pyx_k__jjmin[] = "jjmin";
-static char __pyx_k__kkmax[] = "kkmax";
-static char __pyx_k__kkmin[] = "kkmin";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__fill_value[] = "fill_value";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_n_s_19;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_n_s_21;
-static PyObject *__pyx_n_s_24;
-static PyObject *__pyx_n_s_27;
-static PyObject *__pyx_kp_u_5;
-static PyObject *__pyx_kp_u_7;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__DTYPE;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bot;
-static PyObject *__pyx_n_s__conv;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__f;
-static PyObject *__pyx_n_s__fill_value;
-static PyObject *__pyx_n_s__fixed;
-static PyObject *__pyx_n_s__float;
-static PyObject *__pyx_n_s__g;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__ii;
-static PyObject *__pyx_n_s__iii;
-static PyObject *__pyx_n_s__iimax;
-static PyObject *__pyx_n_s__iimin;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__jj;
-static PyObject *__pyx_n_s__jjj;
-static PyObject *__pyx_n_s__jjmax;
-static PyObject *__pyx_n_s__jjmin;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__ker;
-static PyObject *__pyx_n_s__kk;
-static PyObject *__pyx_n_s__kkk;
-static PyObject *__pyx_n_s__kkmax;
-static PyObject *__pyx_n_s__kkmin;
-static PyObject *__pyx_n_s__nkx;
-static PyObject *__pyx_n_s__nky;
-static PyObject *__pyx_n_s__nkz;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__nx;
-static PyObject *__pyx_n_s__ny;
-static PyObject *__pyx_n_s__nz;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__top;
-static PyObject *__pyx_n_s__val;
-static PyObject *__pyx_n_s__wkx;
-static PyObject *__pyx_n_s__wky;
-static PyObject *__pyx_n_s__wkz;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_codeobj_18;
-static PyObject *__pyx_k_codeobj_23;
-static PyObject *__pyx_k_codeobj_26;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_ii[] = "ii";
+static char __pyx_k_jj[] = "jj";
+static char __pyx_k_kk[] = "kk";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_nx[] = "nx";
+static char __pyx_k_ny[] = "ny";
+static char __pyx_k_nz[] = "nz";
+static char __pyx_k_bot[] = "bot";
+static char __pyx_k_iii[] = "iii";
+static char __pyx_k_jjj[] = "jjj";
+static char __pyx_k_ker[] = "ker";
+static char __pyx_k_kkk[] = "kkk";
+static char __pyx_k_nkx[] = "nkx";
+static char __pyx_k_nky[] = "nky";
+static char __pyx_k_nkz[] = "nkz";
+static char __pyx_k_top[] = "top";
+static char __pyx_k_val[] = "val";
+static char __pyx_k_wkx[] = "wkx";
+static char __pyx_k_wky[] = "wky";
+static char __pyx_k_wkz[] = "wkz";
+static char __pyx_k_conv[] = "conv";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_DTYPE[] = "DTYPE";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_fixed[] = "fixed";
+static char __pyx_k_float[] = "float";
+static char __pyx_k_iimax[] = "iimax";
+static char __pyx_k_iimin[] = "iimin";
+static char __pyx_k_jjmax[] = "jjmax";
+static char __pyx_k_jjmin[] = "jjmin";
+static char __pyx_k_kkmax[] = "kkmax";
+static char __pyx_k_kkmin[] = "kkmin";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_fill_value[] = "fill_value";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_convolve1d_boundary_fill[] = "convolve1d_boundary_fill";
+static char __pyx_k_convolve2d_boundary_fill[] = "convolve2d_boundary_fill";
+static char __pyx_k_convolve3d_boundary_fill[] = "convolve3d_boundary_fill";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_fill.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Convolution_kernel_must_have_odd[] = "Convolution kernel must have odd dimensions";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_astropy_convolution_boundary_fil[] = "astropy.convolution.boundary_fill";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_Convolution_kernel_must_have_odd;
+static PyObject *__pyx_n_s_DTYPE;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_astropy_convolution_boundary_fil;
+static PyObject *__pyx_n_s_bot;
+static PyObject *__pyx_n_s_conv;
+static PyObject *__pyx_n_s_convolve1d_boundary_fill;
+static PyObject *__pyx_n_s_convolve2d_boundary_fill;
+static PyObject *__pyx_n_s_convolve3d_boundary_fill;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_fill_value;
+static PyObject *__pyx_n_s_fixed;
+static PyObject *__pyx_n_s_float;
+static PyObject *__pyx_n_s_g;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_ii;
+static PyObject *__pyx_n_s_iii;
+static PyObject *__pyx_n_s_iimax;
+static PyObject *__pyx_n_s_iimin;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_jj;
+static PyObject *__pyx_n_s_jjj;
+static PyObject *__pyx_n_s_jjmax;
+static PyObject *__pyx_n_s_jjmin;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_ker;
+static PyObject *__pyx_n_s_kk;
+static PyObject *__pyx_n_s_kkk;
+static PyObject *__pyx_n_s_kkmax;
+static PyObject *__pyx_n_s_kkmin;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_nkx;
+static PyObject *__pyx_n_s_nky;
+static PyObject *__pyx_n_s_nkz;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_nx;
+static PyObject *__pyx_n_s_ny;
+static PyObject *__pyx_n_s_nz;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_top;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_wkx;
+static PyObject *__pyx_n_s_wky;
+static PyObject *__pyx_n_s_wkz;
+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_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
+
+/* "astropy/convolution/boundary_fill.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_fill(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g,
+ *                              float fill_value):
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill = {__Pyx_NAMESTR("convolve1d_boundary_fill"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill = {"convolve1d_boundary_fill", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
   float __pyx_v_fill_value;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve1d_boundary_fill (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,&__pyx_n_s__fill_value,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,&__pyx_n_s_fill_value,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1148,15 +1257,15 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve1d_boundary_fill", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve1d_boundary_fill", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1186,6 +1295,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boundary_fill(__pyx_self, __pyx_v_f, __pyx_v_g, __pyx_v_fill_value);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1194,14 +1305,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_1convolve1d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_fill.pyx":16
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve1d_boundary_fill(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=1] g,
- *                              float fill_value):
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boundary_fill(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g, float __pyx_v_fill_value) {
   int __pyx_v_nx;
   int __pyx_v_nkx;
@@ -1231,30 +1334,29 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
   unsigned int __pyx_t_11;
-  unsigned int __pyx_t_12;
+  int __pyx_t_12;
   int __pyx_t_13;
   int __pyx_t_14;
-  int __pyx_t_15;
+  unsigned int __pyx_t_15;
   unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
   unsigned int __pyx_t_19;
   unsigned int __pyx_t_20;
   unsigned int __pyx_t_21;
-  unsigned int __pyx_t_22;
-  int __pyx_t_23;
+  int __pyx_t_22;
+  unsigned int __pyx_t_23;
   unsigned int __pyx_t_24;
   unsigned int __pyx_t_25;
   unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
-  unsigned int __pyx_t_29;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1293,7 +1395,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
+  __pyx_t_1 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
   if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_fill.pyx":21
@@ -1303,14 +1405,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_fill.pyx":23
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -1320,32 +1420,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_1) {
-    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_5) {
+    } else {
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L4_bool_binop_done;
+    }
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __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_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_1;
-  }
-  if (unlikely(!__pyx_t_6)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L4_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -1383,12 +1487,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *     cdef np.ndarray[DTYPE_t, ndim=1] conv = np.empty([nx], dtype=DTYPE)
  *     cdef unsigned int i, iii
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -1397,33 +1501,33 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
   __pyx_t_2 = 0;
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
   __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":29
  *     cdef int wkx = nkx // 2
@@ -1432,45 +1536,45 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *     cdef unsigned int i, iii
  *     cdef int ii
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
   __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
@@ -1481,9 +1585,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *         if npy_isnan(f[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_fill.pyx":40
  *     # neighboring values
@@ -1492,9 +1596,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_12 = __pyx_v_i;
-    __pyx_t_6 = npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_f.diminfo[0].strides)));
-    if (__pyx_t_6) {
+    __pyx_t_11 = __pyx_v_i;
+    __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_f.diminfo[0].strides))) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_fill.pyx":41
  *     for i in range(nx):
@@ -1539,9 +1643,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 if ii < 0 or ii > nx - 1:
  *                     val = fill_value
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_fill.pyx":46
  *             iimax = i + wkx + 1
@@ -1550,14 +1654,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     val = fill_value
  *                 else:
  */
-        __pyx_t_6 = (__pyx_v_ii < 0);
-        if (!__pyx_t_6) {
-          __pyx_t_1 = (__pyx_v_ii > (__pyx_v_nx - 1));
-          __pyx_t_5 = __pyx_t_1;
+        __pyx_t_5 = ((__pyx_v_ii < 0) != 0);
+        if (!__pyx_t_5) {
         } else {
-          __pyx_t_5 = __pyx_t_6;
+          __pyx_t_1 = __pyx_t_5;
+          goto __pyx_L12_bool_binop_done;
         }
-        if (__pyx_t_5) {
+        __pyx_t_5 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
+        __pyx_t_1 = __pyx_t_5;
+        __pyx_L12_bool_binop_done:;
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":47
  *             for ii in range(iimin, iimax):
@@ -1567,7 +1673,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     val = f[ii]
  */
           __pyx_v_val = __pyx_v_fill_value;
-          goto __pyx_L9;
+          goto __pyx_L11;
         }
         /*else*/ {
 
@@ -1578,11 +1684,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  */
-          __pyx_t_15 = __pyx_v_ii;
-          if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_f.diminfo[0].shape;
-          __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f.diminfo[0].strides));
+          __pyx_t_14 = __pyx_v_ii;
+          if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_f.diminfo[0].shape;
+          __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides));
         }
-        __pyx_L9:;
+        __pyx_L11:;
 
         /* "astropy/convolution/boundary_fill.pyx":50
  *                 else:
@@ -1591,8 +1697,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  *                     top += val * ker
  */
-        __pyx_t_5 = (!npy_isnan(__pyx_v_val));
-        if (__pyx_t_5) {
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":51
  *                     val = f[ii]
@@ -1601,8 +1707,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-          __pyx_t_16 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_g.diminfo[0].strides));
+          __pyx_t_15 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_g.diminfo[0].strides));
 
           /* "astropy/convolution/boundary_fill.pyx":52
  *                 if not npy_isnan(val):
@@ -1621,9 +1727,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 fixed[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L10;
+          goto __pyx_L14;
         }
-        __pyx_L10:;
+        __pyx_L14:;
       }
 
       /* "astropy/convolution/boundary_fill.pyx":54
@@ -1633,8 +1739,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 fixed[i] = top / bot
  *             else:
  */
-      __pyx_t_5 = (__pyx_v_bot != 0.);
-      if (__pyx_t_5) {
+      __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_fill.pyx":55
  *                     bot += ker
@@ -1644,12 +1750,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 fixed[i] = f[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_17 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L11;
+        __pyx_t_16 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L15;
       }
       /*else*/ {
 
@@ -1660,12 +1772,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *         else:
  *             fixed[i] = f[i]
  */
+        __pyx_t_17 = __pyx_v_i;
         __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_f.diminfo[0].strides));
       }
-      __pyx_L11:;
-      goto __pyx_L6;
+      __pyx_L15:;
+      goto __pyx_L8;
     }
     /*else*/ {
 
@@ -1676,11 +1788,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  * 
  *     # Now run the proper convolution
  */
+      __pyx_t_19 = __pyx_v_i;
       __pyx_t_20 = __pyx_v_i;
-      __pyx_t_21 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides));
     }
-    __pyx_L6:;
+    __pyx_L8:;
   }
 
   /* "astropy/convolution/boundary_fill.pyx":62
@@ -1690,9 +1802,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *         if not npy_isnan(fixed[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_fill.pyx":63
  *     # Now run the proper convolution
@@ -1701,9 +1813,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_22 = __pyx_v_i;
-    __pyx_t_5 = (!npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides))));
-    if (__pyx_t_5) {
+    __pyx_t_21 = __pyx_v_i;
+    __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides))) != 0)) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_fill.pyx":64
  *     for i in range(nx):
@@ -1748,9 +1860,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 if ii < 0 or ii > nx - 1:
  *                     val = fill_value
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_fill.pyx":69
  *             iimax = i + wkx + 1
@@ -1759,13 +1871,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     val = fill_value
  *                 else:
  */
-        __pyx_t_5 = (__pyx_v_ii < 0);
+        __pyx_t_5 = ((__pyx_v_ii < 0) != 0);
         if (!__pyx_t_5) {
-          __pyx_t_6 = (__pyx_v_ii > (__pyx_v_nx - 1));
-          __pyx_t_1 = __pyx_t_6;
         } else {
           __pyx_t_1 = __pyx_t_5;
+          goto __pyx_L22_bool_binop_done;
         }
+        __pyx_t_5 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
+        __pyx_t_1 = __pyx_t_5;
+        __pyx_L22_bool_binop_done:;
         if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":70
@@ -1776,7 +1890,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     val = fixed[ii]
  */
           __pyx_v_val = __pyx_v_fill_value;
-          goto __pyx_L17;
+          goto __pyx_L21;
         }
         /*else*/ {
 
@@ -1787,11 +1901,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  *                 if not npy_isnan(val):
  */
-          __pyx_t_23 = __pyx_v_ii;
-          if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_fixed.diminfo[0].shape;
-          __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides));
+          __pyx_t_22 = __pyx_v_ii;
+          if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_fixed.diminfo[0].shape;
+          __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides));
         }
-        __pyx_L17:;
+        __pyx_L21:;
 
         /* "astropy/convolution/boundary_fill.pyx":73
  *                 else:
@@ -1800,8 +1914,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     top += val * ker
  */
-        __pyx_t_24 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_g.diminfo[0].strides));
+        __pyx_t_23 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_g.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_fill.pyx":74
  *                     val = fixed[ii]
@@ -1810,7 +1924,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-        __pyx_t_1 = (!npy_isnan(__pyx_v_val));
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
         if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":75
@@ -1830,9 +1944,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 conv[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L18;
+          goto __pyx_L24;
         }
-        __pyx_L18:;
+        __pyx_L24:;
       }
 
       /* "astropy/convolution/boundary_fill.pyx":77
@@ -1842,7 +1956,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 conv[i] = top / bot
  *             else:
  */
-      __pyx_t_1 = (__pyx_v_bot != 0.0);
+      __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
       if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_fill.pyx":78
@@ -1853,12 +1967,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *                 conv[i] = fixed[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_25 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L19;
+        __pyx_t_24 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L25;
       }
       /*else*/ {
 
@@ -1869,12 +1989,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  *         else:
  *             conv[i] = fixed[i]
  */
+        __pyx_t_25 = __pyx_v_i;
         __pyx_t_26 = __pyx_v_i;
-        __pyx_t_27 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[0].strides));
       }
-      __pyx_L19:;
-      goto __pyx_L14;
+      __pyx_L25:;
+      goto __pyx_L18;
     }
     /*else*/ {
 
@@ -1885,11 +2005,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
  * 
  *     return conv
  */
+      __pyx_t_27 = __pyx_v_i;
       __pyx_t_28 = __pyx_v_i;
-      __pyx_t_29 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides));
     }
-    __pyx_L14:;
+    __pyx_L18:;
   }
 
   /* "astropy/convolution/boundary_fill.pyx":84
@@ -1904,13 +2024,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __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);
+  /* "astropy/convolution/boundary_fill.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_fill(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g,
+ *                              float fill_value):
+ */
+
+  /* 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_6);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -1934,18 +2061,29 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_convolve1d_boun
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_fill.pyx":88
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_fill(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g,
+ *                              float fill_value):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill = {__Pyx_NAMESTR("convolve2d_boundary_fill"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill = {"convolve2d_boundary_fill", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
   float __pyx_v_fill_value;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve2d_boundary_fill (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,&__pyx_n_s__fill_value,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,&__pyx_n_s_fill_value,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1960,15 +2098,15 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve2d_boundary_fill", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve2d_boundary_fill", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1998,6 +2136,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_boundary_fill(__pyx_self, __pyx_v_f, __pyx_v_g, __pyx_v_fill_value);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2006,14 +2146,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_3convolve2d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_fill.pyx":88
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve2d_boundary_fill(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=2] g,
- *                              float fill_value):
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_boundary_fill(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g, float __pyx_v_fill_value) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -2047,27 +2179,27 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
+  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;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  unsigned int __pyx_t_11;
-  int __pyx_t_12;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
+  int __pyx_t_11;
+  unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
-  unsigned int __pyx_t_15;
+  int __pyx_t_15;
   int __pyx_t_16;
   int __pyx_t_17;
   int __pyx_t_18;
   int __pyx_t_19;
   int __pyx_t_20;
-  int __pyx_t_21;
-  int __pyx_t_22;
-  int __pyx_t_23;
+  unsigned int __pyx_t_21;
+  unsigned int __pyx_t_22;
+  unsigned int __pyx_t_23;
   unsigned int __pyx_t_24;
   unsigned int __pyx_t_25;
   unsigned int __pyx_t_26;
@@ -2079,11 +2211,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
   unsigned int __pyx_t_32;
   unsigned int __pyx_t_33;
   unsigned int __pyx_t_34;
-  unsigned int __pyx_t_35;
-  unsigned int __pyx_t_36;
+  int __pyx_t_35;
+  int __pyx_t_36;
   unsigned int __pyx_t_37;
-  int __pyx_t_38;
-  int __pyx_t_39;
+  unsigned int __pyx_t_38;
+  unsigned int __pyx_t_39;
   unsigned int __pyx_t_40;
   unsigned int __pyx_t_41;
   unsigned int __pyx_t_42;
@@ -2093,9 +2225,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
   unsigned int __pyx_t_46;
   unsigned int __pyx_t_47;
   unsigned int __pyx_t_48;
-  unsigned int __pyx_t_49;
-  unsigned int __pyx_t_50;
-  unsigned int __pyx_t_51;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2134,14 +2263,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    __pyx_t_3 = __pyx_t_2;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_3 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_fill.pyx":93
  * 
@@ -2150,14 +2281,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_fill.pyx":95
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -2167,32 +2296,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __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_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (unlikely(!__pyx_t_2)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -2257,52 +2390,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=2] conv = np.empty([nx, ny], dtype=DTYPE)
  *     cdef unsigned int i, j, iii, jjj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_4 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":104
  *     cdef int wky = nky // 2
@@ -2311,52 +2444,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *     cdef unsigned int i, j, iii, jjj
  *     cdef int ii, jj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_4 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_9 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":114
  *     # Need a first pass to replace NaN values with value convolved from
@@ -2365,9 +2498,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *         for j in range(ny):
  *             if npy_isnan(f[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_fill.pyx":115
  *     # neighboring values
@@ -2376,9 +2509,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *             if npy_isnan(f[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_fill.pyx":116
  *     for i in range(nx):
@@ -2387,10 +2520,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_14 = __pyx_v_i;
-      __pyx_t_15 = __pyx_v_j;
-      __pyx_t_2 = npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_f.diminfo[1].strides)));
-      if (__pyx_t_2) {
+      __pyx_t_13 = __pyx_v_i;
+      __pyx_t_14 = __pyx_v_j;
+      __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_f.diminfo[1].strides))) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_fill.pyx":117
  *         for j in range(ny):
@@ -2453,9 +2586,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     for jj in range(jjmin, jjmax):
  *                         if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1:
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_fill.pyx":124
  *                 jjmax = j + wky + 1
@@ -2464,9 +2597,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                         if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1:
  *                             val = fill_value
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_fill.pyx":125
  *                 for ii in range(iimin, iimax):
@@ -2475,26 +2608,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             val = fill_value
  *                         else:
  */
-            __pyx_t_2 = (__pyx_v_ii < 0);
+            __pyx_t_2 = ((__pyx_v_ii < 0) != 0);
+            if (!__pyx_t_2) {
+            } else {
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L18_bool_binop_done;
+            }
+            __pyx_t_2 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
             if (!__pyx_t_2) {
-              __pyx_t_3 = (__pyx_v_ii > (__pyx_v_nx - 1));
-              if (!__pyx_t_3) {
-                __pyx_t_1 = (__pyx_v_jj < 0);
-                if (!__pyx_t_1) {
-                  __pyx_t_20 = (__pyx_v_jj > (__pyx_v_ny - 1));
-                  __pyx_t_21 = __pyx_t_20;
-                } else {
-                  __pyx_t_21 = __pyx_t_1;
-                }
-                __pyx_t_1 = __pyx_t_21;
-              } else {
-                __pyx_t_1 = __pyx_t_3;
-              }
-              __pyx_t_3 = __pyx_t_1;
             } else {
-              __pyx_t_3 = __pyx_t_2;
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L18_bool_binop_done;
             }
-            if (__pyx_t_3) {
+            __pyx_t_2 = ((__pyx_v_jj < 0) != 0);
+            if (!__pyx_t_2) {
+            } else {
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L18_bool_binop_done;
+            }
+            __pyx_t_2 = ((__pyx_v_jj > (__pyx_v_ny - 1)) != 0);
+            __pyx_t_1 = __pyx_t_2;
+            __pyx_L18_bool_binop_done:;
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_fill.pyx":126
  *                     for jj in range(jjmin, jjmax):
@@ -2504,7 +2639,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             val = f[ii, jj]
  */
               __pyx_v_val = __pyx_v_fill_value;
-              goto __pyx_L13;
+              goto __pyx_L17;
             }
             /*else*/ {
 
@@ -2515,13 +2650,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                         if not npy_isnan(val):
  *                             ker = g[<unsigned int>(wkx + ii - i),
  */
-              __pyx_t_22 = __pyx_v_ii;
-              __pyx_t_23 = __pyx_v_jj;
-              if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_f.diminfo[0].shape;
-              if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_f.diminfo[1].shape;
-              __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_f.diminfo[1].strides));
+              __pyx_t_19 = __pyx_v_ii;
+              __pyx_t_20 = __pyx_v_jj;
+              if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_f.diminfo[0].shape;
+              if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_f.diminfo[1].shape;
+              __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[1].strides));
             }
-            __pyx_L13:;
+            __pyx_L17:;
 
             /* "astropy/convolution/boundary_fill.pyx":129
  *                         else:
@@ -2530,19 +2665,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             ker = g[<unsigned int>(wkx + ii - i),
  *                                     <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_3 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_3) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
-              /* "astropy/convolution/boundary_fill.pyx":131
+              /* "astropy/convolution/boundary_fill.pyx":130
+ *                             val = f[ii, jj]
  *                         if not npy_isnan(val):
- *                             ker = g[<unsigned int>(wkx + ii - i),
- *                                     <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                             ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                     <unsigned int>(wky + jj - j)]
  *                             top += val * ker
- *                             bot += ker
  */
-              __pyx_t_24 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-              __pyx_t_25 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_g.diminfo[1].strides));
+              __pyx_t_21 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+              __pyx_t_22 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_g.diminfo[1].strides));
 
               /* "astropy/convolution/boundary_fill.pyx":132
  *                             ker = g[<unsigned int>(wkx + ii - i),
@@ -2561,9 +2696,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     fixed[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L14;
+              goto __pyx_L22;
             }
-            __pyx_L14:;
+            __pyx_L22:;
           }
         }
 
@@ -2574,8 +2709,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     fixed[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_3 = (__pyx_v_bot != 0.);
-        if (__pyx_t_3) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":135
  *                             bot += ker
@@ -2585,13 +2720,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     fixed[i, j] = f[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_26 = __pyx_v_i;
-          __pyx_t_27 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L15;
+          __pyx_t_23 = __pyx_v_i;
+          __pyx_t_24 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L23;
         }
         /*else*/ {
 
@@ -2602,14 +2743,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *             else:
  *                 fixed[i, j] = f[i, j]
  */
-          __pyx_t_28 = __pyx_v_i;
-          __pyx_t_29 = __pyx_v_j;
-          __pyx_t_30 = __pyx_v_i;
-          __pyx_t_31 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_f.diminfo[1].strides));
+          __pyx_t_25 = __pyx_v_i;
+          __pyx_t_26 = __pyx_v_j;
+          __pyx_t_27 = __pyx_v_i;
+          __pyx_t_28 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides));
         }
-        __pyx_L15:;
-        goto __pyx_L8;
+        __pyx_L23:;
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -2620,13 +2761,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  * 
  *     # Now run the proper convolution
  */
-        __pyx_t_32 = __pyx_v_i;
-        __pyx_t_33 = __pyx_v_j;
-        __pyx_t_34 = __pyx_v_i;
-        __pyx_t_35 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_f.diminfo[1].strides));
+        __pyx_t_29 = __pyx_v_i;
+        __pyx_t_30 = __pyx_v_j;
+        __pyx_t_31 = __pyx_v_i;
+        __pyx_t_32 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_f.diminfo[1].strides));
       }
-      __pyx_L8:;
+      __pyx_L12:;
     }
   }
 
@@ -2637,9 +2778,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *         for j in range(ny):
  *             if not npy_isnan(fixed[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_fill.pyx":143
  *     # Now run the proper convolution
@@ -2648,9 +2789,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *             if not npy_isnan(fixed[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_fill.pyx":144
  *     for i in range(nx):
@@ -2659,10 +2800,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_36 = __pyx_v_i;
-      __pyx_t_37 = __pyx_v_j;
-      __pyx_t_3 = (!npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[1].strides))));
-      if (__pyx_t_3) {
+      __pyx_t_33 = __pyx_v_i;
+      __pyx_t_34 = __pyx_v_j;
+      __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides))) != 0)) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_fill.pyx":145
  *         for j in range(ny):
@@ -2725,9 +2866,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     for jj in range(jjmin, jjmax):
  *                         if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1:
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_fill.pyx":152
  *                 jjmax = j + wky + 1
@@ -2736,9 +2877,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                         if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1:
  *                             val = fill_value
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_fill.pyx":153
  *                 for ii in range(iimin, iimax):
@@ -2747,26 +2888,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             val = fill_value
  *                         else:
  */
-            __pyx_t_3 = (__pyx_v_ii < 0);
-            if (!__pyx_t_3) {
-              __pyx_t_2 = (__pyx_v_ii > (__pyx_v_nx - 1));
-              if (!__pyx_t_2) {
-                __pyx_t_1 = (__pyx_v_jj < 0);
-                if (!__pyx_t_1) {
-                  __pyx_t_21 = (__pyx_v_jj > (__pyx_v_ny - 1));
-                  __pyx_t_20 = __pyx_t_21;
-                } else {
-                  __pyx_t_20 = __pyx_t_1;
-                }
-                __pyx_t_1 = __pyx_t_20;
-              } else {
-                __pyx_t_1 = __pyx_t_2;
-              }
-              __pyx_t_2 = __pyx_t_1;
+            __pyx_t_2 = ((__pyx_v_ii < 0) != 0);
+            if (!__pyx_t_2) {
+            } else {
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L34_bool_binop_done;
+            }
+            __pyx_t_2 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
+            if (!__pyx_t_2) {
+            } else {
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L34_bool_binop_done;
+            }
+            __pyx_t_2 = ((__pyx_v_jj < 0) != 0);
+            if (!__pyx_t_2) {
             } else {
-              __pyx_t_2 = __pyx_t_3;
+              __pyx_t_1 = __pyx_t_2;
+              goto __pyx_L34_bool_binop_done;
             }
-            if (__pyx_t_2) {
+            __pyx_t_2 = ((__pyx_v_jj > (__pyx_v_ny - 1)) != 0);
+            __pyx_t_1 = __pyx_t_2;
+            __pyx_L34_bool_binop_done:;
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_fill.pyx":154
  *                     for jj in range(jjmin, jjmax):
@@ -2776,7 +2919,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             val = fixed[ii, jj]
  */
               __pyx_v_val = __pyx_v_fill_value;
-              goto __pyx_L25;
+              goto __pyx_L33;
             }
             /*else*/ {
 
@@ -2787,24 +2930,24 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                         ker = g[<unsigned int>(wkx + ii - i),
  *                                 <unsigned int>(wky + jj - j)]
  */
-              __pyx_t_38 = __pyx_v_ii;
-              __pyx_t_39 = __pyx_v_jj;
-              if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_pybuffernd_fixed.diminfo[0].shape;
-              if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_pybuffernd_fixed.diminfo[1].shape;
-              __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[1].strides));
+              __pyx_t_35 = __pyx_v_ii;
+              __pyx_t_36 = __pyx_v_jj;
+              if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_fixed.diminfo[0].shape;
+              if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_pybuffernd_fixed.diminfo[1].shape;
+              __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[1].strides));
             }
-            __pyx_L25:;
+            __pyx_L33:;
 
-            /* "astropy/convolution/boundary_fill.pyx":158
+            /* "astropy/convolution/boundary_fill.pyx":157
+ *                         else:
  *                             val = fixed[ii, jj]
- *                         ker = g[<unsigned int>(wkx + ii - i),
- *                                 <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                         ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                 <unsigned int>(wky + jj - j)]
  *                         if not npy_isnan(val):
- *                             top += val * ker
  */
-            __pyx_t_40 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-            __pyx_t_41 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_g.diminfo[1].strides));
+            __pyx_t_37 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+            __pyx_t_38 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_g.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_fill.pyx":159
  *                         ker = g[<unsigned int>(wkx + ii - i),
@@ -2813,8 +2956,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                             top += val * ker
  *                             bot += ker
  */
-            __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_2) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_fill.pyx":160
  *                                 <unsigned int>(wky + jj - j)]
@@ -2833,9 +2976,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     conv[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L26;
+              goto __pyx_L38;
             }
-            __pyx_L26:;
+            __pyx_L38:;
           }
         }
 
@@ -2846,8 +2989,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     conv[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_2 = (__pyx_v_bot != 0.0);
-        if (__pyx_t_2) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":163
  *                             bot += ker
@@ -2857,13 +3000,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *                     conv[i, j] = fixed[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_42 = __pyx_v_i;
-          __pyx_t_43 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L27;
+          __pyx_t_39 = __pyx_v_i;
+          __pyx_t_40 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L39;
         }
         /*else*/ {
 
@@ -2874,14 +3023,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  *             else:
  *                 conv[i, j] = fixed[i, j]
  */
-          __pyx_t_44 = __pyx_v_i;
-          __pyx_t_45 = __pyx_v_j;
-          __pyx_t_46 = __pyx_v_i;
-          __pyx_t_47 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[1].strides));
+          __pyx_t_41 = __pyx_v_i;
+          __pyx_t_42 = __pyx_v_j;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[1].strides));
         }
-        __pyx_L27:;
-        goto __pyx_L20;
+        __pyx_L39:;
+        goto __pyx_L28;
       }
       /*else*/ {
 
@@ -2892,13 +3041,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
  * 
  *     return conv
  */
-        __pyx_t_48 = __pyx_v_i;
-        __pyx_t_49 = __pyx_v_j;
-        __pyx_t_50 = __pyx_v_i;
-        __pyx_t_51 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[1].strides));
+        __pyx_t_45 = __pyx_v_i;
+        __pyx_t_46 = __pyx_v_j;
+        __pyx_t_47 = __pyx_v_i;
+        __pyx_t_48 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[1].strides));
       }
-      __pyx_L20:;
+      __pyx_L28:;
     }
   }
 
@@ -2914,13 +3063,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_fill.pyx":88
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_fill(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g,
+ *                              float fill_value):
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -2944,18 +3100,29 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_2convolve2d_bou
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_fill.pyx":173
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_fill(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g,
+ *                              float fill_value):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill = {__Pyx_NAMESTR("convolve3d_boundary_fill"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill = {"convolve3d_boundary_fill", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
   float __pyx_v_fill_value;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve3d_boundary_fill (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,&__pyx_n_s__fill_value,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,&__pyx_n_s_fill_value,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2970,15 +3137,15 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve3d_boundary_fill", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve3d_boundary_fill", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -3008,6 +3175,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_boundary_fill(__pyx_self, __pyx_v_f, __pyx_v_g, __pyx_v_fill_value);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -3016,14 +3185,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_fill_5convolve3d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_fill.pyx":173
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve3d_boundary_fill(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=3] g,
- *                              float fill_value):
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_boundary_fill(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g, float __pyx_v_fill_value) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -3064,24 +3225,24 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
+  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;
-  PyArrayObject *__pyx_t_10 = NULL;
-  PyArrayObject *__pyx_t_11 = NULL;
+  PyArrayObject *__pyx_t_8 = NULL;
+  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
+  unsigned int __pyx_t_11;
   int __pyx_t_12;
   unsigned int __pyx_t_13;
   int __pyx_t_14;
   unsigned int __pyx_t_15;
-  int __pyx_t_16;
+  unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
-  unsigned int __pyx_t_19;
-  unsigned int __pyx_t_20;
+  int __pyx_t_19;
+  int __pyx_t_20;
   int __pyx_t_21;
   int __pyx_t_22;
   int __pyx_t_23;
@@ -3089,11 +3250,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   int __pyx_t_25;
   int __pyx_t_26;
   int __pyx_t_27;
-  int __pyx_t_28;
-  int __pyx_t_29;
-  int __pyx_t_30;
-  int __pyx_t_31;
-  int __pyx_t_32;
+  unsigned int __pyx_t_28;
+  unsigned int __pyx_t_29;
+  unsigned int __pyx_t_30;
+  unsigned int __pyx_t_31;
+  unsigned int __pyx_t_32;
   unsigned int __pyx_t_33;
   unsigned int __pyx_t_34;
   unsigned int __pyx_t_35;
@@ -3110,14 +3271,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   unsigned int __pyx_t_46;
   unsigned int __pyx_t_47;
   unsigned int __pyx_t_48;
-  unsigned int __pyx_t_49;
-  unsigned int __pyx_t_50;
-  unsigned int __pyx_t_51;
+  int __pyx_t_49;
+  int __pyx_t_50;
+  int __pyx_t_51;
   unsigned int __pyx_t_52;
   unsigned int __pyx_t_53;
-  int __pyx_t_54;
-  int __pyx_t_55;
-  int __pyx_t_56;
+  unsigned int __pyx_t_54;
+  unsigned int __pyx_t_55;
+  unsigned int __pyx_t_56;
   unsigned int __pyx_t_57;
   unsigned int __pyx_t_58;
   unsigned int __pyx_t_59;
@@ -3131,11 +3292,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   unsigned int __pyx_t_67;
   unsigned int __pyx_t_68;
   unsigned int __pyx_t_69;
-  unsigned int __pyx_t_70;
-  unsigned int __pyx_t_71;
-  unsigned int __pyx_t_72;
-  unsigned int __pyx_t_73;
-  unsigned int __pyx_t_74;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3174,20 +3330,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    if (!__pyx_t_2) {
-      __pyx_t_3 = (__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1);
-      __pyx_t_4 = __pyx_t_3;
-    } else {
-      __pyx_t_4 = __pyx_t_2;
-    }
-    __pyx_t_2 = __pyx_t_4;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_2 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_fill.pyx":178
  * 
@@ -3196,14 +3354,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_fill.pyx":180
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -3213,32 +3369,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __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_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_4 = __pyx_t_1;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (unlikely(!__pyx_t_4)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L7_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3330,57 +3490,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=3] conv = np.empty([nx, ny, nz], dtype=DTYPE)
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_3 = 0;
   __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
-  __pyx_t_9 = 0;
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fixed.diminfo[2].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[2] [...]
     }
   }
-  __pyx_t_10 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":192
  *     cdef int wkz = nkz // 2
@@ -3389,57 +3549,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  *     cdef int ii, jj, kk
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
+  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_5 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_11 = ((PyArrayObject *)__pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_conv.diminfo[2].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[2]; __pyx_py [...]
     }
   }
-  __pyx_t_11 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_8);
-  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":202
  *     # Need a first pass to replace NaN values with value convolved from
@@ -3448,9 +3608,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_fill.pyx":203
  *     # neighboring values
@@ -3459,9 +3619,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *             for k in range(nz):
  *                 if npy_isnan(f[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_fill.pyx":204
  *     for i in range(nx):
@@ -3470,9 +3630,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                 if npy_isnan(f[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_fill.pyx":205
  *         for j in range(ny):
@@ -3481,11 +3641,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_j;
-        __pyx_t_20 = __pyx_v_k;
-        __pyx_t_4 = npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[2].strides)));
-        if (__pyx_t_4) {
+        __pyx_t_16 = __pyx_v_i;
+        __pyx_t_17 = __pyx_v_j;
+        __pyx_t_18 = __pyx_v_k;
+        __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_f.diminfo[2].strides))) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":206
  *             for k in range(nz):
@@ -3566,9 +3726,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_fill.pyx":215
  *                     kkmax = k + wkz + 1
@@ -3577,9 +3737,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                             for kk in range(kkmin, kkmax):
  *                                 if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1 or kk < 0 or kk > nz - 1:
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_fill.pyx":216
  *                     for ii in range(iimin, iimax):
@@ -3588,9 +3748,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                 if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1 or kk < 0 or kk > nz - 1:
  *                                     val = fill_value
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_fill.pyx":217
  *                         for jj in range(jjmin, jjmax):
@@ -3599,38 +3759,40 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     val = fill_value
  *                                 else:
  */
-                __pyx_t_4 = (__pyx_v_ii < 0);
-                if (!__pyx_t_4) {
-                  __pyx_t_2 = (__pyx_v_ii > (__pyx_v_nx - 1));
-                  if (!__pyx_t_2) {
-                    __pyx_t_1 = (__pyx_v_jj < 0);
-                    if (!__pyx_t_1) {
-                      __pyx_t_3 = (__pyx_v_jj > (__pyx_v_ny - 1));
-                      if (!__pyx_t_3) {
-                        __pyx_t_27 = (__pyx_v_kk < 0);
-                        if (!__pyx_t_27) {
-                          __pyx_t_28 = (__pyx_v_kk > (__pyx_v_nz - 1));
-                          __pyx_t_29 = __pyx_t_28;
-                        } else {
-                          __pyx_t_29 = __pyx_t_27;
-                        }
-                        __pyx_t_27 = __pyx_t_29;
-                      } else {
-                        __pyx_t_27 = __pyx_t_3;
-                      }
-                      __pyx_t_3 = __pyx_t_27;
-                    } else {
-                      __pyx_t_3 = __pyx_t_1;
-                    }
-                    __pyx_t_1 = __pyx_t_3;
-                  } else {
-                    __pyx_t_1 = __pyx_t_2;
-                  }
-                  __pyx_t_2 = __pyx_t_1;
+                __pyx_t_2 = ((__pyx_v_ii < 0) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L23_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L23_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_jj < 0) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L23_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_jj > (__pyx_v_ny - 1)) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L23_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_kk < 0) != 0);
+                if (!__pyx_t_2) {
                 } else {
-                  __pyx_t_2 = __pyx_t_4;
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L23_bool_binop_done;
                 }
-                if (__pyx_t_2) {
+                __pyx_t_2 = ((__pyx_v_kk > (__pyx_v_nz - 1)) != 0);
+                __pyx_t_1 = __pyx_t_2;
+                __pyx_L23_bool_binop_done:;
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_fill.pyx":218
  *                             for kk in range(kkmin, kkmax):
@@ -3640,7 +3802,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     val = f[ii, jj, kk]
  */
                   __pyx_v_val = __pyx_v_fill_value;
-                  goto __pyx_L17;
+                  goto __pyx_L22;
                 }
                 /*else*/ {
 
@@ -3651,15 +3813,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                 if not npy_isnan(val):
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  */
-                  __pyx_t_30 = __pyx_v_ii;
-                  __pyx_t_31 = __pyx_v_jj;
-                  __pyx_t_32 = __pyx_v_kk;
-                  if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_f.diminfo[0].shape;
-                  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_f.diminfo[1].shape;
-                  if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_f.diminfo[2].shape;
-                  __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_f.diminfo[2].strides));
+                  __pyx_t_25 = __pyx_v_ii;
+                  __pyx_t_26 = __pyx_v_jj;
+                  __pyx_t_27 = __pyx_v_kk;
+                  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_f.diminfo[0].shape;
+                  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_pybuffernd_f.diminfo[1].shape;
+                  if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_f.diminfo[2].shape;
+                  __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[2].strides));
                 }
-                __pyx_L17:;
+                __pyx_L22:;
 
                 /* "astropy/convolution/boundary_fill.pyx":221
  *                                 else:
@@ -3668,20 +3830,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  *                                             <unsigned int>(wky + jj - j),
  */
-                __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_2) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
-                  /* "astropy/convolution/boundary_fill.pyx":224
- *                                     ker = g[<unsigned int>(wkx + ii - i),
+                  /* "astropy/convolution/boundary_fill.pyx":222
+ *                                     val = f[ii, jj, kk]
+ *                                 if not npy_isnan(val):
+ *                                     ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                             <unsigned int>(wky + jj - j),
- *                                             <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                     top += val * ker
- *                                     bot += ker
+ *                                             <unsigned int>(wkz + kk - k)]
  */
-                  __pyx_t_33 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                  __pyx_t_34 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                  __pyx_t_35 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_g.diminfo[2].strides));
+                  __pyx_t_28 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                  __pyx_t_29 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_g.diminfo[2].strides));
 
                   /* "astropy/convolution/boundary_fill.pyx":225
  *                                             <unsigned int>(wky + jj - j),
@@ -3700,9 +3862,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         fixed[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L18;
+                  goto __pyx_L29;
                 }
-                __pyx_L18:;
+                __pyx_L29:;
               }
             }
           }
@@ -3714,8 +3876,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         fixed[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_2 = (__pyx_v_bot != 0.);
-          if (__pyx_t_2) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_fill.pyx":228
  *                                     bot += ker
@@ -3725,14 +3887,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         fixed[i, j, k] = f[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_36 = __pyx_v_i;
-            __pyx_t_37 = __pyx_v_j;
-            __pyx_t_38 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L19;
+            __pyx_t_31 = __pyx_v_i;
+            __pyx_t_32 = __pyx_v_j;
+            __pyx_t_33 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L30;
           }
           /*else*/ {
 
@@ -3743,16 +3911,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                 else:
  *                     fixed[i, j, k] = f[i, j, k]
  */
-            __pyx_t_39 = __pyx_v_i;
-            __pyx_t_40 = __pyx_v_j;
-            __pyx_t_41 = __pyx_v_k;
-            __pyx_t_42 = __pyx_v_i;
-            __pyx_t_43 = __pyx_v_j;
-            __pyx_t_44 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_4 [...]
+            __pyx_t_34 = __pyx_v_i;
+            __pyx_t_35 = __pyx_v_j;
+            __pyx_t_36 = __pyx_v_k;
+            __pyx_t_37 = __pyx_v_i;
+            __pyx_t_38 = __pyx_v_j;
+            __pyx_t_39 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_3 [...]
           }
-          __pyx_L19:;
-          goto __pyx_L10;
+          __pyx_L30:;
+          goto __pyx_L15;
         }
         /*else*/ {
 
@@ -3763,15 +3931,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  * 
  *     # Now run the proper convolution
  */
-          __pyx_t_45 = __pyx_v_i;
-          __pyx_t_46 = __pyx_v_j;
-          __pyx_t_47 = __pyx_v_k;
-          __pyx_t_48 = __pyx_v_i;
-          __pyx_t_49 = __pyx_v_j;
-          __pyx_t_50 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_46, [...]
+          __pyx_t_40 = __pyx_v_i;
+          __pyx_t_41 = __pyx_v_j;
+          __pyx_t_42 = __pyx_v_k;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          __pyx_t_45 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_41, [...]
         }
-        __pyx_L10:;
+        __pyx_L15:;
       }
     }
   }
@@ -3783,9 +3951,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_fill.pyx":236
  *     # Now run the proper convolution
@@ -3794,9 +3962,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *             for k in range(nz):
  *                 if not npy_isnan(fixed[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_fill.pyx":237
  *     for i in range(nx):
@@ -3805,9 +3973,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                 if not npy_isnan(fixed[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_fill.pyx":238
  *         for j in range(ny):
@@ -3816,11 +3984,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_51 = __pyx_v_i;
-        __pyx_t_52 = __pyx_v_j;
-        __pyx_t_53 = __pyx_v_k;
-        __pyx_t_2 = (!npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_fixed.diminfo[2].strides))));
-        if (__pyx_t_2) {
+        __pyx_t_46 = __pyx_v_i;
+        __pyx_t_47 = __pyx_v_j;
+        __pyx_t_48 = __pyx_v_k;
+        __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[2].strides))) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_fill.pyx":239
  *             for k in range(nz):
@@ -3901,9 +4069,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_fill.pyx":248
  *                     kkmax = k + wkz + 1
@@ -3912,9 +4080,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                             for kk in range(kkmin, kkmax):
  *                                 if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1 or kk < 0 or kk > nz - 1:
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_fill.pyx":249
  *                     for ii in range(iimin, iimax):
@@ -3923,9 +4091,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                 if ii < 0 or ii > nx - 1 or jj < 0 or jj > ny - 1 or kk < 0 or kk > nz - 1:
  *                                     val = fill_value
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_fill.pyx":250
  *                         for jj in range(jjmin, jjmax):
@@ -3934,38 +4102,40 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     val = fill_value
  *                                 else:
  */
-                __pyx_t_2 = (__pyx_v_ii < 0);
+                __pyx_t_2 = ((__pyx_v_ii < 0) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L45_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_ii > (__pyx_v_nx - 1)) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L45_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_jj < 0) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L45_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_jj > (__pyx_v_ny - 1)) != 0);
+                if (!__pyx_t_2) {
+                } else {
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L45_bool_binop_done;
+                }
+                __pyx_t_2 = ((__pyx_v_kk < 0) != 0);
                 if (!__pyx_t_2) {
-                  __pyx_t_4 = (__pyx_v_ii > (__pyx_v_nx - 1));
-                  if (!__pyx_t_4) {
-                    __pyx_t_1 = (__pyx_v_jj < 0);
-                    if (!__pyx_t_1) {
-                      __pyx_t_3 = (__pyx_v_jj > (__pyx_v_ny - 1));
-                      if (!__pyx_t_3) {
-                        __pyx_t_27 = (__pyx_v_kk < 0);
-                        if (!__pyx_t_27) {
-                          __pyx_t_29 = (__pyx_v_kk > (__pyx_v_nz - 1));
-                          __pyx_t_28 = __pyx_t_29;
-                        } else {
-                          __pyx_t_28 = __pyx_t_27;
-                        }
-                        __pyx_t_27 = __pyx_t_28;
-                      } else {
-                        __pyx_t_27 = __pyx_t_3;
-                      }
-                      __pyx_t_3 = __pyx_t_27;
-                    } else {
-                      __pyx_t_3 = __pyx_t_1;
-                    }
-                    __pyx_t_1 = __pyx_t_3;
-                  } else {
-                    __pyx_t_1 = __pyx_t_4;
-                  }
-                  __pyx_t_4 = __pyx_t_1;
                 } else {
-                  __pyx_t_4 = __pyx_t_2;
+                  __pyx_t_1 = __pyx_t_2;
+                  goto __pyx_L45_bool_binop_done;
                 }
-                if (__pyx_t_4) {
+                __pyx_t_2 = ((__pyx_v_kk > (__pyx_v_nz - 1)) != 0);
+                __pyx_t_1 = __pyx_t_2;
+                __pyx_L45_bool_binop_done:;
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_fill.pyx":251
  *                             for kk in range(kkmin, kkmax):
@@ -3975,7 +4145,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     val = fixed[ii, jj, kk]
  */
                   __pyx_v_val = __pyx_v_fill_value;
-                  goto __pyx_L33;
+                  goto __pyx_L44;
                 }
                 /*else*/ {
 
@@ -3986,27 +4156,27 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  *                                         <unsigned int>(wky + jj - j),
  */
-                  __pyx_t_54 = __pyx_v_ii;
-                  __pyx_t_55 = __pyx_v_jj;
-                  __pyx_t_56 = __pyx_v_kk;
-                  if (__pyx_t_54 < 0) __pyx_t_54 += __pyx_pybuffernd_fixed.diminfo[0].shape;
-                  if (__pyx_t_55 < 0) __pyx_t_55 += __pyx_pybuffernd_fixed.diminfo[1].shape;
-                  if (__pyx_t_56 < 0) __pyx_t_56 += __pyx_pybuffernd_fixed.diminfo[2].shape;
-                  __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_fixed.diminfo[2].strides));
+                  __pyx_t_49 = __pyx_v_ii;
+                  __pyx_t_50 = __pyx_v_jj;
+                  __pyx_t_51 = __pyx_v_kk;
+                  if (__pyx_t_49 < 0) __pyx_t_49 += __pyx_pybuffernd_fixed.diminfo[0].shape;
+                  if (__pyx_t_50 < 0) __pyx_t_50 += __pyx_pybuffernd_fixed.diminfo[1].shape;
+                  if (__pyx_t_51 < 0) __pyx_t_51 += __pyx_pybuffernd_fixed.diminfo[2].shape;
+                  __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[2].strides));
                 }
-                __pyx_L33:;
+                __pyx_L44:;
 
-                /* "astropy/convolution/boundary_fill.pyx":256
- *                                 ker = g[<unsigned int>(wkx + ii - i),
+                /* "astropy/convolution/boundary_fill.pyx":254
+ *                                 else:
+ *                                     val = fixed[ii, jj, kk]
+ *                                 ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                         <unsigned int>(wky + jj - j),
- *                                         <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                 if not npy_isnan(val):
- *                                     top += val * ker
+ *                                         <unsigned int>(wkz + kk - k)]
  */
-                __pyx_t_57 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                __pyx_t_58 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                __pyx_t_59 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_g.diminfo[2].strides));
+                __pyx_t_52 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                __pyx_t_53 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                __pyx_t_54 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_g.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_fill.pyx":257
  *                                         <unsigned int>(wky + jj - j),
@@ -4015,8 +4185,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                                     top += val * ker
  *                                     bot += ker
  */
-                __pyx_t_4 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_4) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_fill.pyx":258
  *                                         <unsigned int>(wkz + kk - k)]
@@ -4035,9 +4205,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L34;
+                  goto __pyx_L51;
                 }
-                __pyx_L34:;
+                __pyx_L51:;
               }
             }
           }
@@ -4049,8 +4219,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_4 = (__pyx_v_bot != 0.0);
-          if (__pyx_t_4) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_fill.pyx":261
  *                                     bot += ker
@@ -4060,14 +4230,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                         conv[i, j, k] = fixed[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_60 = __pyx_v_i;
-            __pyx_t_61 = __pyx_v_j;
-            __pyx_t_62 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L35;
+            __pyx_t_55 = __pyx_v_i;
+            __pyx_t_56 = __pyx_v_j;
+            __pyx_t_57 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L52;
           }
           /*else*/ {
 
@@ -4078,16 +4254,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  *                 else:
  *                     conv[i, j, k] = fixed[i, j, k]
  */
-            __pyx_t_63 = __pyx_v_i;
-            __pyx_t_64 = __pyx_v_j;
-            __pyx_t_65 = __pyx_v_k;
-            __pyx_t_66 = __pyx_v_i;
-            __pyx_t_67 = __pyx_v_j;
-            __pyx_t_68 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
+            __pyx_t_58 = __pyx_v_i;
+            __pyx_t_59 = __pyx_v_j;
+            __pyx_t_60 = __pyx_v_k;
+            __pyx_t_61 = __pyx_v_i;
+            __pyx_t_62 = __pyx_v_j;
+            __pyx_t_63 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
           }
-          __pyx_L35:;
-          goto __pyx_L26;
+          __pyx_L52:;
+          goto __pyx_L37;
         }
         /*else*/ {
 
@@ -4098,15 +4274,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
  * 
  *     return conv
  */
-          __pyx_t_69 = __pyx_v_i;
-          __pyx_t_70 = __pyx_v_j;
-          __pyx_t_71 = __pyx_v_k;
-          __pyx_t_72 = __pyx_v_i;
-          __pyx_t_73 = __pyx_v_j;
-          __pyx_t_74 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_73, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_74, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
+          __pyx_t_64 = __pyx_v_i;
+          __pyx_t_65 = __pyx_v_j;
+          __pyx_t_66 = __pyx_v_k;
+          __pyx_t_67 = __pyx_v_i;
+          __pyx_t_68 = __pyx_v_j;
+          __pyx_t_69 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_fill_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
         }
-        __pyx_L26:;
+        __pyx_L37:;
       }
     }
   }
@@ -4121,14 +4297,21 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_fill.pyx":173
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_fill(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g,
+ *                              float fill_value):
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -4152,6 +4335,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_fill_4convolve3d_bou
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -4159,18 +4350,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -4186,13 +4371,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4202,22 +4385,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -4226,7 +4407,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -4235,7 +4416,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -4244,17 +4425,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -4266,7 +4447,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -4277,87 +4458,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -4366,7 +4547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -4375,16 +4556,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -4393,7 +4575,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -4402,18 +4584,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -4422,7 +4604,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -4431,11 +4613,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -4444,7 +4626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -4453,9 +4635,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -4464,7 +4646,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -4473,16 +4655,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -4491,19 +4673,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -4512,23 +4694,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -4540,11 +4724,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -4557,328 +4741,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -4887,7 +5047,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -4896,11 +5056,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -4909,7 +5068,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -4918,7 +5077,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -4927,17 +5086,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -4946,13 +5105,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -4971,39 +5138,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -5015,17 +5184,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -5037,10 +5206,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -5057,7 +5235,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -5071,8 +5249,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5083,7 +5268,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -5100,7 +5285,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -5114,8 +5299,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5126,7 +5318,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -5143,7 +5335,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -5157,8 +5349,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5169,7 +5368,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -5186,7 +5385,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -5200,8 +5399,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5212,7 +5418,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -5229,7 +5435,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -5243,8 +5449,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5255,7 +5468,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -5277,20 +5490,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -5299,7 +5509,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -5308,18 +5518,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -5327,33 +5537,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -5375,129 +5583,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
+    } else {
+    }
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
     } else {
-      __pyx_t_8 = __pyx_t_7;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_8) {
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -5505,15 +5683,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -5522,7 +5700,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5531,413 +5709,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5945,25 +6120,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -5973,13 +6156,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -5992,7 +6181,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -6004,9 +6193,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -6014,9 +6204,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -6028,7 +6219,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -6037,7 +6228,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -6048,7 +6239,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -6057,7 +6248,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -6066,10 +6257,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -6083,17 +6283,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -6104,11 +6304,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -6118,9 +6317,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -6138,7 +6344,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("boundary_fill"),
+    "boundary_fill",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -6150,68 +6356,69 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
-  {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
-  {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
-  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
-  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
-  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
-  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
-  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
-  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
-  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
-  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
-  {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bot, __pyx_k__bot, sizeof(__pyx_k__bot), 0, 0, 1, 1},
-  {&__pyx_n_s__conv, __pyx_k__conv, sizeof(__pyx_k__conv), 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__f, __pyx_k__f, sizeof(__pyx_k__f), 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__fixed, __pyx_k__fixed, sizeof(__pyx_k__fixed), 0, 0, 1, 1},
-  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
-  {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 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__iii, __pyx_k__iii, sizeof(__pyx_k__iii), 0, 0, 1, 1},
-  {&__pyx_n_s__iimax, __pyx_k__iimax, sizeof(__pyx_k__iimax), 0, 0, 1, 1},
-  {&__pyx_n_s__iimin, __pyx_k__iimin, sizeof(__pyx_k__iimin), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__jj, __pyx_k__jj, sizeof(__pyx_k__jj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjj, __pyx_k__jjj, sizeof(__pyx_k__jjj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmax, __pyx_k__jjmax, sizeof(__pyx_k__jjmax), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmin, __pyx_k__jjmin, sizeof(__pyx_k__jjmin), 0, 0, 1, 1},
-  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
-  {&__pyx_n_s__ker, __pyx_k__ker, sizeof(__pyx_k__ker), 0, 0, 1, 1},
-  {&__pyx_n_s__kk, __pyx_k__kk, sizeof(__pyx_k__kk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkk, __pyx_k__kkk, sizeof(__pyx_k__kkk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmax, __pyx_k__kkmax, sizeof(__pyx_k__kkmax), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmin, __pyx_k__kkmin, sizeof(__pyx_k__kkmin), 0, 0, 1, 1},
-  {&__pyx_n_s__nkx, __pyx_k__nkx, sizeof(__pyx_k__nkx), 0, 0, 1, 1},
-  {&__pyx_n_s__nky, __pyx_k__nky, sizeof(__pyx_k__nky), 0, 0, 1, 1},
-  {&__pyx_n_s__nkz, __pyx_k__nkz, sizeof(__pyx_k__nkz), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__nx, __pyx_k__nx, sizeof(__pyx_k__nx), 0, 0, 1, 1},
-  {&__pyx_n_s__ny, __pyx_k__ny, sizeof(__pyx_k__ny), 0, 0, 1, 1},
-  {&__pyx_n_s__nz, __pyx_k__nz, sizeof(__pyx_k__nz), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1},
-  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
-  {&__pyx_n_s__wkx, __pyx_k__wkx, sizeof(__pyx_k__wkx), 0, 0, 1, 1},
-  {&__pyx_n_s__wky, __pyx_k__wky, sizeof(__pyx_k__wky), 0, 0, 1, 1},
-  {&__pyx_n_s__wkz, __pyx_k__wkz, sizeof(__pyx_k__wkz), 0, 0, 1, 1},
+  {&__pyx_kp_s_Convolution_kernel_must_have_odd, __pyx_k_Convolution_kernel_must_have_odd, sizeof(__pyx_k_Convolution_kernel_must_have_odd), 0, 0, 1, 0},
+  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s_astropy_convolution_boundary_fil, __pyx_k_astropy_convolution_boundary_fil, sizeof(__pyx_k_astropy_convolution_boundary_fil), 0, 0, 1, 1},
+  {&__pyx_n_s_bot, __pyx_k_bot, sizeof(__pyx_k_bot), 0, 0, 1, 1},
+  {&__pyx_n_s_conv, __pyx_k_conv, sizeof(__pyx_k_conv), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve1d_boundary_fill, __pyx_k_convolve1d_boundary_fill, sizeof(__pyx_k_convolve1d_boundary_fill), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve2d_boundary_fill, __pyx_k_convolve2d_boundary_fill, sizeof(__pyx_k_convolve2d_boundary_fill), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve3d_boundary_fill, __pyx_k_convolve3d_boundary_fill, sizeof(__pyx_k_convolve3d_boundary_fill), 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_f, __pyx_k_f, sizeof(__pyx_k_f), 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_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
+  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
+  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 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_iii, __pyx_k_iii, sizeof(__pyx_k_iii), 0, 0, 1, 1},
+  {&__pyx_n_s_iimax, __pyx_k_iimax, sizeof(__pyx_k_iimax), 0, 0, 1, 1},
+  {&__pyx_n_s_iimin, __pyx_k_iimin, sizeof(__pyx_k_iimin), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjj, __pyx_k_jjj, sizeof(__pyx_k_jjj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmax, __pyx_k_jjmax, sizeof(__pyx_k_jjmax), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmin, __pyx_k_jjmin, sizeof(__pyx_k_jjmin), 0, 0, 1, 1},
+  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+  {&__pyx_n_s_ker, __pyx_k_ker, sizeof(__pyx_k_ker), 0, 0, 1, 1},
+  {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkk, __pyx_k_kkk, sizeof(__pyx_k_kkk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmax, __pyx_k_kkmax, sizeof(__pyx_k_kkmax), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmin, __pyx_k_kkmin, sizeof(__pyx_k_kkmin), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_nkx, __pyx_k_nkx, sizeof(__pyx_k_nkx), 0, 0, 1, 1},
+  {&__pyx_n_s_nky, __pyx_k_nky, sizeof(__pyx_k_nky), 0, 0, 1, 1},
+  {&__pyx_n_s_nkz, __pyx_k_nkz, sizeof(__pyx_k_nkz), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
+  {&__pyx_n_s_ny, __pyx_k_ny, sizeof(__pyx_k_ny), 0, 0, 1, 1},
+  {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
+  {&__pyx_n_s_wkx, __pyx_k_wkx, sizeof(__pyx_k_wkx), 0, 0, 1, 1},
+  {&__pyx_n_s_wky, __pyx_k_wky, sizeof(__pyx_k_wky), 0, 0, 1, 1},
+  {&__pyx_n_s_wkz, __pyx_k_wkz, sizeof(__pyx_k_wkz), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6228,9 +6435,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_2);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
   /* "astropy/convolution/boundary_fill.pyx":93
  * 
@@ -6239,9 +6446,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_3);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
   /* "astropy/convolution/boundary_fill.pyx":178
  * 
@@ -6250,75 +6457,75 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_6);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_8);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_14);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_16);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
   /* "astropy/convolution/boundary_fill.pyx":16
  * 
@@ -6327,10 +6534,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=1] g,
  *                              float fill_value):
  */
-  __pyx_k_tuple_17 = PyTuple_Pack(17, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__fill_value), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__iimin), ((PyObject *)__pyx_n_s__iimax), ((PyObject *)__pyx_n_s__top), ((PyObject *)__pyx_n_s__bot) [...]
-  __Pyx_GOTREF(__pyx_k_tuple_17);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-  __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_19, 16, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(17, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_fill_value, __pyx_n_s_nx, __pyx_n_s_nkx, __pyx_n_s_wkx, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_iii, __pyx_n_s_ii, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve1d_boundary_fill, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_fill.pyx":88
  * 
@@ -6339,10 +6546,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=2] g,
  *                              float fill_value):
  */
-  __pyx_k_tuple_22 = PyTuple_Pack(25, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__fill_value), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__jjj), ((Py [...]
-  __Pyx_GOTREF(__pyx_k_tuple_22);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
-  __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(3, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_24, 88, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(25, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_fill_value, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_linen [...]
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve2d_boundary_fill, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_fill.pyx":173
  * 
@@ -6351,10 +6558,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=3] g,
  *                              float fill_value):
  */
-  __pyx_k_tuple_25 = PyTuple_Pack(33, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__fill_value), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nz), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__nkz), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__wkz), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((P [...]
-  __Pyx_GOTREF(__pyx_k_tuple_25);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-  __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(3, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_27, 173, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__14 = PyTuple_Pack(33, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_fill_value, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_nkz, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_wkz, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_kkk, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_kkmin, __pyx_n_s_kkmax, __pyx_n_s_top, [...]
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve3d_boundary_fill, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -6364,7 +6571,6 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6380,6 +6586,9 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -6412,11 +6621,26 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("boundary_fill"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("boundary_fill", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__convolution__boundary_fill) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -6425,16 +6649,6 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__convolution__boundary_fill) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -6467,9 +6681,9 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  * cimport numpy as np
  * 
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":6
@@ -6479,12 +6693,12 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  * ctypedef np.float_t DTYPE_t
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":16
@@ -6494,9 +6708,9 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  *                              np.ndarray[DTYPE_t, ndim=1] g,
  *                              float fill_value):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_1convolve1d_boundary_fill, NULL, __pyx_n_s_astropy_convolution_boundary_fil); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve1d_boundary_fill, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":88
@@ -6506,9 +6720,9 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  *                              np.ndarray[DTYPE_t, ndim=2] g,
  *                              float fill_value):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_3convolve2d_boundary_fill, NULL, __pyx_n_s_astropy_convolution_boundary_fil); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_24, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve2d_boundary_fill, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":173
@@ -6518,9 +6732,9 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  *                              np.ndarray[DTYPE_t, ndim=3] g,
  *                              float fill_value):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_fill_5convolve3d_boundary_fill, NULL, __pyx_n_s_astropy_convolution_boundary_fil); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_27, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve3d_boundary_fill, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_fill.pyx":1
@@ -6529,23 +6743,28 @@ PyMODINIT_FUNC PyInit_boundary_fill(void)
  * import numpy as np
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.convolution.boundary_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.convolution.boundary_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.convolution.boundary_fill");
@@ -6574,19 +6793,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -6611,7 +6828,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -6715,12 +6932,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -6730,23 +6947,29 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -6798,7 +7021,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -7043,7 +7266,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -7051,7 +7274,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -7060,7 +7283,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -7090,8 +7313,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -7131,10 +7356,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -7159,7 +7384,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -7171,7 +7396,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -7184,12 +7409,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -7210,21 +7435,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -7299,6 +7528,25 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
     return r;
 }
 
+#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
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -7348,11 +7596,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -7367,26 +7611,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -7396,7 +7627,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -7417,46 +7648,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -7466,6 +7713,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -7473,6 +7727,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -7480,6 +7735,23 @@ bad:
 }
 #endif
 
+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;
+}
+
 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
@@ -7489,7 +7761,7 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -7506,7 +7778,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -7514,133 +7786,195 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-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;
+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) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    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;
     }
-    return 0;
-#endif
+    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);
 }
 
-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();
+#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
     }
-    return 0;
+    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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
-    PyErr_WriteUnraisable(obj);
-nofail:
     Py_DECREF(obj);
     view->obj = NULL;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
+#endif
 
 
-    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+      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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -7658,7 +7992,6 @@ nofail:
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -7680,7 +8013,7 @@ nofail:
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -7697,14 +8030,6 @@ nofail:
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -7714,19 +8039,256 @@ bad:
     return module;
 }
 
-#if CYTHON_CCOMPLEX
-  #ifdef __cplusplus
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      return ::std::complex< float >(x, y);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
     }
-  #else
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      return x + y*(__pyx_t_float_complex)_Complex_I;
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(int),
+                                     little, !is_unsigned);
     }
-  #endif
-#else
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      __pyx_t_float_complex z;
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (unsigned int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(unsigned int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, 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
+            unsigned int val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (unsigned int) -1;
+        }
+    } else {
+        unsigned int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned int) -1;
+        val = __Pyx_PyInt_As_unsigned_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to unsigned int");
+    return (unsigned int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to unsigned int");
+    return (unsigned int) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, 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_Int(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_Int(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;
+}
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return ::std::complex< float >(x, y);
+    }
+  #else
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return x + y*(__pyx_t_float_complex)_Complex_I;
+    }
+  #endif
+#else
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      __pyx_t_float_complex z;
       z.real = x;
       z.imag = y;
       return z;
@@ -7954,404 +8516,125 @@ bad:
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
+    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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
+    } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
         }
-        return (signed int)val;
     }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
+                                     little, !is_unsigned);
     }
-    return (int)__Pyx_PyInt_AsLong(x);
 }
 
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
         } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
             }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
+            return (long) val;
         }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
-        }
-        return (signed long)val;
-    } else
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
         }
-        return (signed PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+        {
+#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_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+ #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 {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        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;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -8364,11 +8647,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -8418,7 +8697,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -8438,15 +8717,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -8458,168 +8733,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -8630,7 +8743,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -8650,6 +8763,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -8659,14 +8837,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -8682,13 +8860,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -8702,35 +8880,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/convolution/boundary_none.c b/astropy/convolution/boundary_none.c
index c0a01b5..064b08e 100644
--- a/astropy/convolution/boundary_none.c
+++ b/astropy/convolution/boundary_none.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -265,17 +247,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -289,40 +260,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -354,20 +442,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "boundary_none.pyx",
-  "numpy.pxd",
+  "astropy/convolution/boundary_none.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -394,7 +482,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -403,7 +491,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -412,7 +500,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -421,7 +509,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -430,7 +518,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -439,7 +527,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -448,7 +536,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -457,7 +545,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -466,7 +554,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -475,7 +563,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -484,7 +572,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -493,7 +581,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -502,7 +590,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -511,7 +599,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -520,7 +608,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -529,7 +617,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -538,7 +626,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -547,7 +635,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -556,7 +644,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -565,7 +653,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -574,7 +662,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -614,7 +702,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_none_DT
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -623,7 +711,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_none_DT
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -632,7 +720,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -641,7 +729,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -662,7 +750,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -699,23 +787,46 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
@@ -723,16 +834,28 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+#ifndef __PYX_FORCE_INIT_THREADS
+  #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -741,9 +864,22 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -770,7 +906,15 @@ typedef struct {
 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -784,7 +928,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -870,37 +1014,9 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -912,28 +1028,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
+static PyObject *__Pyx_ImportModule(const char *name);
 
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -979,152 +1078,164 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_boundary_none(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "Convolution kernel must have odd dimensions";
-static char __pyx_k_5[] = "ndarray is not C contiguous";
-static char __pyx_k_7[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_9[] = "Non-native byte order not supported";
-static char __pyx_k_11[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_12[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_15[] = "Format string allocated too short.";
-static char __pyx_k_19[] = "convolve1d_boundary_none";
-static char __pyx_k_20[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_none.pyx";
-static char __pyx_k_21[] = "astropy.convolution.boundary_none";
-static char __pyx_k_24[] = "convolve2d_boundary_none";
-static char __pyx_k_27[] = "convolve3d_boundary_none";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__ii[] = "ii";
-static char __pyx_k__jj[] = "jj";
-static char __pyx_k__kk[] = "kk";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__nx[] = "nx";
-static char __pyx_k__ny[] = "ny";
-static char __pyx_k__nz[] = "nz";
-static char __pyx_k__bot[] = "bot";
-static char __pyx_k__ker[] = "ker";
-static char __pyx_k__nkx[] = "nkx";
-static char __pyx_k__nky[] = "nky";
-static char __pyx_k__nkz[] = "nkz";
-static char __pyx_k__top[] = "top";
-static char __pyx_k__val[] = "val";
-static char __pyx_k__wkx[] = "wkx";
-static char __pyx_k__wky[] = "wky";
-static char __pyx_k__wkz[] = "wkz";
-static char __pyx_k__conv[] = "conv";
-static char __pyx_k__DTYPE[] = "DTYPE";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__fixed[] = "fixed";
-static char __pyx_k__float[] = "float";
-static char __pyx_k__iimax[] = "iimax";
-static char __pyx_k__iimin[] = "iimin";
-static char __pyx_k__jjmax[] = "jjmax";
-static char __pyx_k__jjmin[] = "jjmin";
-static char __pyx_k__kkmax[] = "kkmax";
-static char __pyx_k__kkmin[] = "kkmin";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_n_s_19;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_n_s_21;
-static PyObject *__pyx_n_s_24;
-static PyObject *__pyx_n_s_27;
-static PyObject *__pyx_kp_u_5;
-static PyObject *__pyx_kp_u_7;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__DTYPE;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bot;
-static PyObject *__pyx_n_s__conv;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__f;
-static PyObject *__pyx_n_s__fixed;
-static PyObject *__pyx_n_s__float;
-static PyObject *__pyx_n_s__g;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__ii;
-static PyObject *__pyx_n_s__iimax;
-static PyObject *__pyx_n_s__iimin;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__jj;
-static PyObject *__pyx_n_s__jjmax;
-static PyObject *__pyx_n_s__jjmin;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__ker;
-static PyObject *__pyx_n_s__kk;
-static PyObject *__pyx_n_s__kkmax;
-static PyObject *__pyx_n_s__kkmin;
-static PyObject *__pyx_n_s__nkx;
-static PyObject *__pyx_n_s__nky;
-static PyObject *__pyx_n_s__nkz;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__nx;
-static PyObject *__pyx_n_s__ny;
-static PyObject *__pyx_n_s__nz;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__top;
-static PyObject *__pyx_n_s__val;
-static PyObject *__pyx_n_s__wkx;
-static PyObject *__pyx_n_s__wky;
-static PyObject *__pyx_n_s__wkz;
-static PyObject *__pyx_n_s__zeros;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_codeobj_18;
-static PyObject *__pyx_k_codeobj_23;
-static PyObject *__pyx_k_codeobj_26;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_ii[] = "ii";
+static char __pyx_k_jj[] = "jj";
+static char __pyx_k_kk[] = "kk";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_nx[] = "nx";
+static char __pyx_k_ny[] = "ny";
+static char __pyx_k_nz[] = "nz";
+static char __pyx_k_bot[] = "bot";
+static char __pyx_k_ker[] = "ker";
+static char __pyx_k_nkx[] = "nkx";
+static char __pyx_k_nky[] = "nky";
+static char __pyx_k_nkz[] = "nkz";
+static char __pyx_k_top[] = "top";
+static char __pyx_k_val[] = "val";
+static char __pyx_k_wkx[] = "wkx";
+static char __pyx_k_wky[] = "wky";
+static char __pyx_k_wkz[] = "wkz";
+static char __pyx_k_conv[] = "conv";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_DTYPE[] = "DTYPE";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_fixed[] = "fixed";
+static char __pyx_k_float[] = "float";
+static char __pyx_k_iimax[] = "iimax";
+static char __pyx_k_iimin[] = "iimin";
+static char __pyx_k_jjmax[] = "jjmax";
+static char __pyx_k_jjmin[] = "jjmin";
+static char __pyx_k_kkmax[] = "kkmax";
+static char __pyx_k_kkmin[] = "kkmin";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_convolve1d_boundary_none[] = "convolve1d_boundary_none";
+static char __pyx_k_convolve2d_boundary_none[] = "convolve2d_boundary_none";
+static char __pyx_k_convolve3d_boundary_none[] = "convolve3d_boundary_none";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_none.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Convolution_kernel_must_have_odd[] = "Convolution kernel must have odd dimensions";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_astropy_convolution_boundary_non[] = "astropy.convolution.boundary_none";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_Convolution_kernel_must_have_odd;
+static PyObject *__pyx_n_s_DTYPE;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_astropy_convolution_boundary_non;
+static PyObject *__pyx_n_s_bot;
+static PyObject *__pyx_n_s_conv;
+static PyObject *__pyx_n_s_convolve1d_boundary_none;
+static PyObject *__pyx_n_s_convolve2d_boundary_none;
+static PyObject *__pyx_n_s_convolve3d_boundary_none;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_fixed;
+static PyObject *__pyx_n_s_float;
+static PyObject *__pyx_n_s_g;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_ii;
+static PyObject *__pyx_n_s_iimax;
+static PyObject *__pyx_n_s_iimin;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_jj;
+static PyObject *__pyx_n_s_jjmax;
+static PyObject *__pyx_n_s_jjmin;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_ker;
+static PyObject *__pyx_n_s_kk;
+static PyObject *__pyx_n_s_kkmax;
+static PyObject *__pyx_n_s_kkmin;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_nkx;
+static PyObject *__pyx_n_s_nky;
+static PyObject *__pyx_n_s_nkz;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_nx;
+static PyObject *__pyx_n_s_ny;
+static PyObject *__pyx_n_s_nz;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_top;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_wkx;
+static PyObject *__pyx_n_s_wky;
+static PyObject *__pyx_n_s_wkz;
+static PyObject *__pyx_n_s_zeros;
+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_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
+
+/* "astropy/convolution/boundary_none.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_none(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none = {__Pyx_NAMESTR("convolve1d_boundary_none"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none = {"convolve1d_boundary_none", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve1d_boundary_none (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1138,10 +1249,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve1d_boundary_none", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1169,6 +1280,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boundary_none(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1177,14 +1290,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_1convolve1d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_none.pyx":16
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve1d_boundary_none(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=1] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boundary_none(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_nkx;
@@ -1212,15 +1317,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
   unsigned int __pyx_t_11;
-  unsigned int __pyx_t_12;
-  int __pyx_t_13;
-  long __pyx_t_14;
+  long __pyx_t_12;
+  unsigned int __pyx_t_13;
+  unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
   unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
@@ -1234,8 +1339,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
   unsigned int __pyx_t_25;
   unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
-  unsigned int __pyx_t_28;
-  unsigned int __pyx_t_29;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1274,7 +1377,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
+  __pyx_t_1 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
   if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_none.pyx":20
@@ -1284,14 +1387,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_none.pyx":22
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -1301,32 +1402,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_1) {
-    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_5) {
+    } else {
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L4_bool_binop_done;
+    }
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __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_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_1;
-  }
-  if (unlikely(!__pyx_t_6)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L4_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -1364,12 +1469,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *     cdef np.ndarray[DTYPE_t, ndim=1] conv = np.zeros([nx], dtype=DTYPE)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -1378,33 +1483,33 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
   __pyx_t_2 = 0;
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
   __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":31
  *     # boundary does not get reset.
@@ -1413,45 +1518,45 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  * 
  *     cdef unsigned int i, ii
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
   __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
@@ -1462,9 +1567,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *         if npy_isnan(f[i]) and i >= wkx and i < nx - wkx:
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_none.pyx":42
  *     # neighboring values
@@ -1473,20 +1578,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_12 = __pyx_v_i;
-    __pyx_t_6 = npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_f.diminfo[0].strides)));
-    if (__pyx_t_6) {
-      __pyx_t_1 = (__pyx_v_i >= __pyx_v_wkx);
-      if (__pyx_t_1) {
-        __pyx_t_5 = (__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx));
-        __pyx_t_13 = __pyx_t_5;
-      } else {
-        __pyx_t_13 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_i;
+    __pyx_t_5 = (npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_f.diminfo[0].strides))) != 0);
+    if (__pyx_t_5) {
+    } else {
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L9_bool_binop_done;
+    }
+    __pyx_t_5 = ((__pyx_v_i >= __pyx_v_wkx) != 0);
+    if (__pyx_t_5) {
     } else {
-      __pyx_t_1 = __pyx_t_6;
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L9_bool_binop_done;
     }
+    __pyx_t_5 = ((__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx)) != 0);
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L9_bool_binop_done:;
     if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_none.pyx":43
@@ -1514,9 +1621,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 val = f[ii]
  *                 if not npy_isnan(val):
  */
-      __pyx_t_14 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-      for (__pyx_t_15 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-        __pyx_v_ii = __pyx_t_15;
+      __pyx_t_12 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+      for (__pyx_t_13 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_none.pyx":46
  *             bot = 0.
@@ -1525,8 +1632,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  */
-        __pyx_t_16 = __pyx_v_ii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides));
+        __pyx_t_14 = __pyx_v_ii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_none.pyx":47
  *             for ii in range(i - wkx, i + wkx + 1):
@@ -1535,7 +1642,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  *                     top += val * ker
  */
-        __pyx_t_1 = (!npy_isnan(__pyx_v_val));
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
         if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":48
@@ -1545,8 +1652,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-          __pyx_t_17 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_g.diminfo[0].strides));
+          __pyx_t_15 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_g.diminfo[0].strides));
 
           /* "astropy/convolution/boundary_none.pyx":49
  *                 if not npy_isnan(val):
@@ -1565,9 +1672,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 fixed[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L9;
+          goto __pyx_L14;
         }
-        __pyx_L9:;
+        __pyx_L14:;
       }
 
       /* "astropy/convolution/boundary_none.pyx":51
@@ -1577,7 +1684,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 fixed[i] = top / bot
  *             else:
  */
-      __pyx_t_1 = (__pyx_v_bot != 0.);
+      __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
       if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_none.pyx":52
@@ -1588,12 +1695,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 fixed[i] = f[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_15 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L10;
+        __pyx_t_13 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L15;
       }
       /*else*/ {
 
@@ -1604,12 +1717,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *         else:
  *             fixed[i] = f[i]
  */
-        __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides));
+        __pyx_t_16 = __pyx_v_i;
+        __pyx_t_17 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides));
       }
-      __pyx_L10:;
-      goto __pyx_L6;
+      __pyx_L15:;
+      goto __pyx_L8;
     }
     /*else*/ {
 
@@ -1620,11 +1733,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  * 
  *     # Now run the proper convolution
  */
-      __pyx_t_20 = __pyx_v_i;
-      __pyx_t_21 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides));
+      __pyx_t_18 = __pyx_v_i;
+      __pyx_t_19 = __pyx_v_i;
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides));
     }
-    __pyx_L6:;
+    __pyx_L8:;
   }
 
   /* "astropy/convolution/boundary_none.pyx":59
@@ -1634,9 +1747,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *         if not npy_isnan(fixed[i]):
  *             top = 0.
  */
-  __pyx_t_10 = (__pyx_v_nx - __pyx_v_wkx);
-  for (__pyx_t_11 = __pyx_v_wkx; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = (__pyx_v_nx - __pyx_v_wkx);
+  for (__pyx_t_10 = __pyx_v_wkx; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_none.pyx":60
  *     # Now run the proper convolution
@@ -1645,8 +1758,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_22 = __pyx_v_i;
-    __pyx_t_1 = (!npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides))));
+    __pyx_t_20 = __pyx_v_i;
+    __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides))) != 0)) != 0);
     if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_none.pyx":61
@@ -1674,9 +1787,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 val = fixed[ii]
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  */
-      __pyx_t_14 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-      for (__pyx_t_23 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_23 < __pyx_t_14; __pyx_t_23+=1) {
-        __pyx_v_ii = __pyx_t_23;
+      __pyx_t_12 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+      for (__pyx_t_21 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_21 < __pyx_t_12; __pyx_t_21+=1) {
+        __pyx_v_ii = __pyx_t_21;
 
         /* "astropy/convolution/boundary_none.pyx":64
  *             bot = 0.
@@ -1685,8 +1798,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  *                 if not npy_isnan(val):
  */
-        __pyx_t_24 = __pyx_v_ii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        __pyx_t_22 = __pyx_v_ii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_none.pyx":65
  *             for ii in range(i - wkx, i + wkx + 1):
@@ -1695,8 +1808,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     top += val * ker
  */
-        __pyx_t_25 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_g.diminfo[0].strides));
+        __pyx_t_23 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_g.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_none.pyx":66
  *                 val = fixed[ii]
@@ -1705,7 +1818,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-        __pyx_t_1 = (!npy_isnan(__pyx_v_val));
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
         if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":67
@@ -1725,9 +1838,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 conv[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L16;
+          goto __pyx_L21;
         }
-        __pyx_L16:;
+        __pyx_L21:;
       }
 
       /* "astropy/convolution/boundary_none.pyx":69
@@ -1737,7 +1850,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 conv[i] = top / bot
  *             else:
  */
-      __pyx_t_1 = (__pyx_v_bot != 0.0);
+      __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
       if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_none.pyx":70
@@ -1748,12 +1861,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *                 conv[i] = fixed[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_23 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L17;
+        __pyx_t_21 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L22;
       }
       /*else*/ {
 
@@ -1764,12 +1883,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  *         else:
  *             conv[i] = fixed[i]
  */
-        __pyx_t_26 = __pyx_v_i;
-        __pyx_t_27 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        __pyx_t_24 = __pyx_v_i;
+        __pyx_t_25 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[0].strides));
       }
-      __pyx_L17:;
-      goto __pyx_L13;
+      __pyx_L22:;
+      goto __pyx_L18;
     }
     /*else*/ {
 
@@ -1780,11 +1899,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
  * 
  *     return conv
  */
-      __pyx_t_28 = __pyx_v_i;
-      __pyx_t_29 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides));
+      __pyx_t_26 = __pyx_v_i;
+      __pyx_t_27 = __pyx_v_i;
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides));
     }
-    __pyx_L13:;
+    __pyx_L18:;
   }
 
   /* "astropy/convolution/boundary_none.pyx":76
@@ -1799,13 +1918,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_none.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_none(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
+
+  /* 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_7);
+  __Pyx_XDECREF(__pyx_t_6);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -1829,17 +1955,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_convolve1d_boun
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_none.pyx":80
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_none(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none = {__Pyx_NAMESTR("convolve2d_boundary_none"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none = {"convolve2d_boundary_none", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve2d_boundary_none (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1853,10 +1990,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve2d_boundary_none", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1884,6 +2021,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_boundary_none(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1892,14 +2031,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_3convolve2d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_none.pyx":80
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve2d_boundary_none(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=2] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_boundary_none(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -1929,25 +2060,25 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
+  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;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  unsigned int __pyx_t_11;
-  int __pyx_t_12;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
+  int __pyx_t_11;
+  unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
-  unsigned int __pyx_t_15;
-  int __pyx_t_16;
-  int __pyx_t_17;
-  int __pyx_t_18;
-  long __pyx_t_19;
+  long __pyx_t_15;
+  unsigned int __pyx_t_16;
+  long __pyx_t_17;
+  unsigned int __pyx_t_18;
+  unsigned int __pyx_t_19;
   unsigned int __pyx_t_20;
-  long __pyx_t_21;
+  unsigned int __pyx_t_21;
   unsigned int __pyx_t_22;
   unsigned int __pyx_t_23;
   unsigned int __pyx_t_24;
@@ -1973,10 +2104,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
   unsigned int __pyx_t_44;
   unsigned int __pyx_t_45;
   unsigned int __pyx_t_46;
-  unsigned int __pyx_t_47;
-  unsigned int __pyx_t_48;
-  unsigned int __pyx_t_49;
-  unsigned int __pyx_t_50;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2015,14 +2142,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    __pyx_t_3 = __pyx_t_2;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_3 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_none.pyx":84
  * 
@@ -2031,14 +2160,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_none.pyx":86
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -2048,32 +2175,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __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_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (unlikely(!__pyx_t_2)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -2138,52 +2269,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=2] conv = np.zeros([nx, ny], dtype=DTYPE)
  * 
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_4 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":98
  *     # boundary does not get reset.
@@ -2192,52 +2323,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  * 
  *     cdef unsigned int i, j, ii, jj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_4 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_9 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":108
  *     # Need a first pass to replace NaN values with value convolved from
@@ -2246,9 +2377,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *         for j in range(ny):
  *             if npy_isnan(f[i, j]) and i >= wkx and i < nx - wkx \
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_none.pyx":109
  *     # neighboring values
@@ -2257,9 +2388,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *             if npy_isnan(f[i, j]) and i >= wkx and i < nx - wkx \
  *             and j >= wky and j < ny - wky:
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_none.pyx":110
  *     for i in range(nx):
@@ -2268,42 +2399,44 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *             and j >= wky and j < ny - wky:
  *                 top = 0.
  */
-      __pyx_t_14 = __pyx_v_i;
-      __pyx_t_15 = __pyx_v_j;
-      __pyx_t_2 = npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_f.diminfo[1].strides)));
+      __pyx_t_13 = __pyx_v_i;
+      __pyx_t_14 = __pyx_v_j;
+      __pyx_t_2 = (npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_f.diminfo[1].strides))) != 0);
       if (__pyx_t_2) {
-        __pyx_t_3 = (__pyx_v_i >= __pyx_v_wkx);
-        if (__pyx_t_3) {
+      } else {
+        __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L13_bool_binop_done;
+      }
+      __pyx_t_2 = ((__pyx_v_i >= __pyx_v_wkx) != 0);
+      if (__pyx_t_2) {
+      } else {
+        __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L13_bool_binop_done;
+      }
 
-          /* "astropy/convolution/boundary_none.pyx":111
+      /* "astropy/convolution/boundary_none.pyx":111
  *         for j in range(ny):
  *             if npy_isnan(f[i, j]) and i >= wkx and i < nx - wkx \
  *             and j >= wky and j < ny - wky:             # <<<<<<<<<<<<<<
  *                 top = 0.
  *                 bot = 0.
  */
-          __pyx_t_1 = (__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx));
-          if (__pyx_t_1) {
-            __pyx_t_16 = (__pyx_v_j >= __pyx_v_wky);
-            if (__pyx_t_16) {
-              __pyx_t_17 = (__pyx_v_j < (__pyx_v_ny - __pyx_v_wky));
-              __pyx_t_18 = __pyx_t_17;
-            } else {
-              __pyx_t_18 = __pyx_t_16;
-            }
-            __pyx_t_16 = __pyx_t_18;
-          } else {
-            __pyx_t_16 = __pyx_t_1;
-          }
-          __pyx_t_1 = __pyx_t_16;
-        } else {
-          __pyx_t_1 = __pyx_t_3;
-        }
-        __pyx_t_3 = __pyx_t_1;
+      __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx)) != 0);
+      if (__pyx_t_2) {
       } else {
-        __pyx_t_3 = __pyx_t_2;
+        __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L13_bool_binop_done;
       }
-      if (__pyx_t_3) {
+      __pyx_t_2 = ((__pyx_v_j >= __pyx_v_wky) != 0);
+      if (__pyx_t_2) {
+      } else {
+        __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L13_bool_binop_done;
+      }
+      __pyx_t_2 = ((__pyx_v_j < (__pyx_v_ny - __pyx_v_wky)) != 0);
+      __pyx_t_1 = __pyx_t_2;
+      __pyx_L13_bool_binop_done:;
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_none.pyx":112
  *             if npy_isnan(f[i, j]) and i >= wkx and i < nx - wkx \
@@ -2330,9 +2463,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     for jj in range(j - wky, j + wky + 1):
  *                         val = f[ii, jj]
  */
-        __pyx_t_19 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-        for (__pyx_t_20 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
-          __pyx_v_ii = __pyx_t_20;
+        __pyx_t_15 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+        for (__pyx_t_16 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_none.pyx":115
  *                 bot = 0.
@@ -2341,9 +2474,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                         val = f[ii, jj]
  *                         if not npy_isnan(val):
  */
-          __pyx_t_21 = ((__pyx_v_j + __pyx_v_wky) + 1);
-          for (__pyx_t_22 = (__pyx_v_j - __pyx_v_wky); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_jj = __pyx_t_22;
+          __pyx_t_17 = ((__pyx_v_j + __pyx_v_wky) + 1);
+          for (__pyx_t_18 = (__pyx_v_j - __pyx_v_wky); __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_none.pyx":116
  *                 for ii in range(i - wkx, i + wkx + 1):
@@ -2352,9 +2485,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                         if not npy_isnan(val):
  *                             ker = g[<unsigned int>(wkx + ii - i),
  */
-            __pyx_t_23 = __pyx_v_ii;
-            __pyx_t_24 = __pyx_v_jj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_f.diminfo[1].strides));
+            __pyx_t_19 = __pyx_v_ii;
+            __pyx_t_20 = __pyx_v_jj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_none.pyx":117
  *                     for jj in range(j - wky, j + wky + 1):
@@ -2363,19 +2496,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                             ker = g[<unsigned int>(wkx + ii - i),
  *                                     <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_3 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_3) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
-              /* "astropy/convolution/boundary_none.pyx":119
+              /* "astropy/convolution/boundary_none.pyx":118
+ *                         val = f[ii, jj]
  *                         if not npy_isnan(val):
- *                             ker = g[<unsigned int>(wkx + ii - i),
- *                                     <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                             ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                     <unsigned int>(wky + jj - j)]
  *                             top += val * ker
- *                             bot += ker
  */
-              __pyx_t_25 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-              __pyx_t_26 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_g.diminfo[1].strides));
+              __pyx_t_21 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+              __pyx_t_22 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_g.diminfo[1].strides));
 
               /* "astropy/convolution/boundary_none.pyx":120
  *                             ker = g[<unsigned int>(wkx + ii - i),
@@ -2394,9 +2527,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     fixed[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L13;
+              goto __pyx_L22;
             }
-            __pyx_L13:;
+            __pyx_L22:;
           }
         }
 
@@ -2407,8 +2540,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     fixed[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_3 = (__pyx_v_bot != 0.);
-        if (__pyx_t_3) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":123
  *                             bot += ker
@@ -2418,13 +2551,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     fixed[i, j] = f[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_20 = __pyx_v_i;
-          __pyx_t_22 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L14;
+          __pyx_t_16 = __pyx_v_i;
+          __pyx_t_18 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L23;
         }
         /*else*/ {
 
@@ -2435,14 +2574,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *             else:
  *                 fixed[i, j] = f[i, j]
  */
-          __pyx_t_27 = __pyx_v_i;
-          __pyx_t_28 = __pyx_v_j;
-          __pyx_t_29 = __pyx_v_i;
-          __pyx_t_30 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_f.diminfo[1].strides));
+          __pyx_t_23 = __pyx_v_i;
+          __pyx_t_24 = __pyx_v_j;
+          __pyx_t_25 = __pyx_v_i;
+          __pyx_t_26 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_f.diminfo[1].strides));
         }
-        __pyx_L14:;
-        goto __pyx_L8;
+        __pyx_L23:;
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -2453,13 +2592,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  * 
  *     # Now run the proper convolution
  */
-        __pyx_t_31 = __pyx_v_i;
-        __pyx_t_32 = __pyx_v_j;
-        __pyx_t_33 = __pyx_v_i;
-        __pyx_t_34 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_f.diminfo[1].strides));
+        __pyx_t_27 = __pyx_v_i;
+        __pyx_t_28 = __pyx_v_j;
+        __pyx_t_29 = __pyx_v_i;
+        __pyx_t_30 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_f.diminfo[1].strides));
       }
-      __pyx_L8:;
+      __pyx_L12:;
     }
   }
 
@@ -2470,9 +2609,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *         for j in range(wky, ny - wky):
  *             if not npy_isnan(fixed[i, j]):
  */
-  __pyx_t_10 = (__pyx_v_nx - __pyx_v_wkx);
-  for (__pyx_t_11 = __pyx_v_wkx; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = (__pyx_v_nx - __pyx_v_wkx);
+  for (__pyx_t_10 = __pyx_v_wkx; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_none.pyx":131
  *     # Now run the proper convolution
@@ -2481,9 +2620,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *             if not npy_isnan(fixed[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = (__pyx_v_ny - __pyx_v_wky);
-    for (__pyx_t_13 = __pyx_v_wky; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = (__pyx_v_ny - __pyx_v_wky);
+    for (__pyx_t_12 = __pyx_v_wky; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_none.pyx":132
  *     for i in range(wkx, nx - wkx):
@@ -2492,10 +2631,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_35 = __pyx_v_i;
-      __pyx_t_36 = __pyx_v_j;
-      __pyx_t_3 = (!npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[1].strides))));
-      if (__pyx_t_3) {
+      __pyx_t_31 = __pyx_v_i;
+      __pyx_t_32 = __pyx_v_j;
+      __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides))) != 0)) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_none.pyx":133
  *         for j in range(wky, ny - wky):
@@ -2522,9 +2661,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     for jj in range(j - wky, j + wky + 1):
  *                         val = fixed[ii, jj]
  */
-        __pyx_t_19 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-        for (__pyx_t_37 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_37 < __pyx_t_19; __pyx_t_37+=1) {
-          __pyx_v_ii = __pyx_t_37;
+        __pyx_t_15 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+        for (__pyx_t_33 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_33 < __pyx_t_15; __pyx_t_33+=1) {
+          __pyx_v_ii = __pyx_t_33;
 
           /* "astropy/convolution/boundary_none.pyx":136
  *                 bot = 0.
@@ -2533,9 +2672,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                         val = fixed[ii, jj]
  *                         ker = g[<unsigned int>(wkx + ii - i),
  */
-          __pyx_t_21 = ((__pyx_v_j + __pyx_v_wky) + 1);
-          for (__pyx_t_38 = (__pyx_v_j - __pyx_v_wky); __pyx_t_38 < __pyx_t_21; __pyx_t_38+=1) {
-            __pyx_v_jj = __pyx_t_38;
+          __pyx_t_17 = ((__pyx_v_j + __pyx_v_wky) + 1);
+          for (__pyx_t_34 = (__pyx_v_j - __pyx_v_wky); __pyx_t_34 < __pyx_t_17; __pyx_t_34+=1) {
+            __pyx_v_jj = __pyx_t_34;
 
             /* "astropy/convolution/boundary_none.pyx":137
  *                 for ii in range(i - wkx, i + wkx + 1):
@@ -2544,20 +2683,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                         ker = g[<unsigned int>(wkx + ii - i),
  *                                 <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_39 = __pyx_v_ii;
-            __pyx_t_40 = __pyx_v_jj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[1].strides));
+            __pyx_t_35 = __pyx_v_ii;
+            __pyx_t_36 = __pyx_v_jj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[1].strides));
 
-            /* "astropy/convolution/boundary_none.pyx":139
+            /* "astropy/convolution/boundary_none.pyx":138
+ *                     for jj in range(j - wky, j + wky + 1):
  *                         val = fixed[ii, jj]
- *                         ker = g[<unsigned int>(wkx + ii - i),
- *                                 <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                         ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                 <unsigned int>(wky + jj - j)]
  *                         if not npy_isnan(val):
- *                             top += val * ker
  */
-            __pyx_t_41 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-            __pyx_t_42 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_g.diminfo[1].strides));
+            __pyx_t_37 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+            __pyx_t_38 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_g.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_none.pyx":140
  *                         ker = g[<unsigned int>(wkx + ii - i),
@@ -2566,8 +2705,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                             top += val * ker
  *                             bot += ker
  */
-            __pyx_t_3 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_3) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_none.pyx":141
  *                                 <unsigned int>(wky + jj - j)]
@@ -2586,9 +2725,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     conv[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L24;
+              goto __pyx_L33;
             }
-            __pyx_L24:;
+            __pyx_L33:;
           }
         }
 
@@ -2599,8 +2738,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     conv[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_3 = (__pyx_v_bot != 0.0);
-        if (__pyx_t_3) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":144
  *                             bot += ker
@@ -2610,13 +2749,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *                     conv[i, j] = fixed[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_37 = __pyx_v_i;
-          __pyx_t_38 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L25;
+          __pyx_t_33 = __pyx_v_i;
+          __pyx_t_34 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L34;
         }
         /*else*/ {
 
@@ -2627,14 +2772,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  *             else:
  *                 conv[i, j] = fixed[i, j]
  */
-          __pyx_t_43 = __pyx_v_i;
-          __pyx_t_44 = __pyx_v_j;
-          __pyx_t_45 = __pyx_v_i;
-          __pyx_t_46 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides));
+          __pyx_t_39 = __pyx_v_i;
+          __pyx_t_40 = __pyx_v_j;
+          __pyx_t_41 = __pyx_v_i;
+          __pyx_t_42 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[1].strides));
         }
-        __pyx_L25:;
-        goto __pyx_L19;
+        __pyx_L34:;
+        goto __pyx_L28;
       }
       /*else*/ {
 
@@ -2645,13 +2790,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
  * 
  *     return conv
  */
-        __pyx_t_47 = __pyx_v_i;
-        __pyx_t_48 = __pyx_v_j;
-        __pyx_t_49 = __pyx_v_i;
-        __pyx_t_50 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[1].strides));
+        __pyx_t_43 = __pyx_v_i;
+        __pyx_t_44 = __pyx_v_j;
+        __pyx_t_45 = __pyx_v_i;
+        __pyx_t_46 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides));
       }
-      __pyx_L19:;
+      __pyx_L28:;
     }
   }
 
@@ -2667,13 +2812,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_none.pyx":80
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_none(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -2697,17 +2849,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_2convolve2d_bou
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_none.pyx":154
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_none(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none = {__Pyx_NAMESTR("convolve3d_boundary_none"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none = {"convolve3d_boundary_none", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve3d_boundary_none (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2721,10 +2884,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve3d_boundary_none", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -2752,6 +2915,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_boundary_none(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2760,14 +2925,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_none_5convolve3d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_none.pyx":154
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve3d_boundary_none(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=3] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_boundary_none(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -2802,33 +2959,33 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
+  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;
-  PyArrayObject *__pyx_t_10 = NULL;
-  PyArrayObject *__pyx_t_11 = NULL;
+  PyArrayObject *__pyx_t_8 = NULL;
+  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
+  unsigned int __pyx_t_11;
   int __pyx_t_12;
   unsigned int __pyx_t_13;
   int __pyx_t_14;
   unsigned int __pyx_t_15;
-  int __pyx_t_16;
+  unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
-  unsigned int __pyx_t_19;
+  long __pyx_t_19;
   unsigned int __pyx_t_20;
-  int __pyx_t_21;
-  int __pyx_t_22;
-  int __pyx_t_23;
-  int __pyx_t_24;
-  long __pyx_t_25;
+  long __pyx_t_21;
+  unsigned int __pyx_t_22;
+  long __pyx_t_23;
+  unsigned int __pyx_t_24;
+  unsigned int __pyx_t_25;
   unsigned int __pyx_t_26;
-  long __pyx_t_27;
+  unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
-  long __pyx_t_29;
+  unsigned int __pyx_t_29;
   unsigned int __pyx_t_30;
   unsigned int __pyx_t_31;
   unsigned int __pyx_t_32;
@@ -2866,12 +3023,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
   unsigned int __pyx_t_64;
   unsigned int __pyx_t_65;
   unsigned int __pyx_t_66;
-  unsigned int __pyx_t_67;
-  unsigned int __pyx_t_68;
-  unsigned int __pyx_t_69;
-  unsigned int __pyx_t_70;
-  unsigned int __pyx_t_71;
-  unsigned int __pyx_t_72;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2910,20 +3061,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    if (!__pyx_t_2) {
-      __pyx_t_3 = (__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1);
-      __pyx_t_4 = __pyx_t_3;
-    } else {
-      __pyx_t_4 = __pyx_t_2;
-    }
-    __pyx_t_2 = __pyx_t_4;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_2 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_none.pyx":158
  * 
@@ -2932,14 +3085,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_none.pyx":160
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -2949,32 +3100,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __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_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_4 = __pyx_t_1;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (unlikely(!__pyx_t_4)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L7_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3066,57 +3221,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=3] conv = np.zeros([nx, ny, nz], dtype=DTYPE)
  * 
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_3 = 0;
   __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
-  __pyx_t_9 = 0;
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fixed.diminfo[2].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[2] [...]
     }
   }
-  __pyx_t_10 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":175
  *     # boundary does not get reset.
@@ -3125,57 +3280,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  * 
  *     cdef unsigned int i, j, k, ii, jj, kk
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
+  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_5 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_11 = ((PyArrayObject *)__pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_conv.diminfo[2].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[2]; __pyx_py [...]
     }
   }
-  __pyx_t_11 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_8);
-  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":185
  *     # Need a first pass to replace NaN values with value convolved from
@@ -3184,9 +3339,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_none.pyx":186
  *     # neighboring values
@@ -3195,9 +3350,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *             for k in range(nz):
  *                 if npy_isnan(f[i, j, k]) and i >= wkx and i < nx - wkx \
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_none.pyx":187
  *     for i in range(nx):
@@ -3206,9 +3361,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                 if npy_isnan(f[i, j, k]) and i >= wkx and i < nx - wkx \
  *                 and j >= wky and j < ny - wky and k >= wkz and k <= nz - wkz:
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_none.pyx":188
  *         for j in range(ny):
@@ -3217,55 +3372,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                 and j >= wky and j < ny - wky and k >= wkz and k <= nz - wkz:
  *                     top = 0.
  */
-        __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_j;
-        __pyx_t_20 = __pyx_v_k;
-        __pyx_t_4 = npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[2].strides)));
-        if (__pyx_t_4) {
-          __pyx_t_2 = (__pyx_v_i >= __pyx_v_wkx);
-          if (__pyx_t_2) {
+        __pyx_t_16 = __pyx_v_i;
+        __pyx_t_17 = __pyx_v_j;
+        __pyx_t_18 = __pyx_v_k;
+        __pyx_t_2 = (npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_f.diminfo[2].strides))) != 0);
+        if (__pyx_t_2) {
+        } else {
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
+        }
+        __pyx_t_2 = ((__pyx_v_i >= __pyx_v_wkx) != 0);
+        if (__pyx_t_2) {
+        } else {
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
+        }
 
-            /* "astropy/convolution/boundary_none.pyx":189
+        /* "astropy/convolution/boundary_none.pyx":189
  *             for k in range(nz):
  *                 if npy_isnan(f[i, j, k]) and i >= wkx and i < nx - wkx \
  *                 and j >= wky and j < ny - wky and k >= wkz and k <= nz - wkz:             # <<<<<<<<<<<<<<
  *                     top = 0.
  *                     bot = 0.
  */
-            __pyx_t_1 = (__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx));
-            if (__pyx_t_1) {
-              __pyx_t_3 = (__pyx_v_j >= __pyx_v_wky);
-              if (__pyx_t_3) {
-                __pyx_t_21 = (__pyx_v_j < (__pyx_v_ny - __pyx_v_wky));
-                if (__pyx_t_21) {
-                  __pyx_t_22 = (__pyx_v_k >= __pyx_v_wkz);
-                  if (__pyx_t_22) {
-                    __pyx_t_23 = (__pyx_v_k <= (__pyx_v_nz - __pyx_v_wkz));
-                    __pyx_t_24 = __pyx_t_23;
-                  } else {
-                    __pyx_t_24 = __pyx_t_22;
-                  }
-                  __pyx_t_22 = __pyx_t_24;
-                } else {
-                  __pyx_t_22 = __pyx_t_21;
-                }
-                __pyx_t_21 = __pyx_t_22;
-              } else {
-                __pyx_t_21 = __pyx_t_3;
-              }
-              __pyx_t_3 = __pyx_t_21;
-            } else {
-              __pyx_t_3 = __pyx_t_1;
-            }
-            __pyx_t_1 = __pyx_t_3;
-          } else {
-            __pyx_t_1 = __pyx_t_2;
-          }
-          __pyx_t_2 = __pyx_t_1;
+        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nx - __pyx_v_wkx)) != 0);
+        if (__pyx_t_2) {
         } else {
-          __pyx_t_2 = __pyx_t_4;
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
         }
+        __pyx_t_2 = ((__pyx_v_j >= __pyx_v_wky) != 0);
         if (__pyx_t_2) {
+        } else {
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
+        }
+        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_ny - __pyx_v_wky)) != 0);
+        if (__pyx_t_2) {
+        } else {
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
+        }
+        __pyx_t_2 = ((__pyx_v_k >= __pyx_v_wkz) != 0);
+        if (__pyx_t_2) {
+        } else {
+          __pyx_t_1 = __pyx_t_2;
+          goto __pyx_L16_bool_binop_done;
+        }
+        __pyx_t_2 = ((__pyx_v_k <= (__pyx_v_nz - __pyx_v_wkz)) != 0);
+        __pyx_t_1 = __pyx_t_2;
+        __pyx_L16_bool_binop_done:;
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":190
  *                 if npy_isnan(f[i, j, k]) and i >= wkx and i < nx - wkx \
@@ -3292,9 +3449,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         for jj in range(j - wky, j + wky + 1):
  *                             for kk in range(k - wkz, k + wkz + 1):
  */
-          __pyx_t_25 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-          for (__pyx_t_26 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-            __pyx_v_ii = __pyx_t_26;
+          __pyx_t_19 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+          for (__pyx_t_20 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_none.pyx":193
  *                     bot = 0.
@@ -3303,9 +3460,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                             for kk in range(k - wkz, k + wkz + 1):
  *                                 val = f[ii, jj, kk]
  */
-            __pyx_t_27 = ((__pyx_v_j + __pyx_v_wky) + 1);
-            for (__pyx_t_28 = (__pyx_v_j - __pyx_v_wky); __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) {
-              __pyx_v_jj = __pyx_t_28;
+            __pyx_t_21 = ((__pyx_v_j + __pyx_v_wky) + 1);
+            for (__pyx_t_22 = (__pyx_v_j - __pyx_v_wky); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_none.pyx":194
  *                     for ii in range(i - wkx, i + wkx + 1):
@@ -3314,9 +3471,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                 val = f[ii, jj, kk]
  *                                 if not npy_isnan(val):
  */
-              __pyx_t_29 = ((__pyx_v_k + __pyx_v_wkz) + 1);
-              for (__pyx_t_30 = (__pyx_v_k - __pyx_v_wkz); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
-                __pyx_v_kk = __pyx_t_30;
+              __pyx_t_23 = ((__pyx_v_k + __pyx_v_wkz) + 1);
+              for (__pyx_t_24 = (__pyx_v_k - __pyx_v_wkz); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_none.pyx":195
  *                         for jj in range(j - wky, j + wky + 1):
@@ -3325,10 +3482,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                 if not npy_isnan(val):
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  */
-                __pyx_t_31 = __pyx_v_ii;
-                __pyx_t_32 = __pyx_v_jj;
-                __pyx_t_33 = __pyx_v_kk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_f.diminfo[2].strides));
+                __pyx_t_25 = __pyx_v_ii;
+                __pyx_t_26 = __pyx_v_jj;
+                __pyx_t_27 = __pyx_v_kk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_none.pyx":196
  *                             for kk in range(k - wkz, k + wkz + 1):
@@ -3337,20 +3494,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  *                                             <unsigned int>(wky + jj - j),
  */
-                __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_2) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
-                  /* "astropy/convolution/boundary_none.pyx":199
- *                                     ker = g[<unsigned int>(wkx + ii - i),
+                  /* "astropy/convolution/boundary_none.pyx":197
+ *                                 val = f[ii, jj, kk]
+ *                                 if not npy_isnan(val):
+ *                                     ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                             <unsigned int>(wky + jj - j),
- *                                             <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                     top += val * ker
- *                                     bot += ker
+ *                                             <unsigned int>(wkz + kk - k)]
  */
-                  __pyx_t_34 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                  __pyx_t_35 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                  __pyx_t_36 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_g.diminfo[2].strides));
+                  __pyx_t_28 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                  __pyx_t_29 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_g.diminfo[2].strides));
 
                   /* "astropy/convolution/boundary_none.pyx":200
  *                                             <unsigned int>(wky + jj - j),
@@ -3369,9 +3526,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         fixed[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L17;
+                  goto __pyx_L29;
                 }
-                __pyx_L17:;
+                __pyx_L29:;
               }
             }
           }
@@ -3383,8 +3540,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         fixed[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_2 = (__pyx_v_bot != 0.);
-          if (__pyx_t_2) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_none.pyx":203
  *                                     bot += ker
@@ -3394,14 +3551,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         fixed[i, j, k] = f[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_26 = __pyx_v_i;
-            __pyx_t_28 = __pyx_v_j;
-            __pyx_t_30 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L18;
+            __pyx_t_20 = __pyx_v_i;
+            __pyx_t_22 = __pyx_v_j;
+            __pyx_t_24 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L30;
           }
           /*else*/ {
 
@@ -3412,16 +3575,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                 else:
  *                     fixed[i, j, k] = f[i, j, k]
  */
-            __pyx_t_37 = __pyx_v_i;
-            __pyx_t_38 = __pyx_v_j;
-            __pyx_t_39 = __pyx_v_k;
-            __pyx_t_40 = __pyx_v_i;
-            __pyx_t_41 = __pyx_v_j;
-            __pyx_t_42 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_3 [...]
+            __pyx_t_31 = __pyx_v_i;
+            __pyx_t_32 = __pyx_v_j;
+            __pyx_t_33 = __pyx_v_k;
+            __pyx_t_34 = __pyx_v_i;
+            __pyx_t_35 = __pyx_v_j;
+            __pyx_t_36 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_3 [...]
           }
-          __pyx_L18:;
-          goto __pyx_L10;
+          __pyx_L30:;
+          goto __pyx_L15;
         }
         /*else*/ {
 
@@ -3432,15 +3595,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  * 
  *     # Now run the proper convolution
  */
-          __pyx_t_43 = __pyx_v_i;
-          __pyx_t_44 = __pyx_v_j;
-          __pyx_t_45 = __pyx_v_k;
-          __pyx_t_46 = __pyx_v_i;
-          __pyx_t_47 = __pyx_v_j;
-          __pyx_t_48 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_44, [...]
+          __pyx_t_37 = __pyx_v_i;
+          __pyx_t_38 = __pyx_v_j;
+          __pyx_t_39 = __pyx_v_k;
+          __pyx_t_40 = __pyx_v_i;
+          __pyx_t_41 = __pyx_v_j;
+          __pyx_t_42 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_38, [...]
         }
-        __pyx_L10:;
+        __pyx_L15:;
       }
     }
   }
@@ -3452,9 +3615,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *         for j in range(wky, ny - wky):
  *             for k in range(wkz, nz - wkz):
  */
-  __pyx_t_12 = (__pyx_v_nx - __pyx_v_wkx);
-  for (__pyx_t_13 = __pyx_v_wkx; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = (__pyx_v_nx - __pyx_v_wkx);
+  for (__pyx_t_11 = __pyx_v_wkx; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_none.pyx":211
  *     # Now run the proper convolution
@@ -3463,9 +3626,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *             for k in range(wkz, nz - wkz):
  *                 if not npy_isnan(fixed[i, j, k]):
  */
-    __pyx_t_14 = (__pyx_v_ny - __pyx_v_wky);
-    for (__pyx_t_15 = __pyx_v_wky; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = (__pyx_v_ny - __pyx_v_wky);
+    for (__pyx_t_13 = __pyx_v_wky; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_none.pyx":212
  *     for i in range(wkx, nx - wkx):
@@ -3474,9 +3637,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                 if not npy_isnan(fixed[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = (__pyx_v_nz - __pyx_v_wkz);
-      for (__pyx_t_17 = __pyx_v_wkz; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = (__pyx_v_nz - __pyx_v_wkz);
+      for (__pyx_t_15 = __pyx_v_wkz; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_none.pyx":213
  *         for j in range(wky, ny - wky):
@@ -3485,11 +3648,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_49 = __pyx_v_i;
-        __pyx_t_50 = __pyx_v_j;
-        __pyx_t_51 = __pyx_v_k;
-        __pyx_t_2 = (!npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[2].strides))));
-        if (__pyx_t_2) {
+        __pyx_t_43 = __pyx_v_i;
+        __pyx_t_44 = __pyx_v_j;
+        __pyx_t_45 = __pyx_v_k;
+        __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[2].strides))) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_none.pyx":214
  *             for k in range(wkz, nz - wkz):
@@ -3516,9 +3679,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         for jj in range(j - wky, j + wky + 1):
  *                             for kk in range(k - wkz, k + wkz + 1):
  */
-          __pyx_t_25 = ((__pyx_v_i + __pyx_v_wkx) + 1);
-          for (__pyx_t_52 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_52 < __pyx_t_25; __pyx_t_52+=1) {
-            __pyx_v_ii = __pyx_t_52;
+          __pyx_t_19 = ((__pyx_v_i + __pyx_v_wkx) + 1);
+          for (__pyx_t_46 = (__pyx_v_i - __pyx_v_wkx); __pyx_t_46 < __pyx_t_19; __pyx_t_46+=1) {
+            __pyx_v_ii = __pyx_t_46;
 
             /* "astropy/convolution/boundary_none.pyx":217
  *                     bot = 0.
@@ -3527,9 +3690,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                             for kk in range(k - wkz, k + wkz + 1):
  *                                 val = fixed[ii, jj, kk]
  */
-            __pyx_t_27 = ((__pyx_v_j + __pyx_v_wky) + 1);
-            for (__pyx_t_53 = (__pyx_v_j - __pyx_v_wky); __pyx_t_53 < __pyx_t_27; __pyx_t_53+=1) {
-              __pyx_v_jj = __pyx_t_53;
+            __pyx_t_21 = ((__pyx_v_j + __pyx_v_wky) + 1);
+            for (__pyx_t_47 = (__pyx_v_j - __pyx_v_wky); __pyx_t_47 < __pyx_t_21; __pyx_t_47+=1) {
+              __pyx_v_jj = __pyx_t_47;
 
               /* "astropy/convolution/boundary_none.pyx":218
  *                     for ii in range(i - wkx, i + wkx + 1):
@@ -3538,9 +3701,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                 val = fixed[ii, jj, kk]
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  */
-              __pyx_t_29 = ((__pyx_v_k + __pyx_v_wkz) + 1);
-              for (__pyx_t_54 = (__pyx_v_k - __pyx_v_wkz); __pyx_t_54 < __pyx_t_29; __pyx_t_54+=1) {
-                __pyx_v_kk = __pyx_t_54;
+              __pyx_t_23 = ((__pyx_v_k + __pyx_v_wkz) + 1);
+              for (__pyx_t_48 = (__pyx_v_k - __pyx_v_wkz); __pyx_t_48 < __pyx_t_23; __pyx_t_48+=1) {
+                __pyx_v_kk = __pyx_t_48;
 
                 /* "astropy/convolution/boundary_none.pyx":219
  *                         for jj in range(j - wky, j + wky + 1):
@@ -3549,22 +3712,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  *                                         <unsigned int>(wky + jj - j),
  */
-                __pyx_t_55 = __pyx_v_ii;
-                __pyx_t_56 = __pyx_v_jj;
-                __pyx_t_57 = __pyx_v_kk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_fixed.diminfo[2].strides));
+                __pyx_t_49 = __pyx_v_ii;
+                __pyx_t_50 = __pyx_v_jj;
+                __pyx_t_51 = __pyx_v_kk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[2].strides));
 
-                /* "astropy/convolution/boundary_none.pyx":222
- *                                 ker = g[<unsigned int>(wkx + ii - i),
+                /* "astropy/convolution/boundary_none.pyx":220
+ *                             for kk in range(k - wkz, k + wkz + 1):
+ *                                 val = fixed[ii, jj, kk]
+ *                                 ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                         <unsigned int>(wky + jj - j),
- *                                         <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                 if not npy_isnan(val):
- *                                     top += val * ker
+ *                                         <unsigned int>(wkz + kk - k)]
  */
-                __pyx_t_58 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                __pyx_t_59 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                __pyx_t_60 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_g.diminfo[2].strides));
+                __pyx_t_52 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                __pyx_t_53 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                __pyx_t_54 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_g.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_none.pyx":223
  *                                         <unsigned int>(wky + jj - j),
@@ -3573,8 +3736,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                                     top += val * ker
  *                                     bot += ker
  */
-                __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_2) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_none.pyx":224
  *                                         <unsigned int>(wkz + kk - k)]
@@ -3593,9 +3756,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L32;
+                  goto __pyx_L44;
                 }
-                __pyx_L32:;
+                __pyx_L44:;
               }
             }
           }
@@ -3607,8 +3770,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_2 = (__pyx_v_bot != 0.0);
-          if (__pyx_t_2) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_none.pyx":227
  *                                     bot += ker
@@ -3618,14 +3781,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                         conv[i, j, k] = fixed[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_52 = __pyx_v_i;
-            __pyx_t_53 = __pyx_v_j;
-            __pyx_t_54 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L33;
+            __pyx_t_46 = __pyx_v_i;
+            __pyx_t_47 = __pyx_v_j;
+            __pyx_t_48 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L45;
           }
           /*else*/ {
 
@@ -3636,16 +3805,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  *                 else:
  *                     conv[i, j, k] = fixed[i, j, k]
  */
-            __pyx_t_61 = __pyx_v_i;
-            __pyx_t_62 = __pyx_v_j;
-            __pyx_t_63 = __pyx_v_k;
-            __pyx_t_64 = __pyx_v_i;
-            __pyx_t_65 = __pyx_v_j;
-            __pyx_t_66 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
+            __pyx_t_55 = __pyx_v_i;
+            __pyx_t_56 = __pyx_v_j;
+            __pyx_t_57 = __pyx_v_k;
+            __pyx_t_58 = __pyx_v_i;
+            __pyx_t_59 = __pyx_v_j;
+            __pyx_t_60 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
           }
-          __pyx_L33:;
-          goto __pyx_L25;
+          __pyx_L45:;
+          goto __pyx_L37;
         }
         /*else*/ {
 
@@ -3656,15 +3825,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
  * 
  *     return conv
  */
-          __pyx_t_67 = __pyx_v_i;
-          __pyx_t_68 = __pyx_v_j;
-          __pyx_t_69 = __pyx_v_k;
-          __pyx_t_70 = __pyx_v_i;
-          __pyx_t_71 = __pyx_v_j;
-          __pyx_t_72 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_72, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
+          __pyx_t_61 = __pyx_v_i;
+          __pyx_t_62 = __pyx_v_j;
+          __pyx_t_63 = __pyx_v_k;
+          __pyx_t_64 = __pyx_v_i;
+          __pyx_t_65 = __pyx_v_j;
+          __pyx_t_66 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_none_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
         }
-        __pyx_L25:;
+        __pyx_L37:;
       }
     }
   }
@@ -3679,14 +3848,21 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_none.pyx":154
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_none(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -3710,6 +3886,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_none_4convolve3d_bou
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -3717,18 +3901,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -3744,13 +3922,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3760,22 +3936,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -3784,7 +3958,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -3793,7 +3967,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -3802,17 +3976,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -3824,7 +3998,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -3835,87 +4009,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -3924,7 +4098,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -3933,16 +4107,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -3951,7 +4126,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -3960,18 +4135,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -3980,7 +4155,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -3989,11 +4164,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -4002,7 +4177,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -4011,9 +4186,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -4022,7 +4197,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -4031,16 +4206,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -4049,19 +4224,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -4070,23 +4245,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -4098,11 +4275,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -4115,328 +4292,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -4445,7 +4598,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -4454,11 +4607,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -4467,7 +4619,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -4476,7 +4628,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -4485,17 +4637,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -4504,13 +4656,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -4529,39 +4689,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -4573,17 +4735,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -4595,10 +4757,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -4615,7 +4786,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -4629,8 +4800,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4641,7 +4819,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -4658,7 +4836,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -4672,8 +4850,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4684,7 +4869,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -4701,7 +4886,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -4715,8 +4900,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4727,7 +4919,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -4744,7 +4936,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -4758,8 +4950,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4770,7 +4969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -4787,7 +4986,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -4801,8 +5000,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4813,7 +5019,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -4835,20 +5041,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -4857,7 +5060,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -4866,18 +5069,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -4885,33 +5088,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -4933,129 +5134,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
     } else {
-      __pyx_t_8 = __pyx_t_7;
     }
-    if (!__pyx_t_8) {
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
+    } else {
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -5063,15 +5234,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -5080,7 +5251,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5089,413 +5260,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5503,25 +5671,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -5531,13 +5707,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -5550,7 +5732,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -5562,9 +5744,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -5572,9 +5755,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -5586,7 +5770,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -5595,7 +5779,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -5606,7 +5790,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -5615,7 +5799,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -5624,10 +5808,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -5641,17 +5834,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -5662,11 +5855,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -5676,9 +5868,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -5696,7 +5895,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("boundary_none"),
+    "boundary_none",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -5708,64 +5907,65 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
-  {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
-  {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
-  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
-  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
-  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
-  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
-  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
-  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
-  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
-  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
-  {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bot, __pyx_k__bot, sizeof(__pyx_k__bot), 0, 0, 1, 1},
-  {&__pyx_n_s__conv, __pyx_k__conv, sizeof(__pyx_k__conv), 0, 0, 1, 1},
-  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
-  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
-  {&__pyx_n_s__fixed, __pyx_k__fixed, sizeof(__pyx_k__fixed), 0, 0, 1, 1},
-  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
-  {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 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__iimax, __pyx_k__iimax, sizeof(__pyx_k__iimax), 0, 0, 1, 1},
-  {&__pyx_n_s__iimin, __pyx_k__iimin, sizeof(__pyx_k__iimin), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__jj, __pyx_k__jj, sizeof(__pyx_k__jj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmax, __pyx_k__jjmax, sizeof(__pyx_k__jjmax), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmin, __pyx_k__jjmin, sizeof(__pyx_k__jjmin), 0, 0, 1, 1},
-  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
-  {&__pyx_n_s__ker, __pyx_k__ker, sizeof(__pyx_k__ker), 0, 0, 1, 1},
-  {&__pyx_n_s__kk, __pyx_k__kk, sizeof(__pyx_k__kk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmax, __pyx_k__kkmax, sizeof(__pyx_k__kkmax), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmin, __pyx_k__kkmin, sizeof(__pyx_k__kkmin), 0, 0, 1, 1},
-  {&__pyx_n_s__nkx, __pyx_k__nkx, sizeof(__pyx_k__nkx), 0, 0, 1, 1},
-  {&__pyx_n_s__nky, __pyx_k__nky, sizeof(__pyx_k__nky), 0, 0, 1, 1},
-  {&__pyx_n_s__nkz, __pyx_k__nkz, sizeof(__pyx_k__nkz), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__nx, __pyx_k__nx, sizeof(__pyx_k__nx), 0, 0, 1, 1},
-  {&__pyx_n_s__ny, __pyx_k__ny, sizeof(__pyx_k__ny), 0, 0, 1, 1},
-  {&__pyx_n_s__nz, __pyx_k__nz, sizeof(__pyx_k__nz), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1},
-  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
-  {&__pyx_n_s__wkx, __pyx_k__wkx, sizeof(__pyx_k__wkx), 0, 0, 1, 1},
-  {&__pyx_n_s__wky, __pyx_k__wky, sizeof(__pyx_k__wky), 0, 0, 1, 1},
-  {&__pyx_n_s__wkz, __pyx_k__wkz, sizeof(__pyx_k__wkz), 0, 0, 1, 1},
-  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
+  {&__pyx_kp_s_Convolution_kernel_must_have_odd, __pyx_k_Convolution_kernel_must_have_odd, sizeof(__pyx_k_Convolution_kernel_must_have_odd), 0, 0, 1, 0},
+  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s_astropy_convolution_boundary_non, __pyx_k_astropy_convolution_boundary_non, sizeof(__pyx_k_astropy_convolution_boundary_non), 0, 0, 1, 1},
+  {&__pyx_n_s_bot, __pyx_k_bot, sizeof(__pyx_k_bot), 0, 0, 1, 1},
+  {&__pyx_n_s_conv, __pyx_k_conv, sizeof(__pyx_k_conv), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve1d_boundary_none, __pyx_k_convolve1d_boundary_none, sizeof(__pyx_k_convolve1d_boundary_none), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve2d_boundary_none, __pyx_k_convolve2d_boundary_none, sizeof(__pyx_k_convolve2d_boundary_none), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve3d_boundary_none, __pyx_k_convolve3d_boundary_none, sizeof(__pyx_k_convolve3d_boundary_none), 0, 0, 1, 1},
+  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
+  {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
+  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
+  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 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_iimax, __pyx_k_iimax, sizeof(__pyx_k_iimax), 0, 0, 1, 1},
+  {&__pyx_n_s_iimin, __pyx_k_iimin, sizeof(__pyx_k_iimin), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmax, __pyx_k_jjmax, sizeof(__pyx_k_jjmax), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmin, __pyx_k_jjmin, sizeof(__pyx_k_jjmin), 0, 0, 1, 1},
+  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+  {&__pyx_n_s_ker, __pyx_k_ker, sizeof(__pyx_k_ker), 0, 0, 1, 1},
+  {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmax, __pyx_k_kkmax, sizeof(__pyx_k_kkmax), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmin, __pyx_k_kkmin, sizeof(__pyx_k_kkmin), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_nkx, __pyx_k_nkx, sizeof(__pyx_k_nkx), 0, 0, 1, 1},
+  {&__pyx_n_s_nky, __pyx_k_nky, sizeof(__pyx_k_nky), 0, 0, 1, 1},
+  {&__pyx_n_s_nkz, __pyx_k_nkz, sizeof(__pyx_k_nkz), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
+  {&__pyx_n_s_ny, __pyx_k_ny, sizeof(__pyx_k_ny), 0, 0, 1, 1},
+  {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
+  {&__pyx_n_s_wkx, __pyx_k_wkx, sizeof(__pyx_k_wkx), 0, 0, 1, 1},
+  {&__pyx_n_s_wky, __pyx_k_wky, sizeof(__pyx_k_wky), 0, 0, 1, 1},
+  {&__pyx_n_s_wkz, __pyx_k_wkz, sizeof(__pyx_k_wkz), 0, 0, 1, 1},
+  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -5782,9 +5982,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_2);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
   /* "astropy/convolution/boundary_none.pyx":84
  * 
@@ -5793,9 +5993,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_3);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
   /* "astropy/convolution/boundary_none.pyx":158
  * 
@@ -5804,75 +6004,75 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_6);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_8);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_14);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_16);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
   /* "astropy/convolution/boundary_none.pyx":16
  * 
@@ -5881,10 +6081,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_k_tuple_17 = PyTuple_Pack(15, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__iimin), ((PyObject *)__pyx_n_s__iimax), ((PyObject *)__pyx_n_s__top), ((PyObject *)__pyx_n_s__bot), ((PyObject *)__pyx_n_s__ker), ((PyObject *)__pyx_n_s__val)); if ( [...]
-  __Pyx_GOTREF(__pyx_k_tuple_17);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-  __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_19, 16, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(15, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_nkx, __pyx_n_s_wkx, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_ii, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve1d_boundary_none, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_none.pyx":80
  * 
@@ -5893,10 +6093,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_k_tuple_22 = PyTuple_Pack(22, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__jj), ((PyObject *)__pyx_n_s__iimin), ((PyObject  [...]
-  __Pyx_GOTREF(__pyx_k_tuple_22);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
-  __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(2, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_24, 80, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(22, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve2d_boundary_none, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_none.pyx":154
  * 
@@ -5905,10 +6105,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_k_tuple_25 = PyTuple_Pack(29, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nz), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__nkz), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__wkz), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject * [...]
-  __Pyx_GOTREF(__pyx_k_tuple_25);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-  __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(2, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_27, 154, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__14 = PyTuple_Pack(29, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_nkz, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_wkz, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_kkmin, __pyx_n_s_kkmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_ [...]
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve3d_boundary_none, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -5918,7 +6118,6 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -5934,6 +6133,9 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -5966,11 +6168,26 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("boundary_none"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("boundary_none", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__convolution__boundary_none) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -5979,16 +6196,6 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__convolution__boundary_none) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -6021,9 +6228,9 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  * cimport numpy as np
  * 
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":6
@@ -6033,12 +6240,12 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  * ctypedef np.float_t DTYPE_t
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":16
@@ -6048,9 +6255,9 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  *                              np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_1convolve1d_boundary_none, NULL, __pyx_n_s_astropy_convolution_boundary_non); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve1d_boundary_none, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":80
@@ -6060,9 +6267,9 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  *                              np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_3convolve2d_boundary_none, NULL, __pyx_n_s_astropy_convolution_boundary_non); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_24, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve2d_boundary_none, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":154
@@ -6072,9 +6279,9 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  *                              np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_none_5convolve3d_boundary_none, NULL, __pyx_n_s_astropy_convolution_boundary_non); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_27, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve3d_boundary_none, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_none.pyx":1
@@ -6083,23 +6290,28 @@ PyMODINIT_FUNC PyInit_boundary_none(void)
  * import numpy as np
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.convolution.boundary_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.convolution.boundary_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.convolution.boundary_none");
@@ -6128,19 +6340,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -6165,7 +6375,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -6269,12 +6479,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -6284,23 +6494,29 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -6352,7 +6568,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -6597,7 +6813,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -6605,7 +6821,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -6614,7 +6830,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -6644,8 +6860,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -6685,10 +6903,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -6713,7 +6931,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -6725,7 +6943,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -6738,12 +6956,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -6764,21 +6982,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -6853,11 +7075,30 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
     return r;
 }
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-    PyThreadState *tstate = PyThreadState_GET();
-    tmp_type = tstate->curexc_type;
+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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    PyObject *tmp_type, *tmp_value, *tmp_tb;
+    PyThreadState *tstate = PyThreadState_GET();
+    tmp_type = tstate->curexc_type;
     tmp_value = tstate->curexc_value;
     tmp_tb = tstate->curexc_traceback;
     tstate->curexc_type = type;
@@ -6902,11 +7143,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -6921,26 +7158,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -6950,7 +7174,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -6971,46 +7195,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -7020,6 +7260,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -7027,6 +7274,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -7034,6 +7282,23 @@ bad:
 }
 #endif
 
+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;
+}
+
 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
@@ -7043,7 +7308,7 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -7060,7 +7325,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -7068,133 +7333,195 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-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;
+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) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    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;
     }
-    return 0;
-#endif
+    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);
 }
 
-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();
+#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
     }
-    return 0;
+    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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
-    PyErr_WriteUnraisable(obj);
-nofail:
     Py_DECREF(obj);
     view->obj = NULL;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
+#endif
 
 
-    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+      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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -7212,7 +7539,6 @@ nofail:
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -7234,7 +7560,7 @@ nofail:
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -7251,14 +7577,6 @@ nofail:
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -7268,29 +7586,223 @@ bad:
     return module;
 }
 
-#if CYTHON_CCOMPLEX
-  #ifdef __cplusplus
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      return ::std::complex< float >(x, y);
-    }
-  #else
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      return x + y*(__pyx_t_float_complex)_Complex_I;
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
     }
-  #endif
-#else
-    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      __pyx_t_float_complex z;
-      z.real = x;
-      z.imag = y;
-      return z;
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(int),
+                                     little, !is_unsigned);
     }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
 #endif
 
-#if CYTHON_CCOMPLEX
-#else
-    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-       return (a.real == b.real) && (a.imag == b.imag);
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (unsigned int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(unsigned int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, 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
+            unsigned int val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (unsigned int) -1;
+        }
+    } else {
+        unsigned int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned int) -1;
+        val = __Pyx_PyInt_As_unsigned_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to unsigned int");
+    return (unsigned int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to unsigned int");
+    return (unsigned int) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(unsigned int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(unsigned int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
+                                     little, !is_unsigned);
+    }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
+    }
+}
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return ::std::complex< float >(x, y);
+    }
+  #else
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return x + y*(__pyx_t_float_complex)_Complex_I;
+    }
+  #endif
+#else
+    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      __pyx_t_float_complex z;
+      z.real = x;
+      z.imag = y;
+      return z;
+    }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+       return (a.real == b.real) && (a.imag == b.imag);
     }
     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
         __pyx_t_float_complex z;
@@ -7508,404 +8020,194 @@ bad:
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
+#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 (unsigned int)-1;
+            return (int) val;
         }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
             }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
             }
-            return (signed short)-1;
         }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
+        {
+#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_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
+ #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;
             }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (unsigned long)PyLong_AsLong(x);
+            return (int) -1;
         }
     } else {
-        unsigned long val;
+        int val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
+        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;
 }
 
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
         } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (long) val;
         }
-        return (long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
-        }
-        return (signed long)val;
-    } else
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
         }
-        return (signed PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+        {
+#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_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+ #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 {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        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;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -7918,11 +8220,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -7972,7 +8270,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -7992,15 +8290,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -8012,168 +8306,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -8184,7 +8316,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -8204,6 +8336,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -8213,14 +8410,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -8236,13 +8433,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -8256,35 +8453,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/convolution/boundary_wrap.c b/astropy/convolution/boundary_wrap.c
index 58809f7..c198d6a 100644
--- a/astropy/convolution/boundary_wrap.c
+++ b/astropy/convolution/boundary_wrap.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -265,17 +247,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -289,40 +260,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -354,20 +442,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "boundary_wrap.pyx",
-  "numpy.pxd",
+  "astropy/convolution/boundary_wrap.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -394,7 +482,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -403,7 +491,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -412,7 +500,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -421,7 +509,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -430,7 +518,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -439,7 +527,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -448,7 +536,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -457,7 +545,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -466,7 +554,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -475,7 +563,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -484,7 +572,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -493,7 +581,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -502,7 +590,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -511,7 +599,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -520,7 +608,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -529,7 +617,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -538,7 +626,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -547,7 +635,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -556,7 +644,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -565,7 +653,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -574,7 +662,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -614,7 +702,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_wrap_DT
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -623,7 +711,7 @@ typedef __pyx_t_5numpy_float_t __pyx_t_7astropy_11convolution_13boundary_wrap_DT
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -632,7 +720,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -641,7 +729,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -662,7 +750,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -699,23 +787,46 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
@@ -723,18 +834,30 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
 static CYTHON_INLINE int __Pyx_mod_int(int, int); /* proto */
 
+#ifndef __PYX_FORCE_INIT_THREADS
+  #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -743,9 +866,22 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -772,7 +908,13 @@ typedef struct {
 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -786,7 +928,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -872,37 +1014,9 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -914,28 +1028,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+static PyObject *__Pyx_ImportModule(const char *name);
 
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -981,158 +1078,170 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_boundary_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "Convolution kernel must have odd dimensions";
-static char __pyx_k_5[] = "ndarray is not C contiguous";
-static char __pyx_k_7[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_9[] = "Non-native byte order not supported";
-static char __pyx_k_11[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_12[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_15[] = "Format string allocated too short.";
-static char __pyx_k_19[] = "convolve1d_boundary_wrap";
-static char __pyx_k_20[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_wrap.pyx";
-static char __pyx_k_21[] = "astropy.convolution.boundary_wrap";
-static char __pyx_k_24[] = "convolve2d_boundary_wrap";
-static char __pyx_k_27[] = "convolve3d_boundary_wrap";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__ii[] = "ii";
-static char __pyx_k__jj[] = "jj";
-static char __pyx_k__kk[] = "kk";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__nx[] = "nx";
-static char __pyx_k__ny[] = "ny";
-static char __pyx_k__nz[] = "nz";
-static char __pyx_k__bot[] = "bot";
-static char __pyx_k__iii[] = "iii";
-static char __pyx_k__jjj[] = "jjj";
-static char __pyx_k__ker[] = "ker";
-static char __pyx_k__kkk[] = "kkk";
-static char __pyx_k__nkx[] = "nkx";
-static char __pyx_k__nky[] = "nky";
-static char __pyx_k__nkz[] = "nkz";
-static char __pyx_k__top[] = "top";
-static char __pyx_k__val[] = "val";
-static char __pyx_k__wkx[] = "wkx";
-static char __pyx_k__wky[] = "wky";
-static char __pyx_k__wkz[] = "wkz";
-static char __pyx_k__conv[] = "conv";
-static char __pyx_k__DTYPE[] = "DTYPE";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__fixed[] = "fixed";
-static char __pyx_k__float[] = "float";
-static char __pyx_k__iimax[] = "iimax";
-static char __pyx_k__iimin[] = "iimin";
-static char __pyx_k__jjmax[] = "jjmax";
-static char __pyx_k__jjmin[] = "jjmin";
-static char __pyx_k__kkmax[] = "kkmax";
-static char __pyx_k__kkmin[] = "kkmin";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_n_s_19;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_n_s_21;
-static PyObject *__pyx_n_s_24;
-static PyObject *__pyx_n_s_27;
-static PyObject *__pyx_kp_u_5;
-static PyObject *__pyx_kp_u_7;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__DTYPE;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bot;
-static PyObject *__pyx_n_s__conv;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__f;
-static PyObject *__pyx_n_s__fixed;
-static PyObject *__pyx_n_s__float;
-static PyObject *__pyx_n_s__g;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__ii;
-static PyObject *__pyx_n_s__iii;
-static PyObject *__pyx_n_s__iimax;
-static PyObject *__pyx_n_s__iimin;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__jj;
-static PyObject *__pyx_n_s__jjj;
-static PyObject *__pyx_n_s__jjmax;
-static PyObject *__pyx_n_s__jjmin;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__ker;
-static PyObject *__pyx_n_s__kk;
-static PyObject *__pyx_n_s__kkk;
-static PyObject *__pyx_n_s__kkmax;
-static PyObject *__pyx_n_s__kkmin;
-static PyObject *__pyx_n_s__nkx;
-static PyObject *__pyx_n_s__nky;
-static PyObject *__pyx_n_s__nkz;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__nx;
-static PyObject *__pyx_n_s__ny;
-static PyObject *__pyx_n_s__nz;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__top;
-static PyObject *__pyx_n_s__val;
-static PyObject *__pyx_n_s__wkx;
-static PyObject *__pyx_n_s__wky;
-static PyObject *__pyx_n_s__wkz;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_codeobj_18;
-static PyObject *__pyx_k_codeobj_23;
-static PyObject *__pyx_k_codeobj_26;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_ii[] = "ii";
+static char __pyx_k_jj[] = "jj";
+static char __pyx_k_kk[] = "kk";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_nx[] = "nx";
+static char __pyx_k_ny[] = "ny";
+static char __pyx_k_nz[] = "nz";
+static char __pyx_k_bot[] = "bot";
+static char __pyx_k_iii[] = "iii";
+static char __pyx_k_jjj[] = "jjj";
+static char __pyx_k_ker[] = "ker";
+static char __pyx_k_kkk[] = "kkk";
+static char __pyx_k_nkx[] = "nkx";
+static char __pyx_k_nky[] = "nky";
+static char __pyx_k_nkz[] = "nkz";
+static char __pyx_k_top[] = "top";
+static char __pyx_k_val[] = "val";
+static char __pyx_k_wkx[] = "wkx";
+static char __pyx_k_wky[] = "wky";
+static char __pyx_k_wkz[] = "wkz";
+static char __pyx_k_conv[] = "conv";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_DTYPE[] = "DTYPE";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_fixed[] = "fixed";
+static char __pyx_k_float[] = "float";
+static char __pyx_k_iimax[] = "iimax";
+static char __pyx_k_iimin[] = "iimin";
+static char __pyx_k_jjmax[] = "jjmax";
+static char __pyx_k_jjmin[] = "jjmin";
+static char __pyx_k_kkmax[] = "kkmax";
+static char __pyx_k_kkmin[] = "kkmin";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_convolve1d_boundary_wrap[] = "convolve1d_boundary_wrap";
+static char __pyx_k_convolve2d_boundary_wrap[] = "convolve2d_boundary_wrap";
+static char __pyx_k_convolve3d_boundary_wrap[] = "convolve3d_boundary_wrap";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/convolution/boundary_wrap.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Convolution_kernel_must_have_odd[] = "Convolution kernel must have odd dimensions";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_astropy_convolution_boundary_wra[] = "astropy.convolution.boundary_wrap";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_Convolution_kernel_must_have_odd;
+static PyObject *__pyx_n_s_DTYPE;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_astropy_convolution_boundary_wra;
+static PyObject *__pyx_n_s_bot;
+static PyObject *__pyx_n_s_conv;
+static PyObject *__pyx_n_s_convolve1d_boundary_wrap;
+static PyObject *__pyx_n_s_convolve2d_boundary_wrap;
+static PyObject *__pyx_n_s_convolve3d_boundary_wrap;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_fixed;
+static PyObject *__pyx_n_s_float;
+static PyObject *__pyx_n_s_g;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_ii;
+static PyObject *__pyx_n_s_iii;
+static PyObject *__pyx_n_s_iimax;
+static PyObject *__pyx_n_s_iimin;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_jj;
+static PyObject *__pyx_n_s_jjj;
+static PyObject *__pyx_n_s_jjmax;
+static PyObject *__pyx_n_s_jjmin;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_ker;
+static PyObject *__pyx_n_s_kk;
+static PyObject *__pyx_n_s_kkk;
+static PyObject *__pyx_n_s_kkmax;
+static PyObject *__pyx_n_s_kkmin;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_nkx;
+static PyObject *__pyx_n_s_nky;
+static PyObject *__pyx_n_s_nkz;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_nx;
+static PyObject *__pyx_n_s_ny;
+static PyObject *__pyx_n_s_nz;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_top;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_wkx;
+static PyObject *__pyx_n_s_wky;
+static PyObject *__pyx_n_s_wkz;
+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_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
+
+/* "astropy/convolution/boundary_wrap.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_wrap(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap = {__Pyx_NAMESTR("convolve1d_boundary_wrap"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap = {"convolve1d_boundary_wrap", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve1d_boundary_wrap (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1146,10 +1255,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve1d_boundary_wrap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1177,6 +1286,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boundary_wrap(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1185,14 +1296,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_1convolve1d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_wrap.pyx":16
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve1d_boundary_wrap(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=1] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boundary_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_nkx;
@@ -1223,15 +1326,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
   unsigned int __pyx_t_11;
-  unsigned int __pyx_t_12;
+  int __pyx_t_12;
   int __pyx_t_13;
-  int __pyx_t_14;
+  unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
   unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
@@ -1246,7 +1349,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
   unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
-  unsigned int __pyx_t_29;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1285,7 +1387,7 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
+  __pyx_t_1 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
   if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_wrap.pyx":20
@@ -1295,14 +1397,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_wrap.pyx":22
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -1312,32 +1412,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_1) {
-    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_5) {
+    } else {
+      __pyx_t_1 = __pyx_t_5;
+      goto __pyx_L4_bool_binop_done;
+    }
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __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_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_1;
-  }
-  if (unlikely(!__pyx_t_6)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L4_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -1375,12 +1479,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *     cdef np.ndarray[DTYPE_t, ndim=1] conv = np.empty([nx], dtype=DTYPE)
  *     cdef unsigned int i, iii
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -1389,33 +1493,33 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
   __pyx_t_2 = 0;
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
   __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":28
  *     cdef int wkx = nkx // 2
@@ -1424,45 +1528,45 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *     cdef unsigned int i, iii
  *     cdef int ii
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
   __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
@@ -1473,9 +1577,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *         if npy_isnan(f[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_wrap.pyx":39
  *     # neighboring values
@@ -1484,9 +1588,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_12 = __pyx_v_i;
-    __pyx_t_6 = npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_f.diminfo[0].strides)));
-    if (__pyx_t_6) {
+    __pyx_t_11 = __pyx_v_i;
+    __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_f.diminfo[0].strides))) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_wrap.pyx":40
  *     for i in range(nx):
@@ -1531,9 +1635,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 iii = ii % nx
  *                 val = f[iii]
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_wrap.pyx":45
  *             iimax = i + wkx + 1
@@ -1543,7 +1647,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 if not npy_isnan(val):
  */
         if (unlikely(__pyx_v_nx == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -1555,8 +1665,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  */
-        __pyx_t_15 = __pyx_v_iii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f.diminfo[0].strides));
+        __pyx_t_14 = __pyx_v_iii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_wrap.pyx":47
  *                 iii = ii % nx
@@ -1565,8 +1675,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                     ker = g[<unsigned int>(wkx + ii - i)]
  *                     top += val * ker
  */
-        __pyx_t_6 = (!npy_isnan(__pyx_v_val));
-        if (__pyx_t_6) {
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":48
  *                 val = f[iii]
@@ -1575,8 +1685,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-          __pyx_t_16 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_g.diminfo[0].strides));
+          __pyx_t_15 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+          __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_g.diminfo[0].strides));
 
           /* "astropy/convolution/boundary_wrap.pyx":49
  *                 if not npy_isnan(val):
@@ -1595,9 +1705,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *             if bot != 0.:
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L9;
+          goto __pyx_L11;
         }
-        __pyx_L9:;
+        __pyx_L11:;
       }
 
       /* "astropy/convolution/boundary_wrap.pyx":52
@@ -1607,8 +1717,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 fixed[i] = top / bot
  *             else:
  */
-      __pyx_t_6 = (__pyx_v_bot != 0.);
-      if (__pyx_t_6) {
+      __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_wrap.pyx":53
  * 
@@ -1618,12 +1728,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 fixed[i] = f[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_17 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L10;
+        __pyx_t_16 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_fixed.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -1634,12 +1750,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *         else:
  *             fixed[i] = f[i]
  */
+        __pyx_t_17 = __pyx_v_i;
         __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_f.diminfo[0].strides));
       }
-      __pyx_L10:;
-      goto __pyx_L6;
+      __pyx_L12:;
+      goto __pyx_L8;
     }
     /*else*/ {
 
@@ -1650,11 +1766,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  * 
  *     # Now run the proper convolution
  */
+      __pyx_t_19 = __pyx_v_i;
       __pyx_t_20 = __pyx_v_i;
-      __pyx_t_21 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_fixed.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides));
     }
-    __pyx_L6:;
+    __pyx_L8:;
   }
 
   /* "astropy/convolution/boundary_wrap.pyx":60
@@ -1664,9 +1780,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *         if not npy_isnan(fixed[i]):
  *             top = 0.
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_wrap.pyx":61
  *     # Now run the proper convolution
@@ -1675,9 +1791,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *             top = 0.
  *             bot = 0.
  */
-    __pyx_t_22 = __pyx_v_i;
-    __pyx_t_6 = (!npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides))));
-    if (__pyx_t_6) {
+    __pyx_t_21 = __pyx_v_i;
+    __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_fixed.diminfo[0].strides))) != 0)) != 0);
+    if (__pyx_t_1) {
 
       /* "astropy/convolution/boundary_wrap.pyx":62
  *     for i in range(nx):
@@ -1722,9 +1838,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 iii = ii % nx
  *                 val = fixed[iii]
  */
-      __pyx_t_13 = __pyx_v_iimax;
-      for (__pyx_t_14 = __pyx_v_iimin; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-        __pyx_v_ii = __pyx_t_14;
+      __pyx_t_12 = __pyx_v_iimax;
+      for (__pyx_t_13 = __pyx_v_iimin; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+        __pyx_v_ii = __pyx_t_13;
 
         /* "astropy/convolution/boundary_wrap.pyx":67
  *             iimax = i + wkx + 1
@@ -1734,7 +1850,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  */
         if (unlikely(__pyx_v_nx == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -1746,8 +1868,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 ker = g[<unsigned int>(wkx + ii - i)]
  *                 if not npy_isnan(val):
  */
-        __pyx_t_23 = __pyx_v_iii;
-        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        __pyx_t_22 = __pyx_v_iii;
+        __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fixed.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_wrap.pyx":69
  *                 iii = ii % nx
@@ -1756,8 +1878,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 if not npy_isnan(val):
  *                     top += val * ker
  */
-        __pyx_t_24 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_g.diminfo[0].strides));
+        __pyx_t_23 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+        __pyx_v_ker = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_g.diminfo[0].strides));
 
         /* "astropy/convolution/boundary_wrap.pyx":70
  *                 val = fixed[iii]
@@ -1766,8 +1888,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                     top += val * ker
  *                     bot += ker
  */
-        __pyx_t_6 = (!npy_isnan(__pyx_v_val));
-        if (__pyx_t_6) {
+        __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":71
  *                 ker = g[<unsigned int>(wkx + ii - i)]
@@ -1786,9 +1908,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 conv[i] = top / bot
  */
           __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-          goto __pyx_L16;
+          goto __pyx_L18;
         }
-        __pyx_L16:;
+        __pyx_L18:;
       }
 
       /* "astropy/convolution/boundary_wrap.pyx":73
@@ -1798,8 +1920,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 conv[i] = top / bot
  *             else:
  */
-      __pyx_t_6 = (__pyx_v_bot != 0.0);
-      if (__pyx_t_6) {
+      __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_wrap.pyx":74
  *                     bot += ker
@@ -1809,12 +1931,18 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *                 conv[i] = fixed[i]
  */
         if (unlikely(__pyx_v_bot == 0)) {
-          PyErr_Format(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+          #endif
+          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+          #ifdef WITH_THREAD
+          PyGILState_Release(__pyx_gilstate_save);
+          #endif
           {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_t_25 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
-        goto __pyx_L17;
+        __pyx_t_24 = __pyx_v_i;
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_conv.diminfo[0].strides) = (__pyx_v_top / __pyx_v_bot);
+        goto __pyx_L19;
       }
       /*else*/ {
 
@@ -1825,12 +1953,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  *         else:
  *             conv[i] = fixed[i]
  */
+        __pyx_t_25 = __pyx_v_i;
         __pyx_t_26 = __pyx_v_i;
-        __pyx_t_27 = __pyx_v_i;
-        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_fixed.diminfo[0].strides));
+        *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[0].strides));
       }
-      __pyx_L17:;
-      goto __pyx_L13;
+      __pyx_L19:;
+      goto __pyx_L15;
     }
     /*else*/ {
 
@@ -1841,11 +1969,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
  * 
  *     return conv
  */
+      __pyx_t_27 = __pyx_v_i;
       __pyx_t_28 = __pyx_v_i;
-      __pyx_t_29 = __pyx_v_i;
-      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides));
+      *__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_conv.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides));
     }
-    __pyx_L13:;
+    __pyx_L15:;
   }
 
   /* "astropy/convolution/boundary_wrap.pyx":80
@@ -1860,13 +1988,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_wrap.pyx":16
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve1d_boundary_wrap(np.ndarray[DTYPE_t, ndim=1] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=1] g):
+ * 
+ */
+
+  /* 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_7);
+  __Pyx_XDECREF(__pyx_t_6);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -1890,17 +2025,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_convolve1d_boun
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_wrap.pyx":84
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_wrap(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap = {__Pyx_NAMESTR("convolve2d_boundary_wrap"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap = {"convolve2d_boundary_wrap", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve2d_boundary_wrap (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1914,10 +2060,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve2d_boundary_wrap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1945,6 +2091,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_boundary_wrap(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1953,14 +2101,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_3convolve2d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_wrap.pyx":84
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve2d_boundary_wrap(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=2] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_boundary_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -1996,23 +2136,23 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
+  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;
+  PyArrayObject *__pyx_t_7 = NULL;
   PyArrayObject *__pyx_t_8 = NULL;
-  PyArrayObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  unsigned int __pyx_t_11;
-  int __pyx_t_12;
+  int __pyx_t_9;
+  unsigned int __pyx_t_10;
+  int __pyx_t_11;
+  unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
-  unsigned int __pyx_t_15;
+  int __pyx_t_15;
   int __pyx_t_16;
   int __pyx_t_17;
   int __pyx_t_18;
-  int __pyx_t_19;
+  unsigned int __pyx_t_19;
   unsigned int __pyx_t_20;
   unsigned int __pyx_t_21;
   unsigned int __pyx_t_22;
@@ -2042,7 +2182,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
   unsigned int __pyx_t_46;
   unsigned int __pyx_t_47;
   unsigned int __pyx_t_48;
-  unsigned int __pyx_t_49;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2081,14 +2220,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    __pyx_t_3 = __pyx_t_2;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_3 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_wrap.pyx":88
  * 
@@ -2097,14 +2238,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_wrap.pyx":90
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -2114,32 +2253,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __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_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (unlikely(!__pyx_t_2)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -2204,52 +2347,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=2] conv = np.empty([nx, ny], dtype=DTYPE)
  *     cdef unsigned int i, j, iii, jjj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_4 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_8 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_7 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":99
  *     cdef int wky = nky // 2
@@ -2258,52 +2401,52 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *     cdef unsigned int i, j, iii, jjj
  *     cdef int ii, jj
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_3 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_4 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1];
     }
   }
-  __pyx_t_9 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":109
  *     # Need a first pass to replace NaN values with value convolved from
@@ -2312,9 +2455,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *         for j in range(ny):
  *             if npy_isnan(f[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_wrap.pyx":110
  *     # neighboring values
@@ -2323,9 +2466,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *             if npy_isnan(f[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_wrap.pyx":111
  *     for i in range(nx):
@@ -2334,10 +2477,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_14 = __pyx_v_i;
-      __pyx_t_15 = __pyx_v_j;
-      __pyx_t_2 = npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_f.diminfo[1].strides)));
-      if (__pyx_t_2) {
+      __pyx_t_13 = __pyx_v_i;
+      __pyx_t_14 = __pyx_v_j;
+      __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_f.diminfo[1].strides))) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_wrap.pyx":112
  *         for j in range(ny):
@@ -2400,9 +2543,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     for jj in range(jjmin, jjmax):
  *                         iii = ii % nx
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_wrap.pyx":119
  *                 jjmax = j + wky + 1
@@ -2411,9 +2554,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         iii = ii % nx
  *                         jjj = jj % ny
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_wrap.pyx":120
  *                 for ii in range(iimin, iimax):
@@ -2423,7 +2566,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         val = f[iii, jjj]
  */
             if (unlikely(__pyx_v_nx == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
             __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -2436,7 +2585,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         if not npy_isnan(val):
  */
             if (unlikely(__pyx_v_ny == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
             __pyx_v_jjj = __Pyx_mod_int(__pyx_v_jj, __pyx_v_ny);
@@ -2448,9 +2603,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         if not npy_isnan(val):
  *                             ker = g[<unsigned int>(wkx + ii - i),
  */
-            __pyx_t_20 = __pyx_v_iii;
-            __pyx_t_21 = __pyx_v_jjj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_f.diminfo[1].strides));
+            __pyx_t_19 = __pyx_v_iii;
+            __pyx_t_20 = __pyx_v_jjj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_wrap.pyx":123
  *                         jjj = jj % ny
@@ -2459,19 +2614,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                             ker = g[<unsigned int>(wkx + ii - i),
  *                                     <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_2) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
-              /* "astropy/convolution/boundary_wrap.pyx":125
+              /* "astropy/convolution/boundary_wrap.pyx":124
+ *                         val = f[iii, jjj]
  *                         if not npy_isnan(val):
- *                             ker = g[<unsigned int>(wkx + ii - i),
- *                                     <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                             ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                     <unsigned int>(wky + jj - j)]
  *                             top += val * ker
- *                             bot += ker
  */
-              __pyx_t_22 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-              __pyx_t_23 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_g.diminfo[1].strides));
+              __pyx_t_21 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+              __pyx_t_22 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+              __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_g.diminfo[1].strides));
 
               /* "astropy/convolution/boundary_wrap.pyx":126
  *                             ker = g[<unsigned int>(wkx + ii - i),
@@ -2490,9 +2645,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                 if bot != 0.:
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L13;
+              goto __pyx_L17;
             }
-            __pyx_L13:;
+            __pyx_L17:;
           }
         }
 
@@ -2503,8 +2658,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     fixed[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_2 = (__pyx_v_bot != 0.);
-        if (__pyx_t_2) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":130
  * 
@@ -2514,13 +2669,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     fixed[i, j] = f[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_24 = __pyx_v_i;
-          __pyx_t_25 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L14;
+          __pyx_t_23 = __pyx_v_i;
+          __pyx_t_24 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_fixed.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L18;
         }
         /*else*/ {
 
@@ -2531,14 +2692,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *             else:
  *                 fixed[i, j] = f[i, j]
  */
-          __pyx_t_26 = __pyx_v_i;
-          __pyx_t_27 = __pyx_v_j;
-          __pyx_t_28 = __pyx_v_i;
-          __pyx_t_29 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[1].strides));
+          __pyx_t_25 = __pyx_v_i;
+          __pyx_t_26 = __pyx_v_j;
+          __pyx_t_27 = __pyx_v_i;
+          __pyx_t_28 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides));
         }
-        __pyx_L14:;
-        goto __pyx_L8;
+        __pyx_L18:;
+        goto __pyx_L12;
       }
       /*else*/ {
 
@@ -2549,13 +2710,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  * 
  *     # Now run the proper convolution
  */
-        __pyx_t_30 = __pyx_v_i;
-        __pyx_t_31 = __pyx_v_j;
-        __pyx_t_32 = __pyx_v_i;
-        __pyx_t_33 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_f.diminfo[1].strides));
+        __pyx_t_29 = __pyx_v_i;
+        __pyx_t_30 = __pyx_v_j;
+        __pyx_t_31 = __pyx_v_i;
+        __pyx_t_32 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_f.diminfo[1].strides));
       }
-      __pyx_L8:;
+      __pyx_L12:;
     }
   }
 
@@ -2566,9 +2727,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *         for j in range(ny):
  *             if not npy_isnan(fixed[i, j]):
  */
-  __pyx_t_10 = __pyx_v_nx;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_nx;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/convolution/boundary_wrap.pyx":138
  *     # Now run the proper convolution
@@ -2577,9 +2738,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *             if not npy_isnan(fixed[i, j]):
  *                 top = 0.
  */
-    __pyx_t_12 = __pyx_v_ny;
-    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-      __pyx_v_j = __pyx_t_13;
+    __pyx_t_11 = __pyx_v_ny;
+    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
+      __pyx_v_j = __pyx_t_12;
 
       /* "astropy/convolution/boundary_wrap.pyx":139
  *     for i in range(nx):
@@ -2588,10 +2749,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                 top = 0.
  *                 bot = 0.
  */
-      __pyx_t_34 = __pyx_v_i;
-      __pyx_t_35 = __pyx_v_j;
-      __pyx_t_2 = (!npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[1].strides))));
-      if (__pyx_t_2) {
+      __pyx_t_33 = __pyx_v_i;
+      __pyx_t_34 = __pyx_v_j;
+      __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides))) != 0)) != 0);
+      if (__pyx_t_1) {
 
         /* "astropy/convolution/boundary_wrap.pyx":140
  *         for j in range(ny):
@@ -2654,9 +2815,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     for jj in range(jjmin, jjmax):
  *                         iii = ii % nx
  */
-        __pyx_t_16 = __pyx_v_iimax;
-        for (__pyx_t_17 = __pyx_v_iimin; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-          __pyx_v_ii = __pyx_t_17;
+        __pyx_t_15 = __pyx_v_iimax;
+        for (__pyx_t_16 = __pyx_v_iimin; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+          __pyx_v_ii = __pyx_t_16;
 
           /* "astropy/convolution/boundary_wrap.pyx":147
  *                 jjmax = j + wky + 1
@@ -2665,9 +2826,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         iii = ii % nx
  *                         jjj = jj % ny
  */
-          __pyx_t_18 = __pyx_v_jjmax;
-          for (__pyx_t_19 = __pyx_v_jjmin; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
-            __pyx_v_jj = __pyx_t_19;
+          __pyx_t_17 = __pyx_v_jjmax;
+          for (__pyx_t_18 = __pyx_v_jjmin; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
+            __pyx_v_jj = __pyx_t_18;
 
             /* "astropy/convolution/boundary_wrap.pyx":148
  *                 for ii in range(iimin, iimax):
@@ -2677,7 +2838,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         val = fixed[iii, jjj]
  */
             if (unlikely(__pyx_v_nx == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
             __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -2690,7 +2857,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         ker = g[<unsigned int>(wkx + ii - i),
  */
             if (unlikely(__pyx_v_ny == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
             __pyx_v_jjj = __Pyx_mod_int(__pyx_v_jj, __pyx_v_ny);
@@ -2702,20 +2875,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                         ker = g[<unsigned int>(wkx + ii - i),
  *                                 <unsigned int>(wky + jj - j)]
  */
-            __pyx_t_36 = __pyx_v_iii;
-            __pyx_t_37 = __pyx_v_jjj;
-            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[1].strides));
+            __pyx_t_35 = __pyx_v_iii;
+            __pyx_t_36 = __pyx_v_jjj;
+            __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_fixed.diminfo[1].strides));
 
-            /* "astropy/convolution/boundary_wrap.pyx":152
+            /* "astropy/convolution/boundary_wrap.pyx":151
+ *                         jjj = jj % ny
  *                         val = fixed[iii, jjj]
- *                         ker = g[<unsigned int>(wkx + ii - i),
- *                                 <unsigned int>(wky + jj - j)]             # <<<<<<<<<<<<<<
+ *                         ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
+ *                                 <unsigned int>(wky + jj - j)]
  *                         if not npy_isnan(val):
- *                             top += val * ker
  */
-            __pyx_t_38 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-            __pyx_t_39 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_g.diminfo[1].strides));
+            __pyx_t_37 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+            __pyx_t_38 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+            __pyx_v_ker = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_g.diminfo[1].strides));
 
             /* "astropy/convolution/boundary_wrap.pyx":153
  *                         ker = g[<unsigned int>(wkx + ii - i),
@@ -2724,8 +2897,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                             top += val * ker
  *                             bot += ker
  */
-            __pyx_t_2 = (!npy_isnan(__pyx_v_val));
-            if (__pyx_t_2) {
+            __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+            if (__pyx_t_1) {
 
               /* "astropy/convolution/boundary_wrap.pyx":154
  *                                 <unsigned int>(wky + jj - j)]
@@ -2744,9 +2917,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     conv[i, j] = top / bot
  */
               __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-              goto __pyx_L24;
+              goto __pyx_L28;
             }
-            __pyx_L24:;
+            __pyx_L28:;
           }
         }
 
@@ -2757,8 +2930,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     conv[i, j] = top / bot
  *                 else:
  */
-        __pyx_t_2 = (__pyx_v_bot != 0.0);
-        if (__pyx_t_2) {
+        __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":157
  *                             bot += ker
@@ -2768,13 +2941,19 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *                     conv[i, j] = fixed[i, j]
  */
           if (unlikely(__pyx_v_bot == 0)) {
-            PyErr_Format(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+            #endif
+            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+            #ifdef WITH_THREAD
+            PyGILState_Release(__pyx_gilstate_save);
+            #endif
             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
-          __pyx_t_40 = __pyx_v_i;
-          __pyx_t_41 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
-          goto __pyx_L25;
+          __pyx_t_39 = __pyx_v_i;
+          __pyx_t_40 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_conv.diminfo[1].strides) = (__pyx_v_top / __pyx_v_bot);
+          goto __pyx_L29;
         }
         /*else*/ {
 
@@ -2785,14 +2964,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  *             else:
  *                 conv[i, j] = fixed[i, j]
  */
-          __pyx_t_42 = __pyx_v_i;
-          __pyx_t_43 = __pyx_v_j;
-          __pyx_t_44 = __pyx_v_i;
-          __pyx_t_45 = __pyx_v_j;
-          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[1].strides));
+          __pyx_t_41 = __pyx_v_i;
+          __pyx_t_42 = __pyx_v_j;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_fixed.diminfo[1].strides));
         }
-        __pyx_L25:;
-        goto __pyx_L19;
+        __pyx_L29:;
+        goto __pyx_L23;
       }
       /*else*/ {
 
@@ -2803,13 +2982,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
  * 
  *     return conv
  */
-        __pyx_t_46 = __pyx_v_i;
-        __pyx_t_47 = __pyx_v_j;
-        __pyx_t_48 = __pyx_v_i;
-        __pyx_t_49 = __pyx_v_j;
-        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides));
+        __pyx_t_45 = __pyx_v_i;
+        __pyx_t_46 = __pyx_v_j;
+        __pyx_t_47 = __pyx_v_i;
+        __pyx_t_48 = __pyx_v_j;
+        *__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_conv.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[1].strides));
       }
-      __pyx_L19:;
+      __pyx_L23:;
     }
   }
 
@@ -2825,13 +3004,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_wrap.pyx":84
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve2d_boundary_wrap(np.ndarray[DTYPE_t, ndim=2] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=2] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -2855,17 +3041,28 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_2convolve2d_bou
   return __pyx_r;
 }
 
+/* "astropy/convolution/boundary_wrap.pyx":167
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_wrap(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap = {__Pyx_NAMESTR("convolve3d_boundary_wrap"), (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap = {"convolve3d_boundary_wrap", (PyCFunction)__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_f = 0;
   PyArrayObject *__pyx_v_g = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("convolve3d_boundary_wrap (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__g,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_g,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2879,10 +3076,10 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_bou
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__g)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("convolve3d_boundary_wrap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -2910,6 +3107,8 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_bou
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_boundary_wrap(__pyx_self, __pyx_v_f, __pyx_v_g);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2918,14 +3117,6 @@ static PyObject *__pyx_pw_7astropy_11convolution_13boundary_wrap_5convolve3d_bou
   return __pyx_r;
 }
 
-/* "astropy/convolution/boundary_wrap.pyx":167
- * 
- * @cython.boundscheck(False)  # turn off bounds-checking for entire function
- * def convolve3d_boundary_wrap(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
- *                              np.ndarray[DTYPE_t, ndim=3] g):
- * 
- */
-
 static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_boundary_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_g) {
   int __pyx_v_nx;
   int __pyx_v_ny;
@@ -2969,30 +3160,30 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
+  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;
-  PyArrayObject *__pyx_t_10 = NULL;
-  PyArrayObject *__pyx_t_11 = NULL;
+  PyArrayObject *__pyx_t_8 = NULL;
+  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
+  unsigned int __pyx_t_11;
   int __pyx_t_12;
   unsigned int __pyx_t_13;
   int __pyx_t_14;
   unsigned int __pyx_t_15;
-  int __pyx_t_16;
+  unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
-  unsigned int __pyx_t_19;
-  unsigned int __pyx_t_20;
+  int __pyx_t_19;
+  int __pyx_t_20;
   int __pyx_t_21;
   int __pyx_t_22;
   int __pyx_t_23;
   int __pyx_t_24;
-  int __pyx_t_25;
-  int __pyx_t_26;
+  unsigned int __pyx_t_25;
+  unsigned int __pyx_t_26;
   unsigned int __pyx_t_27;
   unsigned int __pyx_t_28;
   unsigned int __pyx_t_29;
@@ -3036,8 +3227,6 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
   unsigned int __pyx_t_67;
   unsigned int __pyx_t_68;
   unsigned int __pyx_t_69;
-  unsigned int __pyx_t_70;
-  unsigned int __pyx_t_71;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3076,20 +3265,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *         raise ValueError("Convolution kernel must have odd dimensions")
  * 
  */
-  __pyx_t_1 = (__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = (__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1);
-    if (!__pyx_t_2) {
-      __pyx_t_3 = (__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1);
-      __pyx_t_4 = __pyx_t_3;
-    } else {
-      __pyx_t_4 = __pyx_t_2;
-    }
-    __pyx_t_2 = __pyx_t_4;
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[0]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[1]), 2) != 1) != 0);
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_2 = __pyx_t_1;
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((__Pyx_mod_long((__pyx_v_g->dimensions[2]), 2) != 1) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "astropy/convolution/boundary_wrap.pyx":171
  * 
@@ -3098,14 +3289,12 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
   /* "astropy/convolution/boundary_wrap.pyx":173
  *         raise ValueError("Convolution kernel must have odd dimensions")
@@ -3115,32 +3304,36 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *     cdef int nx = f.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_f), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_g), __pyx_n_s__dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __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_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_4 = __pyx_t_1;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (unlikely(!__pyx_t_4)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L7_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3232,57 +3425,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *     cdef np.ndarray[DTYPE_t, ndim=3] conv = np.empty([nx, ny, nz], dtype=DTYPE)
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_3 = 0;
   __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
-  __pyx_t_9 = 0;
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fixed.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_fixed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_fixed.diminfo[0].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fixed.diminfo[0].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fixed.diminfo[1].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fixed.diminfo[1].shape = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fixed.diminfo[2].strides = __pyx_pybuffernd_fixed.rcbuffer->pybuffer.strides[2] [...]
     }
   }
-  __pyx_t_10 = 0;
-  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_v_fixed = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":185
  *     cdef int wkz = nkz // 2
@@ -3291,57 +3484,57 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *     cdef unsigned int i, j, k, iii, jjj, kkk
  *     cdef int ii, jj, kk
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_ny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_nz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ny); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
+  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_5 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_11 = ((PyArrayObject *)__pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
       __pyx_v_conv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_conv.diminfo[0].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conv.diminfo[0].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conv.diminfo[1].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conv.diminfo[1].shape = __pyx_pybuffernd_conv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_conv.diminfo[2].strides = __pyx_pybuffernd_conv.rcbuffer->pybuffer.strides[2]; __pyx_py [...]
     }
   }
-  __pyx_t_11 = 0;
-  __pyx_v_conv = ((PyArrayObject *)__pyx_t_8);
-  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_v_conv = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":195
  *     # Need a first pass to replace NaN values with value convolved from
@@ -3350,9 +3543,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_wrap.pyx":196
  *     # neighboring values
@@ -3361,9 +3554,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *             for k in range(nz):
  *                 if npy_isnan(f[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_wrap.pyx":197
  *     for i in range(nx):
@@ -3372,9 +3565,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                 if npy_isnan(f[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_wrap.pyx":198
  *         for j in range(ny):
@@ -3383,11 +3576,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_18 = __pyx_v_i;
-        __pyx_t_19 = __pyx_v_j;
-        __pyx_t_20 = __pyx_v_k;
-        __pyx_t_4 = npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_f.diminfo[2].strides)));
-        if (__pyx_t_4) {
+        __pyx_t_16 = __pyx_v_i;
+        __pyx_t_17 = __pyx_v_j;
+        __pyx_t_18 = __pyx_v_k;
+        __pyx_t_1 = (npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_f.diminfo[2].strides))) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":199
  *             for k in range(nz):
@@ -3468,9 +3661,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_wrap.pyx":208
  *                     kkmax = k + wkz + 1
@@ -3479,9 +3672,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                             for kk in range(kkmin, kkmax):
  *                                 iii = ii % nx
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_wrap.pyx":209
  *                     for ii in range(iimin, iimax):
@@ -3490,9 +3683,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 iii = ii % nx
  *                                 jjj = jj % ny
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_wrap.pyx":210
  *                         for jj in range(jjmin, jjmax):
@@ -3502,7 +3695,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 kkk = kk % nz
  */
                 if (unlikely(__pyx_v_nx == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -3515,7 +3714,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 val = f[iii, jjj, kkk]
  */
                 if (unlikely(__pyx_v_ny == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_jjj = __Pyx_mod_int(__pyx_v_jj, __pyx_v_ny);
@@ -3528,7 +3733,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 if not npy_isnan(val):
  */
                 if (unlikely(__pyx_v_nz == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_kkk = __Pyx_mod_int(__pyx_v_kk, __pyx_v_nz);
@@ -3540,10 +3751,10 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 if not npy_isnan(val):
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  */
-                __pyx_t_27 = __pyx_v_iii;
-                __pyx_t_28 = __pyx_v_jjj;
-                __pyx_t_29 = __pyx_v_kkk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_f.diminfo[2].strides));
+                __pyx_t_25 = __pyx_v_iii;
+                __pyx_t_26 = __pyx_v_jjj;
+                __pyx_t_27 = __pyx_v_kkk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_f.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_f.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_wrap.pyx":214
  *                                 kkk = kk % nz
@@ -3552,20 +3763,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                     ker = g[<unsigned int>(wkx + ii - i),
  *                                             <unsigned int>(wky + jj - j),
  */
-                __pyx_t_4 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_4) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
-                  /* "astropy/convolution/boundary_wrap.pyx":217
- *                                     ker = g[<unsigned int>(wkx + ii - i),
+                  /* "astropy/convolution/boundary_wrap.pyx":215
+ *                                 val = f[iii, jjj, kkk]
+ *                                 if not npy_isnan(val):
+ *                                     ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                             <unsigned int>(wky + jj - j),
- *                                             <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                     top += val * ker
- *                                     bot += ker
+ *                                             <unsigned int>(wkz + kk - k)]
  */
-                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                  __pyx_t_31 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                  __pyx_t_32 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_g.diminfo[2].strides));
+                  __pyx_t_28 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                  __pyx_t_29 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                  __pyx_t_30 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                  __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_g.diminfo[2].strides));
 
                   /* "astropy/convolution/boundary_wrap.pyx":218
  *                                             <unsigned int>(wky + jj - j),
@@ -3584,9 +3795,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                     if bot != 0.:
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L17;
+                  goto __pyx_L22;
                 }
-                __pyx_L17:;
+                __pyx_L22:;
               }
             }
           }
@@ -3598,8 +3809,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         fixed[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_4 = (__pyx_v_bot != 0.);
-          if (__pyx_t_4) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_wrap.pyx":222
  * 
@@ -3609,14 +3820,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         fixed[i, j, k] = f[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_33 = __pyx_v_i;
-            __pyx_t_34 = __pyx_v_j;
-            __pyx_t_35 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L18;
+            __pyx_t_31 = __pyx_v_i;
+            __pyx_t_32 = __pyx_v_j;
+            __pyx_t_33 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_fixed.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L23;
           }
           /*else*/ {
 
@@ -3627,16 +3844,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                 else:
  *                     fixed[i, j, k] = f[i, j, k]
  */
-            __pyx_t_36 = __pyx_v_i;
-            __pyx_t_37 = __pyx_v_j;
-            __pyx_t_38 = __pyx_v_k;
-            __pyx_t_39 = __pyx_v_i;
-            __pyx_t_40 = __pyx_v_j;
-            __pyx_t_41 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_3 [...]
+            __pyx_t_34 = __pyx_v_i;
+            __pyx_t_35 = __pyx_v_j;
+            __pyx_t_36 = __pyx_v_k;
+            __pyx_t_37 = __pyx_v_i;
+            __pyx_t_38 = __pyx_v_j;
+            __pyx_t_39 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_3 [...]
           }
-          __pyx_L18:;
-          goto __pyx_L10;
+          __pyx_L23:;
+          goto __pyx_L15;
         }
         /*else*/ {
 
@@ -3647,15 +3864,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  * 
  *     # Now run the proper convolution
  */
-          __pyx_t_42 = __pyx_v_i;
-          __pyx_t_43 = __pyx_v_j;
-          __pyx_t_44 = __pyx_v_k;
-          __pyx_t_45 = __pyx_v_i;
-          __pyx_t_46 = __pyx_v_j;
-          __pyx_t_47 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_43, [...]
+          __pyx_t_40 = __pyx_v_i;
+          __pyx_t_41 = __pyx_v_j;
+          __pyx_t_42 = __pyx_v_k;
+          __pyx_t_43 = __pyx_v_i;
+          __pyx_t_44 = __pyx_v_j;
+          __pyx_t_45 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_fixed.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_f.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_f.diminfo[0].strides, __pyx_t_41, [...]
         }
-        __pyx_L10:;
+        __pyx_L15:;
       }
     }
   }
@@ -3667,9 +3884,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *         for j in range(ny):
  *             for k in range(nz):
  */
-  __pyx_t_12 = __pyx_v_nx;
-  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
-    __pyx_v_i = __pyx_t_13;
+  __pyx_t_10 = __pyx_v_nx;
+  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+    __pyx_v_i = __pyx_t_11;
 
     /* "astropy/convolution/boundary_wrap.pyx":230
  *     # Now run the proper convolution
@@ -3678,9 +3895,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *             for k in range(nz):
  *                 if not npy_isnan(fixed[i, j, k]):
  */
-    __pyx_t_14 = __pyx_v_ny;
-    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-      __pyx_v_j = __pyx_t_15;
+    __pyx_t_12 = __pyx_v_ny;
+    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+      __pyx_v_j = __pyx_t_13;
 
       /* "astropy/convolution/boundary_wrap.pyx":231
  *     for i in range(nx):
@@ -3689,9 +3906,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                 if not npy_isnan(fixed[i, j, k]):
  *                     top = 0.
  */
-      __pyx_t_16 = __pyx_v_nz;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
-        __pyx_v_k = __pyx_t_17;
+      __pyx_t_14 = __pyx_v_nz;
+      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
+        __pyx_v_k = __pyx_t_15;
 
         /* "astropy/convolution/boundary_wrap.pyx":232
  *         for j in range(ny):
@@ -3700,11 +3917,11 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                     top = 0.
  *                     bot = 0.
  */
-        __pyx_t_48 = __pyx_v_i;
-        __pyx_t_49 = __pyx_v_j;
-        __pyx_t_50 = __pyx_v_k;
-        __pyx_t_4 = (!npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[2].strides))));
-        if (__pyx_t_4) {
+        __pyx_t_46 = __pyx_v_i;
+        __pyx_t_47 = __pyx_v_j;
+        __pyx_t_48 = __pyx_v_k;
+        __pyx_t_1 = ((!(npy_isnan((*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_fixed.diminfo[2].strides))) != 0)) != 0);
+        if (__pyx_t_1) {
 
           /* "astropy/convolution/boundary_wrap.pyx":233
  *             for k in range(nz):
@@ -3785,9 +4002,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         for jj in range(jjmin, jjmax):
  *                             for kk in range(kkmin, kkmax):
  */
-          __pyx_t_21 = __pyx_v_iimax;
-          for (__pyx_t_22 = __pyx_v_iimin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
-            __pyx_v_ii = __pyx_t_22;
+          __pyx_t_19 = __pyx_v_iimax;
+          for (__pyx_t_20 = __pyx_v_iimin; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+            __pyx_v_ii = __pyx_t_20;
 
             /* "astropy/convolution/boundary_wrap.pyx":242
  *                     kkmax = k + wkz + 1
@@ -3796,9 +4013,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                             for kk in range(kkmin, kkmax):
  *                                 iii = ii % nx
  */
-            __pyx_t_23 = __pyx_v_jjmax;
-            for (__pyx_t_24 = __pyx_v_jjmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
-              __pyx_v_jj = __pyx_t_24;
+            __pyx_t_21 = __pyx_v_jjmax;
+            for (__pyx_t_22 = __pyx_v_jjmin; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+              __pyx_v_jj = __pyx_t_22;
 
               /* "astropy/convolution/boundary_wrap.pyx":243
  *                     for ii in range(iimin, iimax):
@@ -3807,9 +4024,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 iii = ii % nx
  *                                 jjj = jj % ny
  */
-              __pyx_t_25 = __pyx_v_kkmax;
-              for (__pyx_t_26 = __pyx_v_kkmin; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
-                __pyx_v_kk = __pyx_t_26;
+              __pyx_t_23 = __pyx_v_kkmax;
+              for (__pyx_t_24 = __pyx_v_kkmin; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                __pyx_v_kk = __pyx_t_24;
 
                 /* "astropy/convolution/boundary_wrap.pyx":244
  *                         for jj in range(jjmin, jjmax):
@@ -3819,7 +4036,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 kkk = kk % nz
  */
                 if (unlikely(__pyx_v_nx == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_iii = __Pyx_mod_int(__pyx_v_ii, __pyx_v_nx);
@@ -3832,7 +4055,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 val = fixed[iii, jjj, kkk]
  */
                 if (unlikely(__pyx_v_ny == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_jjj = __Pyx_mod_int(__pyx_v_jj, __pyx_v_ny);
@@ -3845,7 +4074,13 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  */
                 if (unlikely(__pyx_v_nz == 0)) {
-                  PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                  #endif
+                  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+                  #ifdef WITH_THREAD
+                  PyGILState_Release(__pyx_gilstate_save);
+                  #endif
                   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                 }
                 __pyx_v_kkk = __Pyx_mod_int(__pyx_v_kk, __pyx_v_nz);
@@ -3857,22 +4092,22 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                 ker = g[<unsigned int>(wkx + ii - i),
  *                                         <unsigned int>(wky + jj - j),
  */
-                __pyx_t_51 = __pyx_v_iii;
-                __pyx_t_52 = __pyx_v_jjj;
-                __pyx_t_53 = __pyx_v_kkk;
-                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_fixed.diminfo[2].strides));
+                __pyx_t_49 = __pyx_v_iii;
+                __pyx_t_50 = __pyx_v_jjj;
+                __pyx_t_51 = __pyx_v_kkk;
+                __pyx_v_val = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_fixed.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_fixed.diminfo[2].strides));
 
-                /* "astropy/convolution/boundary_wrap.pyx":250
- *                                 ker = g[<unsigned int>(wkx + ii - i),
+                /* "astropy/convolution/boundary_wrap.pyx":248
+ *                                 kkk = kk % nz
+ *                                 val = fixed[iii, jjj, kkk]
+ *                                 ker = g[<unsigned int>(wkx + ii - i),             # <<<<<<<<<<<<<<
  *                                         <unsigned int>(wky + jj - j),
- *                                         <unsigned int>(wkz + kk - k)]             # <<<<<<<<<<<<<<
- *                                 if not npy_isnan(val):
- *                                     top += val * ker
+ *                                         <unsigned int>(wkz + kk - k)]
  */
-                __pyx_t_54 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
-                __pyx_t_55 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
-                __pyx_t_56 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
-                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_g.diminfo[2].strides));
+                __pyx_t_52 = ((unsigned int)((__pyx_v_wkx + __pyx_v_ii) - __pyx_v_i));
+                __pyx_t_53 = ((unsigned int)((__pyx_v_wky + __pyx_v_jj) - __pyx_v_j));
+                __pyx_t_54 = ((unsigned int)((__pyx_v_wkz + __pyx_v_kk) - __pyx_v_k));
+                __pyx_v_ker = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_g.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_g.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_g.diminfo[2].strides));
 
                 /* "astropy/convolution/boundary_wrap.pyx":251
  *                                         <unsigned int>(wky + jj - j),
@@ -3881,8 +4116,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                                     top += val * ker
  *                                     bot += ker
  */
-                __pyx_t_4 = (!npy_isnan(__pyx_v_val));
-                if (__pyx_t_4) {
+                __pyx_t_1 = ((!(npy_isnan(__pyx_v_val) != 0)) != 0);
+                if (__pyx_t_1) {
 
                   /* "astropy/convolution/boundary_wrap.pyx":252
  *                                         <unsigned int>(wkz + kk - k)]
@@ -3901,9 +4136,9 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  */
                   __pyx_v_bot = (__pyx_v_bot + __pyx_v_ker);
-                  goto __pyx_L32;
+                  goto __pyx_L37;
                 }
-                __pyx_L32:;
+                __pyx_L37:;
               }
             }
           }
@@ -3915,8 +4150,8 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         conv[i, j, k] = top / bot
  *                     else:
  */
-          __pyx_t_4 = (__pyx_v_bot != 0.0);
-          if (__pyx_t_4) {
+          __pyx_t_1 = ((__pyx_v_bot != 0.0) != 0);
+          if (__pyx_t_1) {
 
             /* "astropy/convolution/boundary_wrap.pyx":255
  *                                     bot += ker
@@ -3926,14 +4161,20 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                         conv[i, j, k] = fixed[i, j, k]
  */
             if (unlikely(__pyx_v_bot == 0)) {
-              PyErr_Format(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+              #endif
+              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
+              #ifdef WITH_THREAD
+              PyGILState_Release(__pyx_gilstate_save);
+              #endif
               {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             }
-            __pyx_t_57 = __pyx_v_i;
-            __pyx_t_58 = __pyx_v_j;
-            __pyx_t_59 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
-            goto __pyx_L33;
+            __pyx_t_55 = __pyx_v_i;
+            __pyx_t_56 = __pyx_v_j;
+            __pyx_t_57 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_conv.diminfo[2].strides) = (__pyx_v_top / __pyx_v_bot);
+            goto __pyx_L38;
           }
           /*else*/ {
 
@@ -3944,16 +4185,16 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  *                 else:
  *                     conv[i, j, k] = fixed[i, j, k]
  */
-            __pyx_t_60 = __pyx_v_i;
-            __pyx_t_61 = __pyx_v_j;
-            __pyx_t_62 = __pyx_v_k;
-            __pyx_t_63 = __pyx_v_i;
-            __pyx_t_64 = __pyx_v_j;
-            __pyx_t_65 = __pyx_v_k;
-            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
+            __pyx_t_58 = __pyx_v_i;
+            __pyx_t_59 = __pyx_v_j;
+            __pyx_t_60 = __pyx_v_k;
+            __pyx_t_61 = __pyx_v_i;
+            __pyx_t_62 = __pyx_v_j;
+            __pyx_t_63 = __pyx_v_k;
+            *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx [...]
           }
-          __pyx_L33:;
-          goto __pyx_L25;
+          __pyx_L38:;
+          goto __pyx_L30;
         }
         /*else*/ {
 
@@ -3964,15 +4205,15 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
  * 
  *     return conv
  */
-          __pyx_t_66 = __pyx_v_i;
-          __pyx_t_67 = __pyx_v_j;
-          __pyx_t_68 = __pyx_v_k;
-          __pyx_t_69 = __pyx_v_i;
-          __pyx_t_70 = __pyx_v_j;
-          __pyx_t_71 = __pyx_v_k;
-          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_71, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
+          __pyx_t_64 = __pyx_v_i;
+          __pyx_t_65 = __pyx_v_j;
+          __pyx_t_66 = __pyx_v_k;
+          __pyx_t_67 = __pyx_v_i;
+          __pyx_t_68 = __pyx_v_j;
+          __pyx_t_69 = __pyx_v_k;
+          *__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_conv.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_conv.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_conv.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_conv.diminfo[2].strides) = (*__Pyx_BufPtrStrided3d(__pyx_t_7astropy_11convolution_13boundary_wrap_DTYPE_t *, __pyx_pybuffernd_fixed.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_fixed.diminfo[0].strides, __pyx_t [...]
         }
-        __pyx_L25:;
+        __pyx_L30:;
       }
     }
   }
@@ -3987,14 +4228,21 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
   __pyx_r = ((PyObject *)__pyx_v_conv);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/convolution/boundary_wrap.pyx":167
+ * 
+ * @cython.boundscheck(False)  # turn off bounds-checking for entire function
+ * def convolve3d_boundary_wrap(np.ndarray[DTYPE_t, ndim=3] f,             # <<<<<<<<<<<<<<
+ *                              np.ndarray[DTYPE_t, ndim=3] g):
+ * 
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conv.rcbuffer->pybuffer);
@@ -4018,6 +4266,14 @@ static PyObject *__pyx_pf_7astropy_11convolution_13boundary_wrap_4convolve3d_bou
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -4025,18 +4281,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -4052,13 +4302,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4068,22 +4316,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -4092,7 +4338,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -4101,7 +4347,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -4110,17 +4356,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -4132,7 +4378,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -4143,87 +4389,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -4232,7 +4478,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -4241,16 +4487,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -4259,7 +4506,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -4268,18 +4515,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -4288,7 +4535,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -4297,11 +4544,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -4310,7 +4557,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -4319,9 +4566,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -4330,7 +4577,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -4339,16 +4586,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -4357,19 +4604,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -4378,23 +4625,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -4406,11 +4655,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -4423,328 +4672,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -4753,7 +4978,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -4762,11 +4987,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -4775,7 +4999,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -4784,7 +5008,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -4793,17 +5017,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -4812,13 +5036,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -4837,39 +5069,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -4881,17 +5115,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -4903,10 +5137,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -4923,7 +5166,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -4937,8 +5180,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4949,7 +5199,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -4966,7 +5216,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -4980,8 +5230,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4992,7 +5249,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -5009,7 +5266,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -5023,8 +5280,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5035,7 +5299,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -5052,7 +5316,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -5066,8 +5330,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5078,7 +5349,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -5095,7 +5366,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -5109,8 +5380,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5121,7 +5399,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -5143,20 +5421,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -5165,7 +5440,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -5174,18 +5449,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -5193,33 +5468,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -5241,129 +5514,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
     } else {
-      __pyx_t_8 = __pyx_t_7;
     }
-    if (!__pyx_t_8) {
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
+    } else {
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -5371,15 +5614,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -5388,7 +5631,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5397,413 +5640,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_11), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -5811,25 +6051,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -5839,13 +6087,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -5858,7 +6112,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -5870,9 +6124,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -5880,9 +6135,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -5894,7 +6150,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -5903,7 +6159,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -5914,7 +6170,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -5923,7 +6179,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -5932,10 +6188,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -5949,17 +6214,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -5970,11 +6235,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -5984,9 +6248,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -6004,7 +6275,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("boundary_wrap"),
+    "boundary_wrap",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -6016,67 +6287,68 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
-  {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
-  {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
-  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
-  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
-  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
-  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
-  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
-  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
-  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
-  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
-  {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bot, __pyx_k__bot, sizeof(__pyx_k__bot), 0, 0, 1, 1},
-  {&__pyx_n_s__conv, __pyx_k__conv, sizeof(__pyx_k__conv), 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__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
-  {&__pyx_n_s__fixed, __pyx_k__fixed, sizeof(__pyx_k__fixed), 0, 0, 1, 1},
-  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
-  {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 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__iii, __pyx_k__iii, sizeof(__pyx_k__iii), 0, 0, 1, 1},
-  {&__pyx_n_s__iimax, __pyx_k__iimax, sizeof(__pyx_k__iimax), 0, 0, 1, 1},
-  {&__pyx_n_s__iimin, __pyx_k__iimin, sizeof(__pyx_k__iimin), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__jj, __pyx_k__jj, sizeof(__pyx_k__jj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjj, __pyx_k__jjj, sizeof(__pyx_k__jjj), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmax, __pyx_k__jjmax, sizeof(__pyx_k__jjmax), 0, 0, 1, 1},
-  {&__pyx_n_s__jjmin, __pyx_k__jjmin, sizeof(__pyx_k__jjmin), 0, 0, 1, 1},
-  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
-  {&__pyx_n_s__ker, __pyx_k__ker, sizeof(__pyx_k__ker), 0, 0, 1, 1},
-  {&__pyx_n_s__kk, __pyx_k__kk, sizeof(__pyx_k__kk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkk, __pyx_k__kkk, sizeof(__pyx_k__kkk), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmax, __pyx_k__kkmax, sizeof(__pyx_k__kkmax), 0, 0, 1, 1},
-  {&__pyx_n_s__kkmin, __pyx_k__kkmin, sizeof(__pyx_k__kkmin), 0, 0, 1, 1},
-  {&__pyx_n_s__nkx, __pyx_k__nkx, sizeof(__pyx_k__nkx), 0, 0, 1, 1},
-  {&__pyx_n_s__nky, __pyx_k__nky, sizeof(__pyx_k__nky), 0, 0, 1, 1},
-  {&__pyx_n_s__nkz, __pyx_k__nkz, sizeof(__pyx_k__nkz), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__nx, __pyx_k__nx, sizeof(__pyx_k__nx), 0, 0, 1, 1},
-  {&__pyx_n_s__ny, __pyx_k__ny, sizeof(__pyx_k__ny), 0, 0, 1, 1},
-  {&__pyx_n_s__nz, __pyx_k__nz, sizeof(__pyx_k__nz), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1},
-  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
-  {&__pyx_n_s__wkx, __pyx_k__wkx, sizeof(__pyx_k__wkx), 0, 0, 1, 1},
-  {&__pyx_n_s__wky, __pyx_k__wky, sizeof(__pyx_k__wky), 0, 0, 1, 1},
-  {&__pyx_n_s__wkz, __pyx_k__wkz, sizeof(__pyx_k__wkz), 0, 0, 1, 1},
+  {&__pyx_kp_s_Convolution_kernel_must_have_odd, __pyx_k_Convolution_kernel_must_have_odd, sizeof(__pyx_k_Convolution_kernel_must_have_odd), 0, 0, 1, 0},
+  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s_astropy_convolution_boundary_wra, __pyx_k_astropy_convolution_boundary_wra, sizeof(__pyx_k_astropy_convolution_boundary_wra), 0, 0, 1, 1},
+  {&__pyx_n_s_bot, __pyx_k_bot, sizeof(__pyx_k_bot), 0, 0, 1, 1},
+  {&__pyx_n_s_conv, __pyx_k_conv, sizeof(__pyx_k_conv), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve1d_boundary_wrap, __pyx_k_convolve1d_boundary_wrap, sizeof(__pyx_k_convolve1d_boundary_wrap), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve2d_boundary_wrap, __pyx_k_convolve2d_boundary_wrap, sizeof(__pyx_k_convolve2d_boundary_wrap), 0, 0, 1, 1},
+  {&__pyx_n_s_convolve3d_boundary_wrap, __pyx_k_convolve3d_boundary_wrap, sizeof(__pyx_k_convolve3d_boundary_wrap), 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_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
+  {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
+  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
+  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 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_iii, __pyx_k_iii, sizeof(__pyx_k_iii), 0, 0, 1, 1},
+  {&__pyx_n_s_iimax, __pyx_k_iimax, sizeof(__pyx_k_iimax), 0, 0, 1, 1},
+  {&__pyx_n_s_iimin, __pyx_k_iimin, sizeof(__pyx_k_iimin), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjj, __pyx_k_jjj, sizeof(__pyx_k_jjj), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmax, __pyx_k_jjmax, sizeof(__pyx_k_jjmax), 0, 0, 1, 1},
+  {&__pyx_n_s_jjmin, __pyx_k_jjmin, sizeof(__pyx_k_jjmin), 0, 0, 1, 1},
+  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+  {&__pyx_n_s_ker, __pyx_k_ker, sizeof(__pyx_k_ker), 0, 0, 1, 1},
+  {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkk, __pyx_k_kkk, sizeof(__pyx_k_kkk), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmax, __pyx_k_kkmax, sizeof(__pyx_k_kkmax), 0, 0, 1, 1},
+  {&__pyx_n_s_kkmin, __pyx_k_kkmin, sizeof(__pyx_k_kkmin), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_nkx, __pyx_k_nkx, sizeof(__pyx_k_nkx), 0, 0, 1, 1},
+  {&__pyx_n_s_nky, __pyx_k_nky, sizeof(__pyx_k_nky), 0, 0, 1, 1},
+  {&__pyx_n_s_nkz, __pyx_k_nkz, sizeof(__pyx_k_nkz), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
+  {&__pyx_n_s_ny, __pyx_k_ny, sizeof(__pyx_k_ny), 0, 0, 1, 1},
+  {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
+  {&__pyx_n_s_wkx, __pyx_k_wkx, sizeof(__pyx_k_wkx), 0, 0, 1, 1},
+  {&__pyx_n_s_wky, __pyx_k_wky, sizeof(__pyx_k_wky), 0, 0, 1, 1},
+  {&__pyx_n_s_wkz, __pyx_k_wkz, sizeof(__pyx_k_wkz), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6093,9 +6365,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_2);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
   /* "astropy/convolution/boundary_wrap.pyx":88
  * 
@@ -6104,9 +6376,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_3);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
   /* "astropy/convolution/boundary_wrap.pyx":171
  * 
@@ -6115,75 +6387,75 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     assert f.dtype == DTYPE and g.dtype == DTYPE
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Convolution_kernel_must_have_odd); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_6);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_8);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_14);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_16);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
   /* "astropy/convolution/boundary_wrap.pyx":16
  * 
@@ -6192,10 +6464,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_k_tuple_17 = PyTuple_Pack(16, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__iimin), ((PyObject *)__pyx_n_s__iimax), ((PyObject *)__pyx_n_s__top), ((PyObject *)__pyx_n_s__bot), ((PyObject *)__pyx_n_s__ker), ((PyO [...]
-  __Pyx_GOTREF(__pyx_k_tuple_17);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-  __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_19, 16, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(16, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_nkx, __pyx_n_s_wkx, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_iii, __pyx_n_s_ii, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve1d_boundary_wrap, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_wrap.pyx":84
  * 
@@ -6204,10 +6476,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_k_tuple_22 = PyTuple_Pack(24, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__iii), ((PyObject *)__pyx_n_s__jjj), ((PyObject *)__pyx_n_s__ii), ((PyObject * [...]
-  __Pyx_GOTREF(__pyx_k_tuple_22);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
-  __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(2, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_24, 84, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(24, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_n_s_ker, __pyx_n_s_val); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno  [...]
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve2d_boundary_wrap, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/convolution/boundary_wrap.pyx":167
  * 
@@ -6216,10 +6488,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                              np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_k_tuple_25 = PyTuple_Pack(32, ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__nx), ((PyObject *)__pyx_n_s__ny), ((PyObject *)__pyx_n_s__nz), ((PyObject *)__pyx_n_s__nkx), ((PyObject *)__pyx_n_s__nky), ((PyObject *)__pyx_n_s__nkz), ((PyObject *)__pyx_n_s__wkx), ((PyObject *)__pyx_n_s__wky), ((PyObject *)__pyx_n_s__wkz), ((PyObject *)__pyx_n_s__fixed), ((PyObject *)__pyx_n_s__conv), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject * [...]
-  __Pyx_GOTREF(__pyx_k_tuple_25);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-  __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(2, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_20, __pyx_n_s_27, 167, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__14 = PyTuple_Pack(32, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_nkx, __pyx_n_s_nky, __pyx_n_s_nkz, __pyx_n_s_wkx, __pyx_n_s_wky, __pyx_n_s_wkz, __pyx_n_s_fixed, __pyx_n_s_conv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_iii, __pyx_n_s_jjj, __pyx_n_s_kkk, __pyx_n_s_ii, __pyx_n_s_jj, __pyx_n_s_kk, __pyx_n_s_iimin, __pyx_n_s_iimax, __pyx_n_s_jjmin, __pyx_n_s_jjmax, __pyx_n_s_kkmin, __pyx_n_s_kkmax, __pyx_n_s_top, __pyx_n_s_bot, __pyx_ [...]
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_convolve3d_boundary_wrap, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -6229,7 +6501,6 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -6245,6 +6516,9 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -6277,11 +6551,26 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("boundary_wrap"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("boundary_wrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__convolution__boundary_wrap) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -6290,16 +6579,6 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__convolution__boundary_wrap) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -6332,9 +6611,9 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  * cimport numpy as np
  * 
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":6
@@ -6344,12 +6623,12 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  * ctypedef np.float_t DTYPE_t
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":16
@@ -6359,9 +6638,9 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  *                              np.ndarray[DTYPE_t, ndim=1] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_1convolve1d_boundary_wrap, NULL, __pyx_n_s_astropy_convolution_boundary_wra); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve1d_boundary_wrap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":84
@@ -6371,9 +6650,9 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  *                              np.ndarray[DTYPE_t, ndim=2] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_3convolve2d_boundary_wrap, NULL, __pyx_n_s_astropy_convolution_boundary_wra); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_24, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve2d_boundary_wrap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":167
@@ -6383,9 +6662,9 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  *                              np.ndarray[DTYPE_t, ndim=3] g):
  * 
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_11convolution_13boundary_wrap_5convolve3d_boundary_wrap, NULL, __pyx_n_s_astropy_convolution_boundary_wra); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_27, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve3d_boundary_wrap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/convolution/boundary_wrap.pyx":1
@@ -6394,23 +6673,28 @@ PyMODINIT_FUNC PyInit_boundary_wrap(void)
  * import numpy as np
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.convolution.boundary_wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.convolution.boundary_wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.convolution.boundary_wrap");
@@ -6439,19 +6723,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -6476,7 +6758,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -6580,12 +6862,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -6595,23 +6877,29 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -6663,7 +6951,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -6908,7 +7196,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -6916,7 +7204,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -6925,7 +7213,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -6955,8 +7243,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -6996,10 +7286,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -7024,7 +7314,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -7036,7 +7326,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -7049,12 +7339,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -7075,21 +7365,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -7164,6 +7458,25 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
     return r;
 }
 
+#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
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -7213,11 +7526,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -7232,26 +7541,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -7261,7 +7557,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -7282,46 +7578,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -7331,6 +7643,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -7338,6 +7657,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -7345,6 +7665,23 @@ bad:
 }
 #endif
 
+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;
+}
+
 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
@@ -7354,7 +7691,7 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -7377,7 +7714,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -7385,133 +7722,195 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-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;
+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) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    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;
     }
-    return 0;
-#endif
+    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);
 }
 
-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();
+#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
     }
-    return 0;
+    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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
-    PyErr_WriteUnraisable(obj);
-nofail:
     Py_DECREF(obj);
     view->obj = NULL;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
+#endif
 
 
-    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+      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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -7529,7 +7928,6 @@ nofail:
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -7551,7 +7949,7 @@ nofail:
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -7568,14 +7966,6 @@ nofail:
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -7585,6 +7975,243 @@ bad:
     return module;
 }
 
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
+    }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (unsigned int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(unsigned int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, 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
+            unsigned int val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (unsigned int) -1;
+        }
+    } else {
+        unsigned int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned int) -1;
+        val = __Pyx_PyInt_As_unsigned_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to unsigned int");
+    return (unsigned int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to unsigned int");
+    return (unsigned int) -1;
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, 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_Int(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_Int(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;
+}
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
@@ -7813,416 +8440,137 @@ bad:
                 theta = 0;
             } else {
                 r = __Pyx_c_abs(a);
-                theta = atan2(a.imag, a.real);
-            }
-            lnr = log(r);
-            z_r = exp(lnr * b.real - theta * b.imag);
-            z_theta = theta * b.real + lnr * b.imag;
-            z.real = z_r * cos(z_theta);
-            z.imag = z_r * sin(z_theta);
-            return z;
-        }
-    #endif
-#endif
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+                theta = atan2(a.imag, a.real);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
+            lnr = log(r);
+            z_r = exp(lnr * b.real - theta * b.imag);
+            z_theta = theta * b.real + lnr * b.imag;
+            z.real = z_r * cos(z_theta);
+            z.imag = z_r * sin(z_theta);
+            return z;
         }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
+    #endif
+#endif
 
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
-            }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
+    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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
     } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
     }
 }
 
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
+        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;
         }
-        return (signed long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
-        }
-        return (signed PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, 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_Int(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 {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        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;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -8235,11 +8583,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -8289,7 +8633,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -8309,15 +8653,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -8329,168 +8669,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -8501,7 +8679,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -8521,6 +8699,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -8530,14 +8773,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -8553,13 +8796,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -8573,35 +8816,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/coordinates/baseframe.py b/astropy/coordinates/baseframe.py
index 1ef7f04..1052de3 100644
--- a/astropy/coordinates/baseframe.py
+++ b/astropy/coordinates/baseframe.py
@@ -626,7 +626,12 @@ class BaseCoordinateFrame(object):
 
     def represent_as(self, new_representation, in_frame_units=False):
         """
-        Generate and return a new representation of this frame's `data`.
+        Generate and return a new representation of this frame's `data`
+        as a Representation object.
+
+        Note: In order to make an in-place change of the representation
+        of a Frame or SkyCoord object, set the ``representation``
+        attribute of that object to the desired new representation.
 
         Parameters
         ----------
@@ -641,7 +646,7 @@ class BaseCoordinateFrame(object):
 
         Returns
         -------
-        newrep : whatever ``new_representation`` is
+        newrep : BaseRepresentation-derived object
             A new representation object of this frame's `data`.
 
         Raises
@@ -652,10 +657,14 @@ class BaseCoordinateFrame(object):
         Examples
         --------
         >>> from astropy import units as u
-        >>> from astropy.coordinates import ICRS, CartesianRepresentation
-        >>> coord = ICRS(0*u.deg, 0*u.deg)
+        >>> from astropy.coordinates import SkyCoord, CartesianRepresentation
+        >>> coord = SkyCoord(0*u.deg, 0*u.deg)
         >>> coord.represent_as(CartesianRepresentation)
-        <CartesianRepresentation x=1.0 , y=0.0 , z=0.0 >
+        <CartesianRepresentation x=1.0, y=0.0, z=0.0>
+
+        >>> coord.representation = CartesianRepresentation
+        >>> coord
+        <SkyCoord (ICRS): x=1.0, y=0.0, z=0.0>
         """
         new_representation = _get_repr_cls(new_representation)
 
diff --git a/astropy/coordinates/builtin_frames.py b/astropy/coordinates/builtin_frames.py
index 8f44e12..52c9995 100644
--- a/astropy/coordinates/builtin_frames.py
+++ b/astropy/coordinates/builtin_frames.py
@@ -296,13 +296,23 @@ class Galactic(BaseCoordinateFrame):
 
     # North galactic pole and zeropoint of l in FK4/FK5 coordinates. Needed for
     # transformations to/from FK4/5
-    # These are from Reid & Brunthaler 2004
-    _ngp_J2000 = FK5(ra=192.859508*u.degree, dec=27.128336*u.degree)
-    _lon0_J2000 = Angle(122.932, u.degree)
+
     # These are from the IAU's definition of galactic coordinates
-    _ngp_B1950 = FK4(ra=192.25*u.degree, dec=27.4*u.degree)
+    _ngp_B1950 = FK4NoETerms(ra=192.25*u.degree, dec=27.4*u.degree)
     _lon0_B1950 = Angle(123, u.degree)
 
+    # These are *not* from Reid & Brunthaler 2004 - instead, they were
+    # derived by doing:
+    #
+    # >>> FK4NoETerms(ra=192.25*u.degree, dec=27.4*u.degree).transform_to(FK5)
+    #
+    # This gives better consistency with other codes than using the values
+    # from Reid & Brunthaler 2004 and the best self-consistency between FK5
+    # -> Galactic and FK5 -> FK4 -> Galactic. The lon0 angle was found by
+    # optimizing the self-consistency.
+    _ngp_J2000 = FK5(ra=192.8594812065348*u.degree, dec=27.12825118085622*u.degree)
+    _lon0_J2000 = Angle(122.9319185680026, u.degree)
+
 
 class AltAz(BaseCoordinateFrame):
     """
diff --git a/astropy/coordinates/distances.py b/astropy/coordinates/distances.py
index 3b08264..9d8270a 100644
--- a/astropy/coordinates/distances.py
+++ b/astropy/coordinates/distances.py
@@ -185,13 +185,14 @@ class Distance(u.Quantity):
         z : float
             The redshift of this distance given the provided ``cosmology``.
         """
-        from ..cosmology import luminosity_distance
         from scipy import optimize
 
-        # FIXME: array: need to make this calculation more vector-friendly
+        if cosmology is None:
+            from ..cosmology import default_cosmology
+            cosmology = default_cosmology.get()
 
-        f = lambda z, d, cos: (luminosity_distance(z, cos).value - d) ** 2
-        return optimize.brent(f, (self.Mpc, cosmology))
+        from ..cosmology import z_at_value
+        return z_at_value(cosmology.luminosity_distance, self, ztol=1.e-10)
 
     @property
     def distmod(self):
diff --git a/astropy/coordinates/representation.py b/astropy/coordinates/representation.py
index ee95a83..9b6c293 100644
--- a/astropy/coordinates/representation.py
+++ b/astropy/coordinates/representation.py
@@ -140,7 +140,7 @@ class BaseRepresentation(object):
         """
         allcomp = np.array([getattr(self, component).value
                             for component in self.components])
-        dtype = np.dtype([(str(component), np.float)
+        dtype = np.dtype([(str(component), getattr(self, component).dtype)
                           for component in self.components])
         return (np.rollaxis(allcomp, 0, len(allcomp.shape))
                 .copy().view(dtype).squeeze())
diff --git a/astropy/coordinates/sky_coordinate.py b/astropy/coordinates/sky_coordinate.py
index 94960b9..54a2782 100644
--- a/astropy/coordinates/sky_coordinate.py
+++ b/astropy/coordinates/sky_coordinate.py
@@ -256,6 +256,14 @@ class SkyCoord(object):
         """
         Transform this coordinate to a new frame.
 
+        The frame attributes (e.g. equinox or obstime) for the returned object
+        depend on the corresponding attributes of SkyCoord object and the
+        supplied ``frame``, with the following precedence:
+
+        1. Non-default value in the supplied frame
+        2. Non-default value in the SkyCoord instance
+        3. Default value in the supplied frame
+
         Parameters
         ----------
         frame : str or `BaseCoordinateFrame` class / instance or `SkyCoord` instance
@@ -288,17 +296,20 @@ class SkyCoord(object):
             new_frame_cls = frame.__class__
 
             # Set the keyword args for making a new frame instance for the
-            # transform.  If the supplied frame instance has a non-default
-            # value set then use that, otherwise use the self attribute value
-            # if it is not None.
+            # transform.  Frame attributes track whether they were explicitly
+            # set by user or are just reflecting default values.  Precedence:
+            # 1. Non-default value in the supplied frame instance
+            # 2. Non-default value in the self instance
+            # 3. Default value in the supplied frame instance
             for attr in FRAME_ATTR_NAMES_SET():
                 self_val = getattr(self, attr, None)
                 frame_val = getattr(frame, attr, None)
-                if (frame_val is not None and
-                        attr not in frame._attr_names_with_defaults):
+                if frame_val is not None and not frame.is_frame_attr_default(attr):
                     frame_kwargs[attr] = frame_val
-                elif self_val is not None:
+                elif self_val is not None and not self.is_frame_attr_default(attr):
                     frame_kwargs[attr] = self_val
+                elif frame_val is not None:
+                    frame_kwargs[attr] = frame_val
         else:
             raise ValueError('Transform `frame` must be a frame name, class, or instance')
 
@@ -328,32 +339,50 @@ class SkyCoord(object):
         Overrides getattr to return coordinates that this can be transformed
         to, based on the alias attr in the master transform graph.
         """
+        if '_sky_coord_frame' in self.__dict__:
+            if self.frame.name == attr:
+                return self  # Should this be a deepcopy of self?
+
+            # Anything in the set of all possible frame_attr_names is handled
+            # here. If the attr is relevant for the current frame then delegate
+            # to self.frame otherwise get it from self._<attr>.
+            if attr in FRAME_ATTR_NAMES_SET():
+                if attr in self.frame.get_frame_attr_names():
+                    return getattr(self.frame, attr)
+                else:
+                    return getattr(self, '_' + attr)
+
+            # Some attributes might not fall in the above category but still
+            # are available through self._sky_coord_frame.
+            if not attr.startswith('_') and hasattr(self._sky_coord_frame, attr):
+                return getattr(self._sky_coord_frame, attr)
+
+            # Try to interpret as a new frame for transforming.
+            frame_cls = frame_transform_graph.lookup_name(attr)
+            if frame_cls is not None and self.frame.is_transformable_to(frame_cls):
+                return self.transform_to(attr)
 
-        if self.frame.name == attr:
-            return self  # Should this be a deepcopy of self?
+        # Fail
+        raise AttributeError("'{0}' object has no attribute '{1}'"
+                             .format(self.__class__.__name__, attr))
 
-        # Anything in the set of all possible frame_attr_names is handled
-        # here. If the attr is relevant for the current frame then delegate
-        # to self.frame otherwise get it from self._<attr>.
-        if attr in FRAME_ATTR_NAMES_SET():
-            if attr in self.frame.get_frame_attr_names():
-                return getattr(self.frame, attr)
-            else:
-                return getattr(self, '_' + attr)
+    def __setattr__(self, attr, val):
+        # This is to make anything available through __getattr__ immutable
+        if '_sky_coord_frame' in self.__dict__:
+            if self.frame.name == attr:
+                raise AttributeError("'{0}' is immutable".format(attr))
 
-        # Some attributes might not fall in the above category but still
-        # are available through self._sky_coord_frame.
-        if not attr.startswith('_') and hasattr(self._sky_coord_frame, attr):
-            return getattr(self._sky_coord_frame, attr)
+            if (attr in FRAME_ATTR_NAMES_SET() or
+                (not attr.startswith('_') and
+                 hasattr(self._sky_coord_frame, attr))):
+                setattr(self._sky_coord_frame, attr, val)
 
-        # Try to interpret as a new frame for transforming.
-        frame_cls = frame_transform_graph.lookup_name(attr)
-        if frame_cls is not None and self.frame.is_transformable_to(frame_cls):
-            return self.transform_to(attr)
+            frame_cls = frame_transform_graph.lookup_name(attr)
+            if frame_cls is not None and self.frame.is_transformable_to(frame_cls):
+                raise AttributeError("'{0}' is immutable".format(attr))
 
-        # Fail
-        raise AttributeError("'{0}' object has no attribute '{1}'"
-                             .format(self.__class__.__name__, attr))
+        # Otherwise, do the standard Python attribute setting
+        super(SkyCoord, self).__setattr__(attr, val)
 
     @override__dir__
     def __dir__(self):
@@ -733,6 +762,7 @@ class SkyCoord(object):
         else:
             return icrs_sky_coord.transform_to(frame)
 
+
 # <----------------Private utility functions below here------------------------->
 
 
diff --git a/astropy/coordinates/tests/test_angular_separation.py b/astropy/coordinates/tests/test_angular_separation.py
index d7bbdff..074bfcc 100644
--- a/astropy/coordinates/tests/test_angular_separation.py
+++ b/astropy/coordinates/tests/test_angular_separation.py
@@ -92,7 +92,7 @@ def test_proj_separations():
 
     # distance from the north galactic pole to celestial pole
     npt.assert_allclose(ncp.separation(ngp.transform_to(ICRS)).degree,
-                        62.8716627659)
+                        62.87174758503201)
 
 
 def test_3d_separations():
diff --git a/astropy/coordinates/tests/test_api_ape5.py b/astropy/coordinates/tests/test_api_ape5.py
index 2181470..65e9577 100644
--- a/astropy/coordinates/tests/test_api_ape5.py
+++ b/astropy/coordinates/tests/test_api_ape5.py
@@ -413,7 +413,7 @@ def test_highlevel_api():
     # v0.2/0.3 coordinate objects.  This will *not* be in the low-level classes
     sc = coords.SkyCoord(ra=8 * u.hour, dec=5 * u.deg, frame='icrs')
     scgal = sc.galactic
-    assert str(scgal).startswith('<SkyCoord (Galactic): l=216.317')
+    assert str(scgal).startswith('<SkyCoord (Galactic): l=216.316')
 
     # the existing `from_name` and `match_to_catalog_*` methods will be moved to the
     # high-level class as convenience functionality.
diff --git a/astropy/coordinates/tests/test_arrays.py b/astropy/coordinates/tests/test_arrays.py
index 28e1f4e..cbcf9fb 100644
--- a/astropy/coordinates/tests/test_arrays.py
+++ b/astropy/coordinates/tests/test_arrays.py
@@ -162,8 +162,8 @@ def test_array_coordinates_transformations(arrshape, distance):
 
     assert g.l.shape == arrshape
 
-    npt.assert_array_almost_equal(g.l.degree, 121.17447049007306)
-    npt.assert_array_almost_equal(g.b.degree, -21.57291080408368)
+    npt.assert_array_almost_equal(g.l.degree, 121.17440967)
+    npt.assert_array_almost_equal(g.b.degree, -21.57299631)
 
     if distance is not None:
         assert g.distance.unit == c.distance.unit
diff --git a/astropy/coordinates/tests/test_representation.py b/astropy/coordinates/tests/test_representation.py
index b138006..b6d9cb3 100644
--- a/astropy/coordinates/tests/test_representation.py
+++ b/astropy/coordinates/tests/test_representation.py
@@ -91,6 +91,16 @@ class TestSphericalRepresentation(object):
         assert_allclose_quantity(lat, s1.lat)
         assert_allclose_quantity(distance, s1.distance)
 
+    def test_init_float32_array(self):
+        """Regression test against #2983"""
+        lon = Longitude(np.float32([1., 2.]), u.degree)
+        lat = Latitude(np.float32([3., 4.]), u.degree)
+        s1 = UnitSphericalRepresentation(lon=lon, lat=lat, copy=False)
+        assert s1.lon.dtype == np.float32
+        assert s1.lat.dtype == np.float32
+        assert s1._values['lon'].dtype == np.float32
+        assert s1._values['lat'].dtype == np.float32
+
     def test_reprobj(self):
 
         s1 = SphericalRepresentation(lon=8 * u.hourangle, lat=5 * u.deg, distance=10 * u.kpc)
diff --git a/astropy/coordinates/tests/test_sky_coord.py b/astropy/coordinates/tests/test_sky_coord.py
index aa5a1e8..e87122f 100644
--- a/astropy/coordinates/tests/test_sky_coord.py
+++ b/astropy/coordinates/tests/test_sky_coord.py
@@ -9,6 +9,7 @@ test_api_ape5.py
 from __future__ import (absolute_import, division, print_function,
                         unicode_literals)
 
+import copy
 import functools
 
 import numpy as np
@@ -708,3 +709,61 @@ def test_units_known_fail():
 def test_nodata_failure():
     with pytest.raises(ValueError):
         SkyCoord()
+
+
+def test_frame_attr_transform_inherit():
+    """
+    Test that frame attributes get inherited as expected during transform.
+    Driven by #3106.
+    """
+    c = SkyCoord(1 * u.deg, 2 * u.deg, frame=FK5)
+    c2 = c.transform_to(FK4)
+    assert c2.equinox.value == 'B1950.000'
+    assert c2.obstime.value == 'B1950.000'
+
+    c2 = c.transform_to(FK4(equinox='J1975', obstime='J1980'))
+    assert c2.equinox.value == 'J1975.000'
+    assert c2.obstime.value == 'J1980.000'
+
+    c = SkyCoord(1 * u.deg, 2 * u.deg, frame=FK4)
+    c2 = c.transform_to(FK5)
+    assert c2.equinox.value == 'J2000.000'
+    assert c2.obstime is None
+
+    c = SkyCoord(1 * u.deg, 2 * u.deg, frame=FK4, obstime='J1980')
+    c2 = c.transform_to(FK5)
+    assert c2.equinox.value == 'J2000.000'
+    assert c2.obstime.value == 'J1980.000'
+
+    c = SkyCoord(1 * u.deg, 2 * u.deg, frame=FK4, equinox='J1975', obstime='J1980')
+    c2 = c.transform_to(FK5)
+    assert c2.equinox.value == 'J1975.000'
+    assert c2.obstime.value == 'J1980.000'
+
+    c2 = c.transform_to(FK5(equinox='J1990'))
+    assert c2.equinox.value == 'J1990.000'
+    assert c2.obstime.value == 'J1980.000'
+
+
+def test_deepcopy():
+    c1 = SkyCoord(1 * u.deg, 2 * u.deg)
+    c2 = copy.copy(c1)
+    c3 = copy.deepcopy(c1)
+
+    c4 = SkyCoord([1, 2] * u.m, [2, 3] *u.m, [3, 4] * u.m, representation='cartesian', frame='fk5',
+                  obstime='J1999.9', equinox='J1988.8')
+    c5 = copy.deepcopy(c4)
+    assert np.all(c5.x == c4.x)  # and y and z
+    assert c5.frame.name == c4.frame.name
+    assert c5.obstime == c4.obstime
+    assert c5.equinox == c4.equinox
+    assert c5.representation == c4.representation
+
+
+def test_immutable():
+    c1 = SkyCoord(1 * u.deg, 2 * u.deg)
+    with pytest.raises(AttributeError):
+        c1.ra = 3.0
+
+    c1.foo = 42
+    assert c1.foo == 42
diff --git a/astropy/coordinates/tests/test_transformations.py b/astropy/coordinates/tests/test_transformations.py
index d25eee1..045b293 100644
--- a/astropy/coordinates/tests/test_transformations.py
+++ b/astropy/coordinates/tests/test_transformations.py
@@ -277,3 +277,21 @@ def test_obstime():
     # because the obstime is different
     assert icrs_50.ra.degree != icrs_75.ra.degree
     assert icrs_50.dec.degree != icrs_75.dec.degree
+
+
+def test_fk5_galactic():
+    """
+    Check that FK5 -> Galactic gives the same as FK5 -> FK4 -> Galactic.
+    """
+
+    fk5 = FK5(ra=1*u.deg, dec=2*u.deg)
+
+    direct = fk5.transform_to(Galactic)
+    indirect = fk5.transform_to(FK4).transform_to(Galactic)
+
+    assert direct.separation(indirect).degree < 1.e-10
+
+    direct = fk5.transform_to(Galactic)
+    indirect = fk5.transform_to(FK4NoETerms).transform_to(Galactic)
+
+    assert direct.separation(indirect).degree < 1.e-10
diff --git a/astropy/cosmology/core.py b/astropy/cosmology/core.py
index c2334cb..016723d 100644
--- a/astropy/cosmology/core.py
+++ b/astropy/cosmology/core.py
@@ -150,8 +150,8 @@ class FLRW(Cosmology):
 
         # We are going to share Neff between the neutrinos equally.
         # In detail this is not correct, but it is a standard assumption
-        # because propertly calculating it is a) complicated b) depends
-        # on the details of the massive nuetrinos (e.g., their weak
+        # because properly calculating it is a) complicated b) depends
+        # on the details of the massive neutrinos (e.g., their weak
         # interactions, which could be unusual if one is considering sterile
         # neutrinos)
         self._massivenu = False
@@ -167,7 +167,7 @@ class FLRW(Cosmology):
 
             # Now, figure out if we have massive neutrinos to deal with,
             # and, if so, get the right number of masses
-            # It is worth the effort to keep track of massless ones seperately
+            # It is worth the effort to keep track of massless ones separately
             # (since they are quite easy to deal with, and a common use case
             # is to set only one neutrino to have mass)
             if m_nu.isscalar:
@@ -474,7 +474,7 @@ class FLRW(Cosmology):
         Returns
         -------
         Onu : ndarray, or float if input scalar
-          The energy density of photons relative to the critical
+          The energy density of neutrinos relative to the critical
           density at each redshift.  Note that this includes their
           kinetic energy (if they have mass), so it is not equal to
           the commonly used :math:`\\sum \\frac{m_{\\nu}}{94 eV}`,
@@ -572,7 +572,7 @@ class FLRW(Cosmology):
         # by computing the above for each mass, then summing
         prefac = 0.22710731766  # 7/8 (4/11)^4/3 -- see any cosmo book
 
-        # The massive and massless contribution must be handled seperately
+        # The massive and massless contribution must be handled separately
         # But check for common cases first
         if not self._massivenu:
             if np.isscalar(z):
@@ -589,7 +589,6 @@ class FLRW(Cosmology):
             rel_mass = rel_mass_per.sum() + self._nmasslessnu
         else:
             z = np.asarray(z)
-            retarr = np.empty_like(z)
             curr_nu_y = self._nu_y / (1. + np.expand_dims(z, axis=-1))
             rel_mass_per = (1. + (0.3173 * curr_nu_y) ** p) ** invp
             rel_mass = rel_mass_per.sum(-1) + self._nmasslessnu
@@ -1360,7 +1359,7 @@ class LambdaCDM(FLRW):
         Returns
         -------
         E : ndarray, or float if input scalar
-          The redshift scaling of the Hubble consant.
+          The redshift scaling of the Hubble constant.
 
         Notes
         -----
@@ -1473,7 +1472,7 @@ class FlatLambdaCDM(LambdaCDM):
         Returns
         -------
         E : ndarray, or float if input scalar
-          The redshift scaling of the Hubble consant.
+          The redshift scaling of the Hubble constant.
 
         Notes
         -----
@@ -1656,7 +1655,7 @@ class wCDM(FLRW):
         Returns
         -------
         E : ndarray, or float if input scalar
-          The redshift scaling of the Hubble consant.
+          The redshift scaling of the Hubble constant.
 
         Notes
         -----
@@ -1782,7 +1781,7 @@ class FlatwCDM(wCDM):
         Returns
         -------
         E : ndarray, or float if input scalar
-          The redshift scaling of the Hubble consant.
+          The redshift scaling of the Hubble constant.
 
         Notes
         -----
diff --git a/astropy/cosmology/funcs.py b/astropy/cosmology/funcs.py
index d7f12a6..602feb0 100644
--- a/astropy/cosmology/funcs.py
+++ b/astropy/cosmology/funcs.py
@@ -135,7 +135,7 @@ zmin and zmax satisfying fval = func(z).""")
         f = lambda z: abs(func(z) - fval)
 
     zbest, resval, ierr, ncall = fminbound(f, zmin, zmax, maxfun=maxfun,
-                                           full_output=1)
+                                           full_output=1, xtol=ztol)
 
     if ierr != 0:
         warnings.warn('Maximum number of function calls ({}) reached'.format(
diff --git a/astropy/cosmology/tests/test_cosmology.py b/astropy/cosmology/tests/test_cosmology.py
index c976010..00e8aaf 100644
--- a/astropy/cosmology/tests/test_cosmology.py
+++ b/astropy/cosmology/tests/test_cosmology.py
@@ -1035,6 +1035,9 @@ def test_massivenu_density():
 def test_z_at_value():
     z_at_value = funcs.z_at_value
     cosmo = core.Planck13
+    d = cosmo.luminosity_distance(3)
+    assert np.allclose(z_at_value(cosmo.luminosity_distance, d, ztol=1e-8), 3,
+                       rtol=1e-8)
     assert np.allclose(z_at_value(cosmo.age, 2 * u.Gyr), 3.1981191749374)
     assert np.allclose(z_at_value(cosmo.luminosity_distance, 1e4 * u.Mpc),
                        1.3685792789133948)
diff --git a/astropy/cython_version.py b/astropy/cython_version.py
index 9c5ac9f..7a01b84 100644
--- a/astropy/cython_version.py
+++ b/astropy/cython_version.py
@@ -1,2 +1,2 @@
 # Generated file; do not modify
-cython_version = '0.18'
+cython_version = '0.21.1'
diff --git a/astropy/extern/setup_package.py b/astropy/extern/setup_package.py
index 6e2b747..4f8ef26 100644
--- a/astropy/extern/setup_package.py
+++ b/astropy/extern/setup_package.py
@@ -1,5 +1,5 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
-
+from __future__ import absolute_import
 
 import os
 
diff --git a/astropy/extern/six.py b/astropy/extern/six.py
index 9a495a8..e95bdfb 100644
--- a/astropy/extern/six.py
+++ b/astropy/extern/six.py
@@ -32,25 +32,29 @@ def _find_module(name, path=None):
     return fh, path, descr
 
 
-for mod_name in _SIX_SEARCH_PATH:
-    try:
-        mod_info = _find_module(mod_name)
-    except ImportError:
-        continue
-
-    mod = imp.load_module(__name__, *mod_info)
-
-    try:
-        if StrictVersion(mod.__version__) >= _SIX_MIN_VERSION:
-            break
-    except (AttributeError, ValueError):
-        # Attribute error if the six module isn't what it should be and doesn't
-        # have a .__version__; ValueError if the version string exists but is
-        # somehow bogus/unparseable
-        continue
-else:
-    raise ImportError(
-        "Astropy requires the 'six' module of minimum version {0}; "
-        "normally this is bundled with the astropy package so if you get "
-        "this warning consult the packager of your Astropy "
-        "distribution.".format(_SIX_MIN_VERSION))
+def _import_six(search_path=_SIX_SEARCH_PATH):
+    for mod_name in search_path:
+        try:
+            mod_info = _find_module(mod_name)
+        except ImportError:
+            continue
+
+        mod = imp.load_module(__name__, *mod_info)
+
+        try:
+            if StrictVersion(mod.__version__) >= _SIX_MIN_VERSION:
+                break
+        except (AttributeError, ValueError):
+            # Attribute error if the six module isn't what it should be and
+            # doesn't have a .__version__; ValueError if the version string
+            # exists but is somehow bogus/unparseable
+            continue
+    else:
+        raise ImportError(
+            "Astropy requires the 'six' module of minimum version {0}; "
+            "normally this is bundled with the astropy package so if you get "
+            "this warning consult the packager of your Astropy "
+            "distribution.".format(_SIX_MIN_VERSION))
+
+
+_import_six()
diff --git a/astropy/io/ascii/setup_package.py b/astropy/io/ascii/setup_package.py
index d191e24..8fcff27 100644
--- a/astropy/io/ascii/setup_package.py
+++ b/astropy/io/ascii/setup_package.py
@@ -1,4 +1,5 @@
 # Licensed under a 3-clause BSD style license
+from __future__ import absolute_import
 
 
 def get_package_data():
diff --git a/astropy/io/ascii/tests/test_compressed.py b/astropy/io/ascii/tests/test_compressed.py
index 280c28c..27724d6 100644
--- a/astropy/io/ascii/tests/test_compressed.py
+++ b/astropy/io/ascii/tests/test_compressed.py
@@ -8,6 +8,14 @@ from .. import read
 ROOT = os.path.abspath(os.path.dirname(__file__))
 
 
+try:
+    import bz2
+except ImportError:
+    HAS_BZ2 = False
+else:
+    HAS_BZ2 = True
+
+
 @pytest.mark.parametrize('filename', ['t/daophot.dat.gz', 't/latex1.tex.gz',
                                       't/short.rdb.gz'])
 def test_gzip(filename):
@@ -17,6 +25,7 @@ def test_gzip(filename):
     assert np.all(t_comp._data == t_uncomp._data)
 
 
+ at pytest.mark.xfail('not HAS_BZ2')
 @pytest.mark.parametrize('filename', ['t/short.rdb.bz2', 't/ipac.dat.bz2'])
 def test_bzip2(filename):
     t_comp = read(os.path.join(ROOT, filename))
diff --git a/astropy/io/ascii/tests/test_read.py b/astropy/io/ascii/tests/test_read.py
index 92fb1a7..7e3c95d 100644
--- a/astropy/io/ascii/tests/test_read.py
+++ b/astropy/io/ascii/tests/test_read.py
@@ -813,3 +813,10 @@ def test_list_with_newlines():
     assert len(t) == 2
     assert t[0][0] == 123
     assert t[1][0] == 456
+
+def test_guessing_file_object():
+    """
+    Test guessing a file object.  Fixes #3013 and similar issue noted in #3019.
+    """
+    t = ascii.read(open('t/ipac.dat.bz2', 'rb'))
+    assert t.colnames == ['ra','dec','sai','v2','sptype']
diff --git a/astropy/io/ascii/ui.py b/astropy/io/ascii/ui.py
index abaaaa3..607cd8a 100644
--- a/astropy/io/ascii/ui.py
+++ b/astropy/io/ascii/ui.py
@@ -24,6 +24,7 @@ from . import latex
 from . import html
 
 from ...table import Table
+from ...utils.data import get_readable_fileobj
 
 # Default setting for guess parameter in read()
 _GUESS = True
@@ -144,6 +145,18 @@ def _guess(table, read_kwargs):
     call make sure that if there is a corresponding definition in the guess
     then it must have the same val.  If not then skip this guess."""
 
+    # If `table` is a readable file object then read in the file now.  This
+    # prevents problems in Python 3 with the file object getting closed or
+    # left at the file end.  See #3132, #3013, #3109, #2001.  If a `readme`
+    # arg was passed that implies CDS format, in which case the original
+    # `table` as the data filename must be left intact.
+    if 'readme' not in read_kwargs:
+        try:
+            with get_readable_fileobj(table) as fileobj:
+                table = fileobj.read()
+        except:
+            pass
+
     # Keep a trace of all failed guesses kwarg
     failed_kwargs = []
 
diff --git a/astropy/io/fits/hdu/compressed.py b/astropy/io/fits/hdu/compressed.py
index fcf0601..d8f8b49 100644
--- a/astropy/io/fits/hdu/compressed.py
+++ b/astropy/io/fits/hdu/compressed.py
@@ -55,12 +55,15 @@ DEFAULT_HCOMP_SMOOTH = 0
 DEFAULT_BLOCK_SIZE = 32
 DEFAULT_BYTE_PIX = 4
 
+CMTYPE_ALIASES = {}
 
 # CFITSIO version-specific features
 if COMPRESSION_SUPPORTED:
     try:
         CFITSIO_SUPPORTS_GZIPDATA = compression.CFITSIO_VERSION >= 3.28
         CFITSIO_SUPPORTS_Q_FORMAT = compression.CFITSIO_VERSION >= 3.35
+        if compression.CFITSIO_VERSION >= 3.35:
+            CMTYPE_ALIASES['RICE_ONE'] = 'RICE_1'
     except AttributeError:
         # This generally shouldn't happen unless running setup.py in an
         # environment where an old build of pyfits exists
@@ -599,6 +602,8 @@ class CompImageHDU(BinTableHDU):
                             'available.  Creation of compressed image HDUs is '
                             'disabled.')
 
+        compression_type = CMTYPE_ALIASES.get(compression_type, compression_type)
+
         # Handle deprecated keyword arguments
         compression_opts = {}
         for oldarg, newarg in self.DEPRECATED_KWARGS.items():
@@ -800,6 +805,8 @@ class CompImageHDU(BinTableHDU):
         else:
             compression_type = self._header.get('ZCMPTYPE',
                                                 DEFAULT_COMPRESSION_TYPE)
+            compression_type = CMTYPE_ALIASES.get(compression_type,
+                                                  compression_type)
 
         # If the input image header had BSCALE/BZERO cards, then insert
         # them in the table header.
diff --git a/astropy/io/fits/hdu/hdulist.py b/astropy/io/fits/hdu/hdulist.py
index 1eef428..ca0d394 100644
--- a/astropy/io/fits/hdu/hdulist.py
+++ b/astropy/io/fits/hdu/hdulist.py
@@ -176,6 +176,16 @@ class HDUList(list, _Verify):
         idx = self.index_of(key)
         return super(HDUList, self).__getitem__(idx)
 
+    def __contains__(self, item):
+        """
+        Returns `True` if ``HDUList.index_of(item)`` succeeds.
+        """
+        try:
+            self.index_of(item)
+            return True
+        except KeyError:
+            return False
+
     def __setitem__(self, key, hdu):
         """
         Set an HDU to the `HDUList`, indexed by number or name.
diff --git a/astropy/io/fits/setup_package.py b/astropy/io/fits/setup_package.py
index b57ffb0..635b004 100644
--- a/astropy/io/fits/setup_package.py
+++ b/astropy/io/fits/setup_package.py
@@ -1,4 +1,5 @@
 # Licensed under a 3-clause BSD style license - see PYFITS.rst
+from __future__ import absolute_import
 
 import os
 
diff --git a/astropy/io/fits/src/compressionmodule.c b/astropy/io/fits/src/compressionmodule.c
index 1113cbf..cd7ae9a 100644
--- a/astropy/io/fits/src/compressionmodule.c
+++ b/astropy/io/fits/src/compressionmodule.c
@@ -225,7 +225,15 @@ int compress_type_from_string(char* zcmptype) {
         return PLIO_1;
     } else if (0 == strcmp(zcmptype, "HCOMPRESS_1")) {
         return HCOMPRESS_1;
-    } else {
+    }
+#ifdef CFITSIO_SUPPORTS_SUBTRACTIVE_DITHER_2
+    /* CFITSIO adds a compression type alias for RICE_1 compression
+       as a flag for using subtractive_dither_2 */
+    else if (0 == strcmp(zcmptype, "RICE_ONE")) {
+        return RICE_1;
+    }
+#endif
+    else {
         PyErr_Format(PyExc_ValueError, "Unrecognized compression type: %s",
                      zcmptype);
         return -1;
diff --git a/astropy/io/fits/tests/test_hdulist.py b/astropy/io/fits/tests/test_hdulist.py
index d11b2a3..54a3467 100644
--- a/astropy/io/fits/tests/test_hdulist.py
+++ b/astropy/io/fits/tests/test_hdulist.py
@@ -764,3 +764,22 @@ class TestHDUListFunctions(FitsTestCase):
 
             # Finally, without mmaping B
             test(True, False)
+
+    def test_extname_in_hdulist(self):
+        """
+        Tests to make sure that the 'in' operator works.
+
+        Regression test for https://github.com/astropy/astropy/issues/3060
+        """
+
+        hdulist = fits.HDUList()
+        hdulist.append(fits.ImageHDU(name='a'))
+
+        assert 'a' in hdulist
+        assert 'A' in hdulist
+        assert ('a', 1) in hdulist
+        assert ('A', 1) in hdulist
+        assert 'b' not in hdulist
+        assert ('a', 2) not in hdulist
+        assert ('b', 1) not in hdulist
+        assert ('b', 2) not in hdulist
diff --git a/astropy/io/fits/util.py b/astropy/io/fits/util.py
index 2b2a466..91ca38b 100644
--- a/astropy/io/fits/util.py
+++ b/astropy/io/fits/util.py
@@ -15,6 +15,8 @@ import tempfile
 import textwrap
 import threading
 import warnings
+import platform
+from distutils.version import LooseVersion
 
 import numpy as np
 
@@ -585,11 +587,37 @@ def fill(text, width, *args, **kwargs):
     return '\n\n'.join(maybe_fill(p) for p in paragraphs)
 
 
+# On MacOS X 10.8 and earlier, there is a bug that causes numpy.fromfile to
+# fail when reading over 2Gb of data. If we detect these versions of MacOS X,
+# we can instead read the data in chunks. To avoid performance penalties at
+# import time, we defer the setting of this global variable until the first
+# time it is needed.
+CHUNKED_FROMFILE = None
+
 def _array_from_file(infile, dtype, count, sep):
     """Create a numpy array from a file or a file-like object."""
 
     if isfile(infile):
-        return np.fromfile(infile, dtype=dtype, count=count, sep=sep)
+
+        global CHUNKED_FROMFILE
+        if CHUNKED_FROMFILE is None:
+            if sys.platform == 'darwin' and LooseVersion(platform.mac_ver()[0]) < LooseVersion('10.9'):
+                CHUNKED_FROMFILE = True
+            else:
+                CHUNKED_FROMFILE = False
+
+        if CHUNKED_FROMFILE:
+            chunk_size = int(1024 ** 3 / dtype.itemsize)  # 1Gb to be safe
+            if count < chunk_size:
+                return np.fromfile(infile, dtype=dtype, count=count, sep=sep)
+            else:
+                array = np.empty(count, dtype=dtype)
+                for beg in range(0, count, chunk_size):
+                    end = min(count, beg + chunk_size)
+                    array[beg:end] = np.fromfile(infile, dtype=dtype, count=end - beg, sep=sep)
+                return array
+        else:
+            return np.fromfile(infile, dtype=dtype, count=count, sep=sep)
     else:
         # treat as file-like object with "read" method; this includes gzip file
         # objects, because numpy.fromfile just reads the compressed bytes from
diff --git a/astropy/io/votable/setup_package.py b/astropy/io/votable/setup_package.py
index 881f291..d33e51c 100755
--- a/astropy/io/votable/setup_package.py
+++ b/astropy/io/votable/setup_package.py
@@ -1,4 +1,6 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
+from __future__ import absolute_import
+
 from distutils.core import Extension
 from os.path import join
 
diff --git a/astropy/modeling/core.py b/astropy/modeling/core.py
index 97bfea6..100b2e4 100644
--- a/astropy/modeling/core.py
+++ b/astropy/modeling/core.py
@@ -1274,6 +1274,20 @@ def _format_single_model_input(func, model, params, inputs, input_names,
 
     outputs = func(model, *inputs, **kwargs)
 
+    if model.n_outputs > model.n_inputs:
+        if len(set(broadcasts)) > 1:
+            raise ValueError(
+                "For models with n_outputs > n_inputs, the combination of "
+                "all inputs and parameters must broadcast to the same shape, "
+                "which will be used as the shape of all outputs.  In this "
+                "case some of the inputs had different shapes, so it is "
+                "ambiguous how to format outputs for this model.  Try using "
+                "inputs that are all the same size and shape.")
+        else:
+            # Extend the broadcasts list to include shapes for all outputs
+            extra_outputs = model.n_outputs - model.n_inputs
+            broadcasts.extend([broadcasts[0]] * extra_outputs)
+
     if model.n_outputs == 1:
         outputs = [outputs]
     else:
diff --git a/astropy/modeling/functional_models.py b/astropy/modeling/functional_models.py
index d1ccd08..db806d5 100644
--- a/astropy/modeling/functional_models.py
+++ b/astropy/modeling/functional_models.py
@@ -633,7 +633,16 @@ class Const1D(Fittable1DModel):
     def eval(x, amplitude):
         """One dimensional Constant model function"""
 
-        return amplitude * np.ones_like(x)
+        if amplitude.size == 1:
+            # This is slighly faster than using ones_like and multiplying
+            x = np.empty_like(x)
+            x.fill(amplitude.item())
+        else:
+            # This case is less likely but could occur if the amplitude
+            # parameter is given an array-like value
+            x = amplitude * np.ones_like(x)
+
+        return x
 
     @staticmethod
     def fit_deriv(x, amplitude):
@@ -673,7 +682,16 @@ class Const2D(Fittable2DModel):
     def eval(x, y, amplitude):
         """Two dimensional Constant model function"""
 
-        return amplitude * np.ones_like(x)
+        if amplitude.size == 1:
+            # This is slighly faster than using ones_like and multiplying
+            x = np.empty_like(x)
+            x.fill(amplitude.item())
+        else:
+            # This case is less likely but could occur if the amplitude
+            # parameter is given an array-like value
+            x = amplitude * np.ones_like(x)
+
+        return x
 
 
 class Disk2D(Fittable2DModel):
diff --git a/astropy/modeling/tests/test_input.py b/astropy/modeling/tests/test_input.py
index 3e6ca7e..49f155f 100644
--- a/astropy/modeling/tests/test_input.py
+++ b/astropy/modeling/tests/test_input.py
@@ -12,7 +12,7 @@ from numpy.testing.utils import assert_allclose
 
 from .. import models
 from .. import fitting
-from ..core import Model, Fittable1DModel, format_input
+from ..core import Model, FittableModel, Fittable1DModel, format_input
 from ..parameters import Parameter
 from ...tests.helper import pytest
 
@@ -646,6 +646,222 @@ class TestSingleInputSingleOutputTwoModel(object):
                             [[14.07, 25.08, 36.09], [14.10, 25.11, 36.12]]])
 
 
+class TestModel_1_2(FittableModel):
+    n_inputs = 1
+    n_outputs = 2
+
+    p1 = Parameter()
+    p2 = Parameter()
+    p3 = Parameter()
+
+    @staticmethod
+    def eval(x, p1, p2, p3):
+        return (x + p1 + p2, x + p1 + p2 + p3)
+
+    @format_input
+    def __call__(self, x, model_set_axis=None):
+        """
+        Transforms data using this model.
+
+        Parameters
+        ----------
+        x : array-like or numeric value
+            Input coordinate values.
+
+        model_set_axis : `int` or `False`, optional
+            For `Model` instances representing a multiple-model set, this picks
+            out which axis of the input array is used to map inputs to specific
+            models in the set.  If `False`, this indicates that the input array
+            has no such axis, and instead the same input should be broadcast to
+            all models in the set.
+        """
+
+        return self.eval(x, *self.param_sets)
+
+
+class TestSingleInputDoubleOutputSingleModel(object):
+    """
+    A suite of tests to check various cases of parameter and input combinations
+    on models with n_input = 1 but n_output = 2 on a toy model with n_models=1.
+
+    As of writing there are not enough controls to adjust how outputs from such
+    a model should be formatted (currently the shapes of outputs are assumed to
+    be directly associated with the shapes of corresponding inputs when
+    n_inputs == n_outputs).  For now, the approach taken for cases like this is
+    to assume all outputs should have the same format.
+    """
+
+    def test_scalar_parameters_scalar_input(self):
+        """
+        Scalar parameters with a scalar input should return a scalar.
+        """
+
+        t = TestModel_1_2(1, 10, 1000)
+        y, z = t(100)
+        assert isinstance(y, float)
+        assert isinstance(z, float)
+        assert np.ndim(y) == np.ndim(z) == 0
+        assert y == 111
+        assert z == 1111
+
+    def test_scalar_parameters_1d_array_input(self):
+        """
+        Scalar parameters should broadcast with an array input to result in an
+        array output of the same shape as the input.
+        """
+
+        t = TestModel_1_2(1, 10, 1000)
+        y, z = t(np.arange(5) * 100)
+        assert isinstance(y, np.ndarray)
+        assert isinstance(z, np.ndarray)
+        assert np.shape(y) == np.shape(z) == (5,)
+        assert np.all(y == [11, 111, 211, 311, 411])
+        assert np.all(z == (y + 1000))
+
+    def test_scalar_parameters_2d_array_input(self):
+        """
+        Scalar parameters should broadcast with an array input to result in an
+        array output of the same shape as the input.
+        """
+
+        t = TestModel_1_2(1, 10, 1000)
+        y, z = t(np.arange(6).reshape(2, 3) * 100)
+        assert isinstance(y, np.ndarray)
+        assert isinstance(z, np.ndarray)
+        assert np.shape(y) == np.shape(z) == (2, 3)
+        assert np.all(y == [[11, 111, 211],
+                            [311, 411, 511]])
+        assert np.all(z == (y + 1000))
+
+    def test_scalar_parameters_3d_array_input(self):
+        """
+        Scalar parameters should broadcast with an array input to result in an
+        array output of the same shape as the input.
+        """
+
+        t = TestModel_1_2(1, 10, 1000)
+        y, z = t(np.arange(12).reshape(2, 3, 2) * 100)
+        assert isinstance(y, np.ndarray)
+        assert isinstance(z, np.ndarray)
+        assert np.shape(y) == np.shape(z) == (2, 3, 2)
+        assert np.all(y == [[[11, 111], [211, 311], [411, 511]],
+                            [[611, 711], [811, 911], [1011, 1111]]])
+        assert np.all(z == (y + 1000))
+
+    def test_1d_array_parameters_scalar_input(self):
+        """
+        Array parameters should all be broadcastable with each other, and with
+        a scalar input the output should be broadcast to the maximum dimensions
+        of the parameters.
+        """
+
+        t = TestModel_1_2([1, 2], [10, 20], [1000, 2000])
+        y, z = t(100)
+        assert isinstance(y, np.ndarray)
+        assert isinstance(z, np.ndarray)
+        assert np.shape(y) == np.shape(z) == (2,)
+        assert np.all(y == [111, 122])
+        assert np.all(z == [1111, 2122])
+
+    def test_1d_array_parameters_1d_array_input(self):
+        """
+        When given an array input it must be broadcastable with all the
+        parameters.
+        """
+
+        t = TestModel_1_2([1, 2], [10, 20], [1000, 2000])
+        y1, z1 = t([100, 200])
+        assert np.shape(y1) == np.shape(z1) == (2,)
+        assert np.all(y1 == [111, 222])
+        assert np.all(z1 == [1111, 2222])
+
+        y2, z2 = t([[100], [200]])
+        assert np.shape(y2) == np.shape(z2) == (2, 2)
+        assert np.all(y2 == [[111, 122], [211, 222]])
+        assert np.all(z2 == [[1111, 2122], [1211, 2222]])
+
+        with pytest.raises(ValueError):
+            # Doesn't broadcast
+            y3, z3 = t([100, 200, 300])
+
+    def test_2d_array_parameters_2d_array_input(self):
+        """
+        When given an array input it must be broadcastable with all the
+        parameters.
+        """
+
+        t = TestModel_1_2([[1, 2], [3, 4]], [[10, 20], [30, 40]],
+                          [[1000, 2000], [3000, 4000]])
+
+        y1, z1 = t([[100, 200], [300, 400]])
+        assert np.shape(y1) == np.shape(z1) == (2, 2)
+        assert np.all(y1 == [[111, 222], [333, 444]])
+        assert np.all(z1 == [[1111, 2222], [3333, 4444]])
+
+        y2, z2 = t([[[[100]], [[200]]], [[[300]], [[400]]]])
+        assert np.shape(y2) == np.shape(z2) == (2, 2, 2, 2)
+        assert np.all(y2 == [[[[111, 122], [133, 144]],
+                              [[211, 222], [233, 244]]],
+                             [[[311, 322], [333, 344]],
+                              [[411, 422], [433, 444]]]])
+        assert np.all(z2 == [[[[1111, 2122], [3133, 4144]],
+                              [[1211, 2222], [3233, 4244]]],
+                             [[[1311, 2322], [3333, 4344]],
+                              [[1411, 2422], [3433, 4444]]]])
+
+        with pytest.raises(ValueError):
+            # Doesn't broadcast
+            y3, z3 = t([[100, 200, 300], [400, 500, 600]])
+
+    def test_mixed_array_parameters_1d_array_input(self):
+        """
+        When given an array input it must be broadcastable with all the
+        parameters.
+        """
+
+        t = TestModel_1_2([[[0.01, 0.02, 0.03], [0.04, 0.05, 0.06]],
+                           [[0.07, 0.08, 0.09], [0.10, 0.11, 0.12]]],
+                          [1, 2, 3], [100, 200, 300])
+
+        y1, z1 = t([10, 20, 30])
+        assert np.shape(y1) == np.shape(z1) == (2, 2, 3)
+        assert_allclose(y1, [[[11.01, 22.02, 33.03], [11.04, 22.05, 33.06]],
+                             [[11.07, 22.08, 33.09], [11.10, 22.11, 33.12]]])
+        assert_allclose(z1, [[[111.01, 222.02, 333.03],
+                              [111.04, 222.05, 333.06]],
+                             [[111.07, 222.08, 333.09],
+                              [111.10, 222.11, 333.12]]])
+
+
+        y2, z2 = t([[[[10]]], [[[20]]], [[[30]]]])
+        assert np.shape(y2) == np.shape(z2) == (3, 2, 2, 3)
+        assert_allclose(y2, [[[[11.01, 12.02, 13.03],
+                               [11.04, 12.05, 13.06]],
+                              [[11.07, 12.08, 13.09],
+                               [11.10, 12.11, 13.12]]],
+                             [[[21.01, 22.02, 23.03],
+                               [21.04, 22.05, 23.06]],
+                              [[21.07, 22.08, 23.09],
+                               [21.10, 22.11, 23.12]]],
+                             [[[31.01, 32.02, 33.03],
+                               [31.04, 32.05, 33.06]],
+                              [[31.07, 32.08, 33.09],
+                               [31.10, 32.11, 33.12]]]])
+
+        assert_allclose(z2, [[[[111.01, 212.02, 313.03],
+                               [111.04, 212.05, 313.06]],
+                              [[111.07, 212.08, 313.09],
+                               [111.10, 212.11, 313.12]]],
+                             [[[121.01, 222.02, 323.03],
+                               [121.04, 222.05, 323.06]],
+                              [[121.07, 222.08, 323.09],
+                               [121.10, 222.11, 323.12]]],
+                             [[[131.01, 232.02, 333.03],
+                               [131.04, 232.05, 333.06]],
+                              [[131.07, 232.08, 333.09],
+                               [131.10, 232.11, 333.12]]]])
+
+
 class TestInputFormatter(Model):
     """
     A toy model to test format_input
diff --git a/astropy/modeling/tests/test_rotations.py b/astropy/modeling/tests/test_rotations.py
index 9263615..3688fdc 100644
--- a/astropy/modeling/tests/test_rotations.py
+++ b/astropy/modeling/tests/test_rotations.py
@@ -51,4 +51,4 @@ def test_Rotation2D_inverse():
     model = models.Rotation2D(angle=234.23494)
     inverse = model.inverse()
     x, y = inverse(*model(1, 0))
-    utils.assert_allclose([x, y], [1, 0])
+    utils.assert_allclose([x, y], [1, 0], atol=1e-10)
diff --git a/astropy/stats/funcs.py b/astropy/stats/funcs.py
index bf35951..06517b5 100644
--- a/astropy/stats/funcs.py
+++ b/astropy/stats/funcs.py
@@ -700,7 +700,7 @@ def biweight_midvariance(a, c=9.0, M=None):
 
     .. math::
 
-      C_{bl}= n^{1/2} \\frac{[\Sigma_{|u_i|<1} (x_i-M)**2(1-u_i^2)^4]^{0.5}}
+      C_{bl}= (n')^{1/2} \\frac{[\Sigma_{|u_i|<1} (x_i-M)^2(1-u_i^2)^4]^{0.5}}
       {|\Sigma_{|u_i|<1} (1-u_i^2)(1-5u_i^2)|}
 
     where :math:`u_i` is given by
@@ -709,8 +709,19 @@ def biweight_midvariance(a, c=9.0, M=None):
 
       u_{i} = \\frac{(x_i-M)}{cMAD}
 
-    where MAD is the median absolute deviation.  For the midvariance
-    parameter, c is typically uses a value of 9.0.
+    where MAD is the median absolute deviation.
+
+    :math:`n'` is the number of data for which :math:`|u_i| < 1` holds, while the
+    summations are over all i up to n:
+
+    .. math::
+
+        n' = \Sigma_{|u_i|<1}^n 1
+
+    This is slightly different than given in the reference below, but
+    results in a value closer to the true midvariance.
+
+    The midvariance parameter c is typically 9.0.
 
     For more details, see Beers, Flynn, and Gebhardt, 1990, AJ, 100, 32B
 
diff --git a/astropy/table/_np_utils.c b/astropy/table/_np_utils.c
index 2866890..dd75136 100644
--- a/astropy/table/_np_utils.c
+++ b/astropy/table/_np_utils.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -264,17 +246,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -288,40 +259,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -353,20 +441,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "_np_utils.pyx",
-  "numpy.pxd",
+  "astropy/table/_np_utils.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -393,7 +481,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -402,7 +490,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -411,7 +499,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -420,7 +508,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -429,7 +517,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -438,7 +526,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -447,7 +535,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -456,7 +544,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -465,7 +553,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -474,7 +562,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -483,7 +571,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -492,7 +580,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -501,7 +589,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -510,7 +598,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -519,7 +607,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -528,7 +616,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -537,7 +625,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -546,7 +634,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -555,7 +643,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -564,7 +652,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -573,7 +661,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -613,7 +701,7 @@ typedef __pyx_t_5numpy_intp_t __pyx_t_7astropy_5table_9_np_utils_DTYPE_t;
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -622,7 +710,7 @@ typedef __pyx_t_5numpy_intp_t __pyx_t_7astropy_5table_9_np_utils_DTYPE_t;
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -631,7 +719,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -640,7 +728,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -661,7 +749,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -698,165 +786,96 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
-                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
-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) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (PyList_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if (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 {  /* inlined PySequence_SetItem() */
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_ass_item)) {
-            if (unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (unlikely(l < 0)) return -1;
-                i += l;
-            }
-            return m->sq_ass_item(o, i, v);
-        }
-    }
-#else
-#if CYTHON_COMPILING_IN_PYPY
-    if (PySequence_Check(o) && !PyDict_Check(o)) {
-#else
-    if (PySequence_Check(o)) {
-#endif
-        return PySequence_SetItem(o, i, v);
-    }
-#endif
-    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
-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;
-}
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
 #if CYTHON_COMPILING_IN_CPYTHON
-    if (PyList_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if (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 = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {  /* inlined PySequence_GetItem() */
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (unlikely(l < 0)) return NULL;
-                i += l;
-            }
-            return m->sq_item(o, i);
-        }
-    }
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
 #else
-    if (PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
 #endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+#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);
+
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+                                                     int is_list, int wraparound, int boundscheck);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
 
@@ -864,9 +883,24 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -890,16 +924,20 @@ typedef struct {
 #endif
 
 
-  static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
+static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
+static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
 
-static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_from_py_Py_intptr_t(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
 
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -913,7 +951,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t);
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -999,37 +1037,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -1041,28 +1049,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+static PyObject *__Pyx_ImportModule(const char *name);
 
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cython' */
@@ -1106,151 +1097,163 @@ static PyObject *__pyx_builtin_RuntimeError;
 static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_idxs, PyArrayObject *__pyx_v_idx_sort, int __pyx_v_len_left, int __pyx_v_jointype); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "ndarray is not C contiguous";
-static char __pyx_k_3[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_5[] = "Non-native byte order not supported";
-static char __pyx_k_7[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_8[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_11[] = "Format string allocated too short.";
-static char __pyx_k_13[] = "\nCython utilities for numpy structured arrays.\n\njoin_inner():  Do the inner-loop cartesian product for np_utils.join() processing.\n               (The \"inner\" is about the inner loop, not inner join).\n";
-static char __pyx_k_14[] = "numpy.ma";
-static char __pyx_k_15[] = "*";
-static char __pyx_k_16[] = "numpy.lib.recfunctions";
-static char __pyx_k_19[] = "/internal/1/root/src/astropy/astropy/astropy/table/_np_utils.pyx";
-static char __pyx_k_20[] = "astropy.table._np_utils";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__ii[] = "ii";
-static char __pyx_k__ma[] = "ma";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__idx[] = "idx";
-static char __pyx_k__int[] = "int";
-static char __pyx_k__bool[] = "bool";
-static char __pyx_k__idx0[] = "idx0";
-static char __pyx_k__idx1[] = "idx1";
-static char __pyx_k__idxs[] = "idxs";
-static char __pyx_k__DTYPE[] = "DTYPE";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__i_out[] = "i_out";
-static char __pyx_k__n_out[] = "n_out";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__i_left[] = "i_left";
-static char __pyx_k__masked[] = "masked";
-static char __pyx_k__n_left[] = "n_left";
-static char __pyx_k__i_right[] = "i_right";
-static char __pyx_k__n_right[] = "n_right";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__idx_sort[] = "idx_sort";
-static char __pyx_k__jointype[] = "jointype";
-static char __pyx_k__key_idxs[] = "key_idxs";
-static char __pyx_k__left_out[] = "left_out";
-static char __pyx_k__len_left[] = "len_left";
-static char __pyx_k__left_idxs[] = "left_idxs";
-static char __pyx_k__left_mask[] = "left_mask";
-static char __pyx_k__right_out[] = "right_out";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__join_inner[] = "join_inner";
-static char __pyx_k__right_idxs[] = "right_idxs";
-static char __pyx_k__right_mask[] = "right_mask";
-static char __pyx_k__drop_fields[] = "drop_fields";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k__max_key_idxs[] = "max_key_idxs";
-static PyObject *__pyx_kp_u_1;
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_n_s_14;
-static PyObject *__pyx_n_s_15;
-static PyObject *__pyx_n_s_16;
-static PyObject *__pyx_kp_s_19;
-static PyObject *__pyx_n_s_20;
-static PyObject *__pyx_kp_u_3;
-static PyObject *__pyx_kp_u_5;
-static PyObject *__pyx_kp_u_7;
-static PyObject *__pyx_kp_u_8;
-static PyObject *__pyx_n_s__DTYPE;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bool;
-static PyObject *__pyx_n_s__drop_fields;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__i_left;
-static PyObject *__pyx_n_s__i_out;
-static PyObject *__pyx_n_s__i_right;
-static PyObject *__pyx_n_s__idx;
-static PyObject *__pyx_n_s__idx0;
-static PyObject *__pyx_n_s__idx1;
-static PyObject *__pyx_n_s__idx_sort;
-static PyObject *__pyx_n_s__idxs;
-static PyObject *__pyx_n_s__ii;
-static PyObject *__pyx_n_s__int;
-static PyObject *__pyx_n_s__join_inner;
-static PyObject *__pyx_n_s__jointype;
-static PyObject *__pyx_n_s__key_idxs;
-static PyObject *__pyx_n_s__left_idxs;
-static PyObject *__pyx_n_s__left_mask;
-static PyObject *__pyx_n_s__left_out;
-static PyObject *__pyx_n_s__len_left;
-static PyObject *__pyx_n_s__ma;
-static PyObject *__pyx_n_s__masked;
-static PyObject *__pyx_n_s__max_key_idxs;
-static PyObject *__pyx_n_s__n_left;
-static PyObject *__pyx_n_s__n_out;
-static PyObject *__pyx_n_s__n_right;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__right_idxs;
-static PyObject *__pyx_n_s__right_mask;
-static PyObject *__pyx_n_s__right_out;
-static PyObject *__pyx_n_s__zeros;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k__7[] = "*";
+static char __pyx_k_ii[] = "ii";
+static char __pyx_k_ma[] = "ma";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_idx[] = "idx";
+static char __pyx_k_int[] = "int";
+static char __pyx_k_bool[] = "bool";
+static char __pyx_k_idx0[] = "idx0";
+static char __pyx_k_idx1[] = "idx1";
+static char __pyx_k_idxs[] = "idxs";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_DTYPE[] = "DTYPE";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_i_out[] = "i_out";
+static char __pyx_k_n_out[] = "n_out";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_i_left[] = "i_left";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_masked[] = "masked";
+static char __pyx_k_n_left[] = "n_left";
+static char __pyx_k_i_right[] = "i_right";
+static char __pyx_k_n_right[] = "n_right";
+static char __pyx_k_idx_sort[] = "idx_sort";
+static char __pyx_k_jointype[] = "jointype";
+static char __pyx_k_key_idxs[] = "key_idxs";
+static char __pyx_k_left_out[] = "left_out";
+static char __pyx_k_len_left[] = "len_left";
+static char __pyx_k_numpy_ma[] = "numpy.ma";
+static char __pyx_k_left_idxs[] = "left_idxs";
+static char __pyx_k_left_mask[] = "left_mask";
+static char __pyx_k_right_out[] = "right_out";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_join_inner[] = "join_inner";
+static char __pyx_k_right_idxs[] = "right_idxs";
+static char __pyx_k_right_mask[] = "right_mask";
+static char __pyx_k_drop_fields[] = "drop_fields";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_max_key_idxs[] = "max_key_idxs";
+static char __pyx_k_numpy_lib_recfunctions[] = "numpy.lib.recfunctions";
+static char __pyx_k_astropy_table__np_utils[] = "astropy.table._np_utils";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_Cython_utilities_for_numpy_stru[] = "\nCython utilities for numpy structured arrays.\n\njoin_inner():  Do the inner-loop cartesian product for np_utils.join() processing.\n               (The \"inner\" is about the inner loop, not inner join).\n";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/table/_np_utils.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_n_s_DTYPE;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s__7;
+static PyObject *__pyx_n_s_astropy_table__np_utils;
+static PyObject *__pyx_n_s_bool;
+static PyObject *__pyx_n_s_drop_fields;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_i_left;
+static PyObject *__pyx_n_s_i_out;
+static PyObject *__pyx_n_s_i_right;
+static PyObject *__pyx_n_s_idx;
+static PyObject *__pyx_n_s_idx0;
+static PyObject *__pyx_n_s_idx1;
+static PyObject *__pyx_n_s_idx_sort;
+static PyObject *__pyx_n_s_idxs;
+static PyObject *__pyx_n_s_ii;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_join_inner;
+static PyObject *__pyx_n_s_jointype;
+static PyObject *__pyx_n_s_key_idxs;
+static PyObject *__pyx_n_s_left_idxs;
+static PyObject *__pyx_n_s_left_mask;
+static PyObject *__pyx_n_s_left_out;
+static PyObject *__pyx_n_s_len_left;
+static PyObject *__pyx_n_s_ma;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_masked;
+static PyObject *__pyx_n_s_max_key_idxs;
+static PyObject *__pyx_n_s_n_left;
+static PyObject *__pyx_n_s_n_out;
+static PyObject *__pyx_n_s_n_right;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_numpy_lib_recfunctions;
+static PyObject *__pyx_n_s_numpy_ma;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_right_idxs;
+static PyObject *__pyx_n_s_right_mask;
+static PyObject *__pyx_n_s_right_out;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_zeros;
 static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_9;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_12;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_codeobj_18;
+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__8;
+static PyObject *__pyx_codeobj__9;
+
+/* "astropy/table/_np_utils.pyx":19
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def join_inner(np.ndarray[DTYPE_t, ndim=1] idxs,             # <<<<<<<<<<<<<<
+ *                np.ndarray[DTYPE_t, ndim=1] idx_sort,
+ *                int len_left,
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_5table_9_np_utils_join_inner[] = "\n    Do the inner-loop cartesian product for np_utils.join() processing.\n    (The \"inner\" is about the inner loop, not inner join).\n    ";
-static PyMethodDef __pyx_mdef_7astropy_5table_9_np_utils_1join_inner = {__Pyx_NAMESTR("join_inner"), (PyCFunction)__pyx_pw_7astropy_5table_9_np_utils_1join_inner, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_5table_9_np_utils_join_inner)};
+static PyMethodDef __pyx_mdef_7astropy_5table_9_np_utils_1join_inner = {"join_inner", (PyCFunction)__pyx_pw_7astropy_5table_9_np_utils_1join_inner, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_5table_9_np_utils_join_inner};
 static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_idxs = 0;
   PyArrayObject *__pyx_v_idx_sort = 0;
   int __pyx_v_len_left;
   int __pyx_v_jointype;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("join_inner (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__idxs,&__pyx_n_s__idx_sort,&__pyx_n_s__len_left,&__pyx_n_s__jointype,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idxs,&__pyx_n_s_idx_sort,&__pyx_n_s_len_left,&__pyx_n_s_jointype,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1266,20 +1269,20 @@ static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__idxs)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idxs)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__idx_sort)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_idx_sort)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("join_inner", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len_left)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_len_left)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("join_inner", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__jointype)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jointype)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("join_inner", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1297,8 +1300,8 @@ static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx
     }
     __pyx_v_idxs = ((PyArrayObject *)values[0]);
     __pyx_v_idx_sort = ((PyArrayObject *)values[1]);
-    __pyx_v_len_left = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_len_left == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_jointype = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_jointype == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_len_left = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_left == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_jointype = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_jointype == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
@@ -1311,6 +1314,8 @@ static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idxs), __pyx_ptype_5numpy_ndarray, 1, "idxs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx_sort), __pyx_ptype_5numpy_ndarray, 1, "idx_sort", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_5table_9_np_utils_join_inner(__pyx_self, __pyx_v_idxs, __pyx_v_idx_sort, __pyx_v_len_left, __pyx_v_jointype);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1319,14 +1324,6 @@ static PyObject *__pyx_pw_7astropy_5table_9_np_utils_1join_inner(PyObject *__pyx
   return __pyx_r;
 }
 
-/* "astropy/table/_np_utils.pyx":19
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def join_inner(np.ndarray[DTYPE_t, ndim=1] idxs,             # <<<<<<<<<<<<<<
- *                np.ndarray[DTYPE_t, ndim=1] idx_sort,
- *                int len_left,
- */
-
 static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_idxs, PyArrayObject *__pyx_v_idx_sort, int __pyx_v_len_left, int __pyx_v_jointype) {
   int __pyx_v_n_out;
   int __pyx_v_max_key_idxs;
@@ -1470,7 +1467,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *             max_key_idxs = key_idxs
  * 
  */
-    __pyx_t_5 = (__pyx_v_key_idxs > __pyx_v_max_key_idxs);
+    __pyx_t_5 = ((__pyx_v_key_idxs > __pyx_v_max_key_idxs) != 0);
     if (__pyx_t_5) {
 
       /* "astropy/table/_np_utils.pyx":43
@@ -1531,7 +1528,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_left += 1
  *             else:
  */
-      __pyx_t_5 = (__pyx_v_i < __pyx_v_len_left);
+      __pyx_t_5 = ((__pyx_v_i < __pyx_v_len_left) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":51
@@ -1593,7 +1590,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 masked = 1
  *                 n_left = 1
  */
-      __pyx_t_5 = (__pyx_v_n_left == 0);
+      __pyx_t_5 = ((__pyx_v_n_left == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":60
@@ -1624,7 +1621,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 masked = 1
  *                 n_right = 1
  */
-      __pyx_t_5 = (__pyx_v_n_right == 0);
+      __pyx_t_5 = ((__pyx_v_n_right == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":63
@@ -1665,7 +1662,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 masked = 1
  *                 n_right = 1
  */
-      __pyx_t_5 = (__pyx_v_n_right == 0);
+      __pyx_t_5 = ((__pyx_v_n_right == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":67
@@ -1706,7 +1703,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 masked = 1
  *                 n_left = 1
  */
-      __pyx_t_5 = (__pyx_v_n_left == 0);
+      __pyx_t_5 = ((__pyx_v_n_left == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":71
@@ -1730,6 +1727,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
       }
       __pyx_L12:;
       break;
+      default: break;
     }
 
     /* "astropy/table/_np_utils.pyx":74
@@ -1749,12 +1747,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     cdef np.ndarray right_out = np.empty(n_out, dtype=DTYPE)
  *     cdef np.ndarray left_mask = np.zeros(n_out, dtype=np.bool)
  */
-  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = PyInt_FromLong(__pyx_v_n_out); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_n_out); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1762,16 +1760,16 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_9);
   __pyx_t_9 = 0;
   __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_left_out = ((PyArrayObject *)__pyx_t_12);
   __pyx_t_12 = 0;
@@ -1783,12 +1781,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     cdef np.ndarray left_mask = np.zeros(n_out, dtype=np.bool)
  *     cdef np.ndarray right_mask = np.zeros(n_out, dtype=np.bool)
  */
-  __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __pyx_t_12 = PyInt_FromLong(__pyx_v_n_out); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_n_out); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1796,16 +1794,16 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_12);
   __pyx_t_12 = 0;
   __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
-  __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
-  if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_right_out = ((PyArrayObject *)__pyx_t_10);
   __pyx_t_10 = 0;
@@ -1817,12 +1815,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     cdef np.ndarray right_mask = np.zeros(n_out, dtype=np.bool)
  *     cdef np.ndarray left_idxs = np.empty(max_key_idxs, dtype=DTYPE)
  */
-  __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__zeros); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_10 = PyInt_FromLong(__pyx_v_n_out); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n_out); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1830,19 +1828,19 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_10);
   __pyx_t_10 = 0;
   __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
-  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__bool); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_bool); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_left_mask = ((PyArrayObject *)__pyx_t_13);
   __pyx_t_13 = 0;
@@ -1854,12 +1852,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     cdef np.ndarray left_idxs = np.empty(max_key_idxs, dtype=DTYPE)
  *     cdef np.ndarray right_idxs = np.empty(max_key_idxs, dtype=DTYPE)
  */
-  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_10 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__zeros); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __pyx_t_13 = PyInt_FromLong(__pyx_v_n_out); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_n_out); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1867,19 +1865,19 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_13);
   __pyx_t_13 = 0;
   __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
-  __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_13);
+  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__bool); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_bool); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
   if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_right_mask = ((PyArrayObject *)__pyx_t_9);
   __pyx_t_9 = 0;
@@ -1891,12 +1889,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     cdef np.ndarray right_idxs = np.empty(max_key_idxs, dtype=DTYPE)
  * 
  */
-  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = PyInt_FromLong(__pyx_v_max_key_idxs); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_max_key_idxs); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1904,16 +1902,16 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_9);
   __pyx_t_9 = 0;
   __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-  __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
-  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_10 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_left_idxs = ((PyArrayObject *)__pyx_t_10);
   __pyx_t_10 = 0;
@@ -1925,12 +1923,12 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  * 
  *     i_out = 0
  */
-  __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_10 = PyInt_FromLong(__pyx_v_max_key_idxs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_max_key_idxs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -1938,16 +1936,16 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_10);
   __pyx_t_10 = 0;
   __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
-  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
-  if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __pyx_t_13 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_right_idxs = ((PyArrayObject *)__pyx_t_13);
   __pyx_t_13 = 0;
@@ -2038,7 +2036,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 left_idxs[n_left] = i
  *                 n_left += 1
  */
-      __pyx_t_5 = (__pyx_v_i < __pyx_v_len_left);
+      __pyx_t_5 = ((__pyx_v_i < __pyx_v_len_left) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":94
@@ -2048,9 +2046,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_left += 1
  *             else:
  */
-        __pyx_t_13 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_13);
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), __pyx_v_n_left, __pyx_t_13, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), __pyx_v_n_left, __pyx_t_13, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
         /* "astropy/table/_np_utils.pyx":95
@@ -2072,9 +2070,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_right += 1
  * 
  */
-        __pyx_t_13 = PyInt_FromLong((__pyx_v_i - __pyx_v_len_left)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_PyInt_From_int((__pyx_v_i - __pyx_v_len_left)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_13);
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), __pyx_v_n_right, __pyx_t_13, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), __pyx_v_n_right, __pyx_t_13, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
         /* "astropy/table/_np_utils.pyx":98
@@ -2124,7 +2122,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 left_idxs[0] = -1
  *                 n_left = 1
  */
-      __pyx_t_5 = (__pyx_v_n_left == 0);
+      __pyx_t_5 = ((__pyx_v_n_left == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":104
@@ -2134,7 +2132,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_left = 1
  *             if n_right == 0:
  */
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), 0, __pyx_int_neg_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), 0, __pyx_int_neg_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
         /* "astropy/table/_np_utils.pyx":105
  *             if n_left == 0:
@@ -2155,7 +2153,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 right_idxs[0] = -1
  *                 n_right = 1
  */
-      __pyx_t_5 = (__pyx_v_n_right == 0);
+      __pyx_t_5 = ((__pyx_v_n_right == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":107
@@ -2165,7 +2163,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_right = 1
  *         elif jointype == 2:
  */
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), 0, __pyx_int_neg_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), 0, __pyx_int_neg_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
         /* "astropy/table/_np_utils.pyx":108
  *             if n_right == 0:
@@ -2196,7 +2194,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 right_idxs[0] = -1
  *                 n_right = 1
  */
-      __pyx_t_5 = (__pyx_v_n_right == 0);
+      __pyx_t_5 = ((__pyx_v_n_right == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":111
@@ -2206,7 +2204,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_right = 1
  *         elif jointype == 3:
  */
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), 0, __pyx_int_neg_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_right_idxs), 0, __pyx_int_neg_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
         /* "astropy/table/_np_utils.pyx":112
  *             if n_right == 0:
@@ -2237,7 +2235,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 left_idxs[0] = -1
  *                 n_left = 1
  */
-      __pyx_t_5 = (__pyx_v_n_left == 0);
+      __pyx_t_5 = ((__pyx_v_n_left == 0) != 0);
       if (__pyx_t_5) {
 
         /* "astropy/table/_np_utils.pyx":115
@@ -2247,7 +2245,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 n_left = 1
  * 
  */
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), 0, __pyx_int_neg_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_left_idxs), 0, __pyx_int_neg_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
         /* "astropy/table/_np_utils.pyx":116
  *             if n_left == 0:
@@ -2261,6 +2259,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
       }
       __pyx_L21:;
       break;
+      default: break;
     }
 
     /* "astropy/table/_np_utils.pyx":118
@@ -2292,9 +2291,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 if idx < 0:
  *                     idx = 0
  */
-        __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_left_idxs), __pyx_v_i_left, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_left_idxs), __pyx_v_i_left, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_19 = __Pyx_PyInt_from_py_Py_intptr_t(__pyx_t_13); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_19 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_13); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         __pyx_v_idx = __pyx_t_19;
 
@@ -2305,7 +2304,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                     idx = 0
  *                     left_mask[i_out] = 1
  */
-        __pyx_t_5 = (__pyx_v_idx < 0);
+        __pyx_t_5 = ((__pyx_v_idx < 0) != 0);
         if (__pyx_t_5) {
 
           /* "astropy/table/_np_utils.pyx":122
@@ -2324,7 +2323,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 left_out[i_out] = idx
  * 
  */
-          if (__Pyx_SetItemInt(((PyObject *)__pyx_v_left_mask), __pyx_v_i_out, __pyx_int_1, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_left_mask), __pyx_v_i_out, __pyx_int_1, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           goto __pyx_L26;
         }
         __pyx_L26:;
@@ -2336,9 +2335,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  * 
  *                 idx = right_idxs[i_right]
  */
-        __pyx_t_13 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_idx); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_idx); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_13);
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_left_out), __pyx_v_i_out, __pyx_t_13, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_left_out), __pyx_v_i_out, __pyx_t_13, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
         /* "astropy/table/_np_utils.pyx":126
@@ -2348,9 +2347,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 if idx < 0:
  *                     idx = 0
  */
-        __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_right_idxs), __pyx_v_i_right, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_right_idxs), __pyx_v_i_right, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_19 = __Pyx_PyInt_from_py_Py_intptr_t(__pyx_t_13); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_19 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_13); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         __pyx_v_idx = __pyx_t_19;
 
@@ -2361,7 +2360,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                     idx = 0
  *                     right_mask[i_out] = 1
  */
-        __pyx_t_5 = (__pyx_v_idx < 0);
+        __pyx_t_5 = ((__pyx_v_idx < 0) != 0);
         if (__pyx_t_5) {
 
           /* "astropy/table/_np_utils.pyx":128
@@ -2380,7 +2379,7 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *                 right_out[i_out] = idx
  * 
  */
-          if (__Pyx_SetItemInt(((PyObject *)__pyx_v_right_mask), __pyx_v_i_out, __pyx_int_1, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_right_mask), __pyx_v_i_out, __pyx_int_1, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           goto __pyx_L27;
         }
         __pyx_L27:;
@@ -2392,9 +2391,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  * 
  *                 i_out += 1
  */
-        __pyx_t_13 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_idx); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_idx); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_13);
-        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_right_out), __pyx_v_i_out, __pyx_t_13, sizeof(__pyx_t_7astropy_5table_9_np_utils_DTYPE_t), __Pyx_PyInt_to_py_Py_intptr_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_right_out), __pyx_v_i_out, __pyx_t_13, __pyx_t_7astropy_5table_9_np_utils_DTYPE_t, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
         /* "astropy/table/_np_utils.pyx":132
@@ -2415,9 +2414,9 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
  *     return masked, n_out, left_out, left_mask, right_out, right_mask             # <<<<<<<<<<<<<<
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_13 = PyInt_FromLong(__pyx_v_masked); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_masked); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_10 = PyInt_FromLong(__pyx_v_n_out); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n_out); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
   __pyx_t_11 = PyTuple_New(6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_11);
@@ -2439,12 +2438,19 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   __Pyx_GIVEREF(((PyObject *)__pyx_v_right_mask));
   __pyx_t_13 = 0;
   __pyx_t_10 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_11);
+  __pyx_r = __pyx_t_11;
   __pyx_t_11 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/table/_np_utils.pyx":19
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def join_inner(np.ndarray[DTYPE_t, ndim=1] idxs,             # <<<<<<<<<<<<<<
+ *                np.ndarray[DTYPE_t, ndim=1] idx_sort,
+ *                int len_left,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_XDECREF(__pyx_t_10);
@@ -2474,6 +2480,14 @@ static PyObject *__pyx_pf_7astropy_5table_9_np_utils_join_inner(CYTHON_UNUSED Py
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -2481,18 +2495,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -2508,13 +2516,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2524,22 +2530,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -2548,7 +2552,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -2557,7 +2561,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -2566,17 +2570,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -2588,7 +2592,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -2599,87 +2603,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -2688,7 +2692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -2697,16 +2701,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -2715,7 +2720,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -2724,18 +2729,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -2744,7 +2749,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -2753,11 +2758,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -2766,7 +2771,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -2775,9 +2780,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -2786,7 +2791,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -2795,16 +2800,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -2813,19 +2818,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -2834,23 +2839,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -2862,11 +2869,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -2879,328 +2886,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_7), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -3209,7 +3192,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -3218,11 +3201,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -3231,7 +3213,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -3240,7 +3222,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -3249,17 +3231,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -3268,13 +3250,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -3293,39 +3283,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -3337,17 +3329,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -3359,10 +3351,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -3379,7 +3380,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -3393,8 +3394,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3405,7 +3413,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -3422,7 +3430,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -3436,8 +3444,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3448,7 +3463,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -3465,7 +3480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -3479,8 +3494,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3491,7 +3513,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -3508,7 +3530,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -3522,8 +3544,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3534,7 +3563,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -3551,7 +3580,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -3565,8 +3594,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3577,7 +3613,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -3599,20 +3635,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -3621,7 +3654,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -3630,18 +3663,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -3649,33 +3682,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -3697,129 +3728,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
+    } else {
+    }
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
     } else {
-      __pyx_t_8 = __pyx_t_7;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_8) {
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -3827,15 +3828,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -3844,7 +3845,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -3853,413 +3854,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_7), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -4267,25 +4265,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -4295,13 +4301,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -4314,7 +4326,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -4326,9 +4338,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -4336,9 +4349,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -4350,7 +4364,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -4359,7 +4373,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -4370,7 +4384,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -4379,7 +4393,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -4388,10 +4402,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -4405,17 +4428,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -4426,11 +4449,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -4440,9 +4462,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -4460,8 +4489,8 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("_np_utils"),
-    __Pyx_DOCSTR(__pyx_k_13), /* m_doc */
+    "_np_utils",
+    __pyx_k_Cython_utilities_for_numpy_stru, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
     NULL, /* m_reload */
@@ -4472,63 +4501,64 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
-  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
-  {&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1},
-  {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1},
-  {&__pyx_n_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 1},
-  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
-  {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
-  {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0},
-  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
-  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
-  {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
-  {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bool, __pyx_k__bool, sizeof(__pyx_k__bool), 0, 0, 1, 1},
-  {&__pyx_n_s__drop_fields, __pyx_k__drop_fields, sizeof(__pyx_k__drop_fields), 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__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
-  {&__pyx_n_s__i_left, __pyx_k__i_left, sizeof(__pyx_k__i_left), 0, 0, 1, 1},
-  {&__pyx_n_s__i_out, __pyx_k__i_out, sizeof(__pyx_k__i_out), 0, 0, 1, 1},
-  {&__pyx_n_s__i_right, __pyx_k__i_right, sizeof(__pyx_k__i_right), 0, 0, 1, 1},
-  {&__pyx_n_s__idx, __pyx_k__idx, sizeof(__pyx_k__idx), 0, 0, 1, 1},
-  {&__pyx_n_s__idx0, __pyx_k__idx0, sizeof(__pyx_k__idx0), 0, 0, 1, 1},
-  {&__pyx_n_s__idx1, __pyx_k__idx1, sizeof(__pyx_k__idx1), 0, 0, 1, 1},
-  {&__pyx_n_s__idx_sort, __pyx_k__idx_sort, sizeof(__pyx_k__idx_sort), 0, 0, 1, 1},
-  {&__pyx_n_s__idxs, __pyx_k__idxs, sizeof(__pyx_k__idxs), 0, 0, 1, 1},
-  {&__pyx_n_s__ii, __pyx_k__ii, sizeof(__pyx_k__ii), 0, 0, 1, 1},
-  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
-  {&__pyx_n_s__join_inner, __pyx_k__join_inner, sizeof(__pyx_k__join_inner), 0, 0, 1, 1},
-  {&__pyx_n_s__jointype, __pyx_k__jointype, sizeof(__pyx_k__jointype), 0, 0, 1, 1},
-  {&__pyx_n_s__key_idxs, __pyx_k__key_idxs, sizeof(__pyx_k__key_idxs), 0, 0, 1, 1},
-  {&__pyx_n_s__left_idxs, __pyx_k__left_idxs, sizeof(__pyx_k__left_idxs), 0, 0, 1, 1},
-  {&__pyx_n_s__left_mask, __pyx_k__left_mask, sizeof(__pyx_k__left_mask), 0, 0, 1, 1},
-  {&__pyx_n_s__left_out, __pyx_k__left_out, sizeof(__pyx_k__left_out), 0, 0, 1, 1},
-  {&__pyx_n_s__len_left, __pyx_k__len_left, sizeof(__pyx_k__len_left), 0, 0, 1, 1},
-  {&__pyx_n_s__ma, __pyx_k__ma, sizeof(__pyx_k__ma), 0, 0, 1, 1},
-  {&__pyx_n_s__masked, __pyx_k__masked, sizeof(__pyx_k__masked), 0, 0, 1, 1},
-  {&__pyx_n_s__max_key_idxs, __pyx_k__max_key_idxs, sizeof(__pyx_k__max_key_idxs), 0, 0, 1, 1},
-  {&__pyx_n_s__n_left, __pyx_k__n_left, sizeof(__pyx_k__n_left), 0, 0, 1, 1},
-  {&__pyx_n_s__n_out, __pyx_k__n_out, sizeof(__pyx_k__n_out), 0, 0, 1, 1},
-  {&__pyx_n_s__n_right, __pyx_k__n_right, sizeof(__pyx_k__n_right), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__right_idxs, __pyx_k__right_idxs, sizeof(__pyx_k__right_idxs), 0, 0, 1, 1},
-  {&__pyx_n_s__right_mask, __pyx_k__right_mask, sizeof(__pyx_k__right_mask), 0, 0, 1, 1},
-  {&__pyx_n_s__right_out, __pyx_k__right_out, sizeof(__pyx_k__right_out), 0, 0, 1, 1},
-  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
+  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 1},
+  {&__pyx_n_s_astropy_table__np_utils, __pyx_k_astropy_table__np_utils, sizeof(__pyx_k_astropy_table__np_utils), 0, 0, 1, 1},
+  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
+  {&__pyx_n_s_drop_fields, __pyx_k_drop_fields, sizeof(__pyx_k_drop_fields), 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_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+  {&__pyx_n_s_i_left, __pyx_k_i_left, sizeof(__pyx_k_i_left), 0, 0, 1, 1},
+  {&__pyx_n_s_i_out, __pyx_k_i_out, sizeof(__pyx_k_i_out), 0, 0, 1, 1},
+  {&__pyx_n_s_i_right, __pyx_k_i_right, sizeof(__pyx_k_i_right), 0, 0, 1, 1},
+  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
+  {&__pyx_n_s_idx0, __pyx_k_idx0, sizeof(__pyx_k_idx0), 0, 0, 1, 1},
+  {&__pyx_n_s_idx1, __pyx_k_idx1, sizeof(__pyx_k_idx1), 0, 0, 1, 1},
+  {&__pyx_n_s_idx_sort, __pyx_k_idx_sort, sizeof(__pyx_k_idx_sort), 0, 0, 1, 1},
+  {&__pyx_n_s_idxs, __pyx_k_idxs, sizeof(__pyx_k_idxs), 0, 0, 1, 1},
+  {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_join_inner, __pyx_k_join_inner, sizeof(__pyx_k_join_inner), 0, 0, 1, 1},
+  {&__pyx_n_s_jointype, __pyx_k_jointype, sizeof(__pyx_k_jointype), 0, 0, 1, 1},
+  {&__pyx_n_s_key_idxs, __pyx_k_key_idxs, sizeof(__pyx_k_key_idxs), 0, 0, 1, 1},
+  {&__pyx_n_s_left_idxs, __pyx_k_left_idxs, sizeof(__pyx_k_left_idxs), 0, 0, 1, 1},
+  {&__pyx_n_s_left_mask, __pyx_k_left_mask, sizeof(__pyx_k_left_mask), 0, 0, 1, 1},
+  {&__pyx_n_s_left_out, __pyx_k_left_out, sizeof(__pyx_k_left_out), 0, 0, 1, 1},
+  {&__pyx_n_s_len_left, __pyx_k_len_left, sizeof(__pyx_k_len_left), 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_masked, __pyx_k_masked, sizeof(__pyx_k_masked), 0, 0, 1, 1},
+  {&__pyx_n_s_max_key_idxs, __pyx_k_max_key_idxs, sizeof(__pyx_k_max_key_idxs), 0, 0, 1, 1},
+  {&__pyx_n_s_n_left, __pyx_k_n_left, sizeof(__pyx_k_n_left), 0, 0, 1, 1},
+  {&__pyx_n_s_n_out, __pyx_k_n_out, sizeof(__pyx_k_n_out), 0, 0, 1, 1},
+  {&__pyx_n_s_n_right, __pyx_k_n_right, sizeof(__pyx_k_n_right), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy_lib_recfunctions, __pyx_k_numpy_lib_recfunctions, sizeof(__pyx_k_numpy_lib_recfunctions), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy_ma, __pyx_k_numpy_ma, sizeof(__pyx_k_numpy_ma), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_right_idxs, __pyx_k_right_idxs, sizeof(__pyx_k_right_idxs), 0, 0, 1, 1},
+  {&__pyx_n_s_right_mask, __pyx_k_right_mask, sizeof(__pyx_k_right_mask), 0, 0, 1, 1},
+  {&__pyx_n_s_right_out, __pyx_k_right_out, sizeof(__pyx_k_right_out), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -4538,71 +4568,71 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_2);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_6);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_8)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_9);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_5)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_12 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_11)); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_12);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
   /* "astropy/table/_np_utils.pyx":19
  * @cython.wraparound(False)
@@ -4611,10 +4641,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                np.ndarray[DTYPE_t, ndim=1] idx_sort,
  *                int len_left,
  */
-  __pyx_k_tuple_17 = PyTuple_Pack(24, ((PyObject *)__pyx_n_s__idxs), ((PyObject *)__pyx_n_s__idx_sort), ((PyObject *)__pyx_n_s__len_left), ((PyObject *)__pyx_n_s__jointype), ((PyObject *)__pyx_n_s__n_out), ((PyObject *)__pyx_n_s__max_key_idxs), ((PyObject *)__pyx_n_s__ii), ((PyObject *)__pyx_n_s__key_idxs), ((PyObject *)__pyx_n_s__n_left), ((PyObject *)__pyx_n_s__n_right), ((PyObject *)__pyx_n_s__idx0), ((PyObject *)__pyx_n_s__idx1), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__ [...]
-  __Pyx_GOTREF(__pyx_k_tuple_17);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-  __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(4, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_19, __pyx_n_s__join_inner, 19, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__8 = PyTuple_Pack(24, __pyx_n_s_idxs, __pyx_n_s_idx_sort, __pyx_n_s_len_left, __pyx_n_s_jointype, __pyx_n_s_n_out, __pyx_n_s_max_key_idxs, __pyx_n_s_ii, __pyx_n_s_key_idxs, __pyx_n_s_n_left, __pyx_n_s_n_right, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_idx, __pyx_n_s_i, __pyx_n_s_i_left, __pyx_n_s_i_right, __pyx_n_s_i_out, __pyx_n_s_masked, __pyx_n_s_left_out, __pyx_n_s_right_out, __pyx_n_s_left_mask, __pyx_n_s_right_mask, __pyx_n_s_left_idxs, __pyx_n_s_right_idxs); if (unli [...]
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_join_inner, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -4624,9 +4654,8 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -4642,6 +4671,9 @@ PyMODINIT_FUNC PyInit__np_utils(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -4674,11 +4706,26 @@ PyMODINIT_FUNC PyInit__np_utils(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_np_utils"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_13), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("_np_utils", __pyx_methods, __pyx_k_Cython_utilities_for_numpy_stru, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__table___np_utils) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -4687,16 +4734,6 @@ PyMODINIT_FUNC PyInit__np_utils(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__table___np_utils) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -4729,9 +4766,9 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  * import numpy.ma as ma
  * from numpy.lib.recfunctions import drop_fields
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/table/_np_utils.pyx":9
@@ -4743,13 +4780,13 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  */
   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s_15));
-  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_15));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_15));
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_14), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s__7);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__7);
+  __Pyx_GIVEREF(__pyx_n_s__7);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_ma, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/table/_np_utils.pyx":10
@@ -4761,19 +4798,15 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  */
   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drop_fields));
-  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__drop_fields));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drop_fields));
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_16), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_drop_fields);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_drop_fields);
+  __Pyx_GIVEREF(__pyx_n_s_drop_fields);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy_lib_recfunctions, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__drop_fields);
-  if (__pyx_t_2 == NULL) {
-    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__drop_fields);
-    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_drop_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__drop_fields, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_drop_fields, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -4784,12 +4817,12 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  * ctypedef np.intp_t DTYPE_t
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/table/_np_utils.pyx":19
@@ -4799,9 +4832,9 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  *                np.ndarray[DTYPE_t, ndim=1] idx_sort,
  *                int len_left,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_5table_9_np_utils_1join_inner, NULL, __pyx_n_s_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_5table_9_np_utils_1join_inner, NULL, __pyx_n_s_astropy_table__np_utils); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__join_inner, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_join_inner, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/table/_np_utils.pyx":1
@@ -4810,23 +4843,28 @@ PyMODINIT_FUNC PyInit__np_utils(void)
  * 
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.table._np_utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.table._np_utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.table._np_utils");
@@ -4855,19 +4893,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -4892,7 +4928,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -4996,12 +5032,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -5011,23 +5047,29 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -5079,7 +5121,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -5324,7 +5366,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -5332,7 +5374,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -5341,7 +5383,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -5371,8 +5413,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -5412,10 +5456,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -5440,7 +5484,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -5452,7 +5496,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -5465,12 +5509,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -5491,21 +5535,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -5574,9 +5622,45 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
   __Pyx_ReleaseBuffer(info);
 }
 
+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;
+}
+
+#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
+
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -5586,6 +5670,132 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     return 0;
 }
 
+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, int wraparound, 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))
+                        PyErr_Clear();
+                    else
+                        return -1;
+                }
+            }
+            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);
+}
+
+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,
+                                                              int wraparound, 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,
+                                                              int wraparound, 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, int wraparound, 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))
+                        PyErr_Clear();
+                    else
+                        return NULL;
+                }
+            }
+            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));
+}
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -5635,11 +5845,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -5654,26 +5860,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -5683,7 +5876,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -5704,46 +5897,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -5753,6 +5962,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -5760,6 +5976,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -5774,7 +5991,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -5782,133 +5999,208 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-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;
+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;
+}
+
+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) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    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;
     }
-    return 0;
-#endif
+    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);
 }
 
-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();
+#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
     }
-    return 0;
+    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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
-    PyErr_WriteUnraisable(obj);
-nofail:
     Py_DECREF(obj);
     view->obj = NULL;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
+#endif
 
 
-    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+        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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -5926,7 +6218,6 @@ nofail:
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -5948,7 +6239,7 @@ nofail:
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -5965,14 +6256,6 @@ nofail:
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -5982,98 +6265,296 @@ bad:
     return module;
 }
 
-static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
-#if PY_MAJOR_VERSION < 3
-    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
-                 PyString_AsString(name));
-#else
-    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
 #endif
-}
 
-static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_from_py_Py_intptr_t(PyObject* x) {
-    const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0;
-    const int is_unsigned = const_zero < neg_one;
-    if (sizeof(Py_intptr_t) == sizeof(char)) {
-        if (is_unsigned)
-            return (Py_intptr_t)__Pyx_PyInt_AsUnsignedChar(x);
-        else
-            return (Py_intptr_t)__Pyx_PyInt_AsSignedChar(x);
-    } else if (sizeof(Py_intptr_t) == sizeof(short)) {
-        if (is_unsigned)
-            return (Py_intptr_t)__Pyx_PyInt_AsUnsignedShort(x);
-        else
-            return (Py_intptr_t)__Pyx_PyInt_AsSignedShort(x);
-    } else if (sizeof(Py_intptr_t) == sizeof(int)) {
-        if (is_unsigned)
-            return (Py_intptr_t)__Pyx_PyInt_AsUnsignedInt(x);
-        else
-            return (Py_intptr_t)__Pyx_PyInt_AsSignedInt(x);
-    } else if (sizeof(Py_intptr_t) == sizeof(long)) {
-        if (is_unsigned)
-            return (Py_intptr_t)__Pyx_PyInt_AsUnsignedLong(x);
-        else
-            return (Py_intptr_t)__Pyx_PyInt_AsSignedLong(x);
-    } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) {
-        if (is_unsigned)
-            return (Py_intptr_t)__Pyx_PyInt_AsUnsignedLongLong(x);
-        else
-            return (Py_intptr_t)__Pyx_PyInt_AsSignedLongLong(x);
-    }  else {
-        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-        PyErr_SetString(PyExc_RuntimeError,
-                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-        #else
-        Py_intptr_t val;
-        PyObject *v = __Pyx_PyNumber_Int(x);
-        #if PY_VERSION_HEX < 0x03000000
-        if (likely(v) && !PyLong_Check(v)) {
-            PyObject *tmp = v;
-            v = PyNumber_Long(tmp);
-            Py_DECREF(tmp);
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 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;
         }
-        #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;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+            }
         }
-        #endif
-        return (Py_intptr_t)-1;
+        {
+#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_Int(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_Int(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;
 }
 
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) {
-    const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0;
-    const int is_unsigned = const_zero < neg_one;
-    if ((sizeof(Py_intptr_t) == sizeof(char))  ||
-        (sizeof(Py_intptr_t) == sizeof(short))) {
-        return PyInt_FromLong((long)val);
-    } else if ((sizeof(Py_intptr_t) == sizeof(int)) ||
-               (sizeof(Py_intptr_t) == sizeof(long))) {
-        if (is_unsigned)
-            return PyLong_FromUnsignedLong((unsigned long)val);
-        else
-            return PyInt_FromLong((long)val);
-    } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) {
-        if (is_unsigned)
-            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
-        else
-            return PyLong_FromLongLong((PY_LONG_LONG)val);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
     } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
         int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&val;
-        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
                                      little, !is_unsigned);
     }
 }
 
-#if CYTHON_CCOMPLEX
+static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
+    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(Py_intptr_t) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (Py_intptr_t) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(Py_intptr_t) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyLong_AsLong(x))
+            } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(Py_intptr_t, 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
+            Py_intptr_t val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (Py_intptr_t) -1;
+        }
+    } else {
+        Py_intptr_t val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (Py_intptr_t) -1;
+        val = __Pyx_PyInt_As_Py_intptr_t(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to Py_intptr_t");
+    return (Py_intptr_t) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to Py_intptr_t");
+    return (Py_intptr_t) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
+    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(Py_intptr_t) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(Py_intptr_t) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
+                                     little, !is_unsigned);
+    }
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
+    }
+}
+
+#if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
       return ::std::complex< float >(x, y);
@@ -6313,404 +6794,99 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) {
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
         } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
             }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
+            return (long) val;
         }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
-        }
-        return (signed long)val;
-    } else
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
         }
-        return (signed PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+        {
+#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_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+ #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 {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        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;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -6723,11 +6899,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -6777,7 +6949,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -6797,15 +6969,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -6817,168 +6985,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -6989,7 +6995,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -7009,6 +7015,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -7018,14 +7089,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -7041,13 +7112,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -7061,35 +7132,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/table/column.py b/astropy/table/column.py
index 74dc8c6..b1edd8a 100644
--- a/astropy/table/column.py
+++ b/astropy/table/column.py
@@ -817,6 +817,20 @@ class MaskedColumn(Column, ma.MaskedArray):
                          meta=deepcopy(self.meta))
         return out
 
+    def __getitem__(self, item):
+        out = super(MaskedColumn, self).__getitem__(item)
+
+        # Fixes issue #3023: when calling getitem with a MaskedArray subclass
+        # the original object attributes are not copied.
+        if out.__class__ is self.__class__:
+            out.parent_table = None
+            for attr in ('name', 'unit', 'format', 'description'):
+                val = getattr(self, attr, None)
+                setattr(out, attr, val)
+            out.meta = deepcopy(getattr(self, 'meta', {}))
+
+        return out
+
     # We do this to make the methods show up in the API docs
     name = BaseColumn.name
     copy = BaseColumn.copy
diff --git a/astropy/table/groups.py b/astropy/table/groups.py
index a080054..62f3ae5 100644
--- a/astropy/table/groups.py
+++ b/astropy/table/groups.py
@@ -235,8 +235,8 @@ class ColumnGroups(BaseGroups):
             else:
                 vals = np.array([func(par_col[i0: i1]) for i0, i1 in izip(i0s, i1s)])
         except Exception:
-            raise TypeError("Cannot aggregate column '{0}'"
-                            .format(par_col.name))
+            raise TypeError("Cannot aggregate column '{0}' with type '{1}'"
+                            .format(par_col.name, par_col.dtype))
 
         out = par_col.__class__(data=vals, name=par_col.name, description=par_col.description,
                                 unit=par_col.unit, format=par_col.format, meta=par_col.meta)
diff --git a/astropy/table/np_utils.py b/astropy/table/np_utils.py
index e19f571..9af6c2b 100644
--- a/astropy/table/np_utils.py
+++ b/astropy/table/np_utils.py
@@ -277,7 +277,7 @@ def join(left, right, keys=None, join_type='inner',
             name, array, array_out, array_mask = right_name, right, right_out, right_mask
         else:
             raise TableMergeError('Unexpected column names (maybe one is ""?)')
-        out[out_name] = array[name].take(array_out)
+        out[out_name] = array[name].take(array_out, axis=0)
         if masked:
             if isinstance(array, ma.MaskedArray):
                 array_mask = array_mask | array[name].mask.take(array_out)
@@ -578,3 +578,26 @@ def fix_column_name(val):
             raise
 
     return val
+
+
+def recarray_fromrecords(rec_list):
+    """
+    Partial replacement for `~numpy.core.records.fromrecords` which includes
+    a workaround for the bug with unicode arrays described at:
+    https://github.com/astropy/astropy/issues/3052
+
+    This should not serve as a full replacement for the original function;
+    this only does enough to fulfill the needs of the table module.
+    """
+
+    # Note: This is just copying what Numpy does for converting arbitrary rows
+    # to column arrays in the recarray module; it could be there is a better
+    # way
+    nfields = len(rec_list[0])
+    obj = np.array(rec_list, dtype=object)
+    array_list = [np.array(obj[..., i].tolist()) for i in range(nfields)]
+    formats = []
+    for obj in array_list:
+        formats.append(obj.dtype.str)
+    formats = ','.join(formats)
+    return np.rec.fromarrays(array_list, formats=formats)
diff --git a/astropy/table/setup_package.py b/astropy/table/setup_package.py
index c5829f5..3283e19 100644
--- a/astropy/table/setup_package.py
+++ b/astropy/table/setup_package.py
@@ -1,4 +1,6 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
+from __future__ import absolute_import
+
 import os
 from distutils.extension import Extension
 
diff --git a/astropy/table/table.py b/astropy/table/table.py
index 3fd480d..e8adfea 100644
--- a/astropy/table/table.py
+++ b/astropy/table/table.py
@@ -25,7 +25,7 @@ from . import groups
 from .pprint import TableFormatter
 from .column import BaseColumn, Column, MaskedColumn, _auto_names
 from .row import Row
-from .np_utils import fix_column_name
+from .np_utils import fix_column_name, recarray_fromrecords
 
 
 # Prior to Numpy 1.6.2, there was a bug (in Numpy) that caused
@@ -178,7 +178,7 @@ class Table(object):
             elif isinstance(rows, self.Row):
                 data = rows
             else:
-                rec_data = np.rec.fromrecords(rows)
+                rec_data = recarray_fromrecords(rows)
                 data = [rec_data[name] for name in rec_data.dtype.names]
 
         # Infer the type of the input data and set up the initialization
@@ -423,7 +423,7 @@ class Table(object):
         if copy:
             self._init_from_list(cols, names, dtype, n_cols, copy)
         else:
-            dtype = [(name, col.dtype) for name, col in zip(names, cols)]
+            dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)]
             self._data = data.view(dtype).ravel()
             columns = self.TableColumns()
 
diff --git a/astropy/table/tests/test_column.py b/astropy/table/tests/test_column.py
index 5c78a00..a29a2fb 100644
--- a/astropy/table/tests/test_column.py
+++ b/astropy/table/tests/test_column.py
@@ -160,6 +160,33 @@ class TestColumn():
         assert np.all(c.data == np.array([100,200,300]))
         assert np.all(c.unit == u.cm)
 
+    def test_attrs_survive_getitem_after_change(self, Column):
+        """
+        Test for issue #3023: when calling getitem with a MaskedArray subclass
+        the original object attributes are not copied.
+        """
+        c1 = Column([1, 2, 3], name='a', unit='m', format='i',
+                    description='aa', meta={'a': 1})
+        c1.name = 'b'
+        c1.unit = 'km'
+        c1.format = 'i2'
+        c1.description = 'bb'
+        c1.meta = {'bbb': 2}
+
+        for item in (slice(None, None), slice(None, 1), np.array([0, 2]),
+                     np.array([False, True, False])):
+            c2 = c1[item]
+            assert c2.name == 'b'
+            assert c2.unit is u.km
+            assert c2.format == 'i2'
+            assert c2.description == 'bb'
+            assert c2.meta == {'bbb': 2}
+
+        # Make sure that calling getitem resulting in a scalar does
+        # not copy attributes.
+        val = c1[1]
+        for attr in ('name', 'unit', 'format', 'description', 'meta'):
+            assert not hasattr(val, attr)
 
 class TestAttrEqual():
     """Bunch of tests originally from ATpy that test the attrs_equal method."""
diff --git a/astropy/table/tests/test_init_table.py b/astropy/table/tests/test_init_table.py
index 9590526..a84bb16 100644
--- a/astropy/table/tests/test_init_table.py
+++ b/astropy/table/tests/test_init_table.py
@@ -418,6 +418,9 @@ class TestInitFromRows():
             assert t.colnames == ['a', 'b']
             assert t['a'].dtype.kind == 'i'
             assert t['b'].dtype.kind in ('S', 'U')
+            # Regression test for
+            # https://github.com/astropy/astropy/issues/3052
+            assert t['b'].dtype.str.endswith('1')
 
         rows = np.arange(6).reshape(2, 3)
         t = table_type(rows=rows, names=('a', 'b', 'c'), dtype=['f8', 'f4', 'i8'])
@@ -433,3 +436,27 @@ class TestInitFromRows():
         with pytest.raises(ValueError) as err:
             table_type(data=[[1]], rows=[[1]])
         assert "Cannot supply both `data` and `rows` values" in str(err)
+
+ at pytest.mark.usefixtures('table_type')
+def test_init_and_ref_from_multidim_ndarray(table_type):
+    """
+    Test that initializing from an ndarray structured array with
+    a multi-dim column works for both copy=False and True and that
+    the referencing is as expected.
+    """
+    for copy in (False, True):
+        nd = np.array([(1, [10, 20]),
+                       (3, [30, 40])],
+                      dtype=[(str('a'), 'i8'), (str('b'), 'i8', (2,))])
+        t = table_type(nd, copy=copy)
+        assert t.colnames == ['a', 'b']
+        assert t['a'].shape == (2,)
+        assert t['b'].shape == (2, 2)
+        t['a'][0] = -200
+        t['b'][1][1] = -100
+        if copy:
+            assert nd[str('a')][0] == 1
+            assert nd[str('b')][1][1] == 40
+        else:
+            assert nd[str('a')][0] == -200
+            assert nd[str('b')][1][1] == -100
diff --git a/astropy/table/tests/test_operations.py b/astropy/table/tests/test_operations.py
index bb04299..99eb66f 100644
--- a/astropy/table/tests/test_operations.py
+++ b/astropy/table/tests/test_operations.py
@@ -355,6 +355,25 @@ class TestJoin():
             assert ("In merged column 'a' the 'unit' attribute does not match (cm != m)"
                     in str(warning_lines[0].message))
 
+    def test_join_multidimensional(self):
+
+        # Regression test for #2984, which was an issue where join did not work
+        # on multi-dimensional columns.
+
+        t1 = Table()
+        t1['a'] = [1,2,3]
+        t1['b'] = np.ones((3,4))
+
+        t2 = Table()
+        t2['a'] = [1,2,3]
+        t2['c'] = [4,5,6]
+
+        t3 = table.join(t1, t2)
+
+        np.testing.assert_allclose(t3['a'], t1['a'])
+        np.testing.assert_allclose(t3['b'], t1['b'])
+        np.testing.assert_allclose(t3['c'], t2['c'])
+
 
 class TestVStack():
 
diff --git a/astropy/table/tests/test_table.py b/astropy/table/tests/test_table.py
index ff7417e..5ae6195 100644
--- a/astropy/table/tests/test_table.py
+++ b/astropy/table/tests/test_table.py
@@ -230,6 +230,15 @@ class TestEmptyData():
         t.add_column(table_types.Column(name='a'))  # dtype is not specified
         assert len(t['a']) == 0
 
+    def test_add_via_setitem_and_slice(self, table_types):
+        """Test related to #3023 where a MaskedColumn is created with name=None
+        and then gets changed to name='a'.  After PR #2790 this test fails
+        without the #3023 fix."""
+        t = table_types.Table()
+        t['a'] = table_types.Column([1, 2, 3])
+        t2 = t[:]
+        assert t2.colnames == t.colnames
+
 
 @pytest.mark.usefixtures('table_types')
 class TestNewFromColumns():
diff --git a/astropy/tests/helper.py b/astropy/tests/helper.py
index 05161d3..f523141 100644
--- a/astropy/tests/helper.py
+++ b/astropy/tests/helper.py
@@ -110,7 +110,7 @@ class TestRunner(object):
     def run_tests(self, package=None, test_path=None, args=None, plugins=None,
                   verbose=False, pastebin=None, remote_data=False, pep8=False,
                   pdb=False, coverage=False, open_files=False, parallel=0,
-                  docs_path=None, skip_docs=False):
+                  docs_path=None, skip_docs=False, repeat=None):
         """
         The docstring for this method lives in astropy/__init__.py:test
         """
@@ -242,6 +242,9 @@ class TestRunner(object):
                 parallel = multiprocessing.cpu_count()
             all_args.extend(['-n', six.text_type(parallel)])
 
+        if repeat:
+            all_args.append('--repeat={0}'.format(repeat))
+
         if six.PY2:
             all_args = [x.encode('utf-8') for x in all_args]
 
diff --git a/astropy/tests/pytest_plugins.py b/astropy/tests/pytest_plugins.py
index 8a0a463..ce8f3d8 100644
--- a/astropy/tests/pytest_plugins.py
+++ b/astropy/tests/pytest_plugins.py
@@ -60,6 +60,20 @@ def pytest_addoption(parser):
                   "Run the doctests in the rst documentation",
                   default=False)
 
+    parser.addoption('--repeat', action='store',
+                     help='Number of times to repeat each test')
+
+
+def pytest_generate_tests(metafunc):
+
+    # If the repeat option is set, we add a fixture for the repeat count and
+    # parametrize the tests over the repeats. Solution adapted from:
+    # http://stackoverflow.com/q/21764473/180783
+
+    if metafunc.config.option.repeat is not None:
+        count = int(metafunc.config.option.repeat)
+        metafunc.fixturenames.append('tmp_ct')
+        metafunc.parametrize('tmp_ct', range(count))
 
 # We monkey-patch in our replacement doctest OutputChecker.  Not
 # great, but there isn't really an API to replace the checker when
@@ -597,7 +611,7 @@ class ModifiedModule(pytest.Module):
     def _importtestmodule(self):
         # We have to remove the __future__ statements *before* parsing
         # with compile, otherwise the flags are ignored.
-        content = re.sub(_RE_FUTURE_IMPORTS, b'', self.content)
+        content = re.sub(_RE_FUTURE_IMPORTS, b'\n', self.content)
 
         new_mod = types.ModuleType(self.mod_name)
         new_mod.__file__ = six.text_type(self.fspath)
diff --git a/astropy/time/core.py b/astropy/time/core.py
index fb88789..266f66a 100644
--- a/astropy/time/core.py
+++ b/astropy/time/core.py
@@ -1268,13 +1268,13 @@ class TimeDelta(Time):
 
         try:
             jd1, jd2 = day_frac(self.jd1, self.jd2, factor=other)
+            out = TimeDelta(jd1, jd2, format='jd', scale=self.scale)
         except Exception as err:  # try downgrading self to a quantity
             try:
                 return self.to(u.day) * other
             except:
                 raise err
 
-        out = TimeDelta(jd1, jd2, format='jd', scale=self.scale)
         if self.format != 'jd':
             out = out.replicate(format=self.format)
         return out
@@ -1301,14 +1301,13 @@ class TimeDelta(Time):
 
         try:   # convert to straight float if dimensionless quantity
             jd1, jd2 = day_frac(self.jd1, self.jd2, divisor=other)
+            out = TimeDelta(jd1, jd2, format='jd', scale=self.scale)
         except Exception as err:  # try downgrading self to a quantity
             try:
                 return self.to(u.day) / other
             except:
                 raise err
 
-        out = TimeDelta(jd1, jd2, format='jd', scale=self.scale)
-
         if self.format != 'jd':
             out = out.replicate(format=self.format)
         return out
diff --git a/astropy/time/erfa_time.c b/astropy/time/erfa_time.c
index 466151f..87bc13b 100644
--- a/astropy/time/erfa_time.c
+++ b/astropy/time/erfa_time.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.18 on Tue Sep 23 16:50:23 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #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 < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#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, 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)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#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))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#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)
@@ -178,11 +146,17 @@
   #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_VERSION_HEX < 0x03020000
+#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
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#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 PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#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
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -265,17 +247,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-#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
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -289,40 +260,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_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)))  )
+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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (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;
+    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
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* 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;
@@ -354,20 +442,20 @@ static const char *__pyx_filename;
 
 
 static const char *__pyx_f[] = {
-  "erfa_time.pyx",
-  "numpy.pxd",
+  "astropy/time/erfa_time.pyx",
+  "__init__.pxd",
   "type.pxd",
 };
 #define IS_UNSIGNED(type) (((type) -1) > 0)
 struct __Pyx_StructField_;
 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
 typedef struct {
-  const char* name; /* for error messages only */
+  const char* name;
   struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  size_t arraysize[8]; /* length of array in each dimension */
+  size_t size;
+  size_t arraysize[8];
   int ndim;
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char typegroup;
   char is_unsigned;
   int flags;
 } __Pyx_TypeInfo;
@@ -394,7 +482,7 @@ typedef struct {
 } __Pyx_BufFmt_Context;
 
 
-/* "numpy.pxd":723
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -403,7 +491,7 @@ typedef struct {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -412,7 +500,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -421,7 +509,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -430,7 +518,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -439,7 +527,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -448,7 +536,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -457,7 +545,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -466,7 +554,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -475,7 +563,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -484,7 +572,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -493,7 +581,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -502,7 +590,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -511,7 +599,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -520,7 +608,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -529,7 +617,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -538,7 +626,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -547,7 +635,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -556,7 +644,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -565,7 +653,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -574,7 +662,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -614,7 +702,7 @@ typedef __pyx_t_5numpy_double_t __pyx_t_7astropy_4time_9erfa_time_DOUBLE_T;
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -623,7 +711,7 @@ typedef __pyx_t_5numpy_double_t __pyx_t_7astropy_4time_9erfa_time_DOUBLE_T;
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -632,7 +720,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -641,7 +729,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -662,7 +750,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -699,173 +787,104 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#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)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
 static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
     int result = PySequence_Contains(seq, item);
     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
 }
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#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
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
-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;
-}
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (PyList_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if (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 = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {  /* inlined PySequence_GetItem() */
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (unlikely(l < 0)) return NULL;
-                i += l;
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
-
-#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
-                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
-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) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (PyList_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if (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 {  /* inlined PySequence_SetItem() */
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_ass_item)) {
-            if (unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (unlikely(l < 0)) return -1;
-                i += l;
-            }
-            return m->sq_ass_item(o, i, v);
-        }
-    }
-#else
-#if CYTHON_COMPILING_IN_PYPY
-    if (PySequence_Check(o) && !PyDict_Check(o)) {
-#else
-    if (PySequence_Check(o)) {
-#endif
-        return PySequence_SetItem(o, i, v);
-    }
-#endif
-    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+                                                     int is_list, int wraparound, int boundscheck);
+
+static void __Pyx_RaiseBufferIndexError(int axis);
+
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
+               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
+static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
+                                               int is_list, int wraparound, int boundscheck);
 
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
 
@@ -873,9 +892,24 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
 typedef struct {
   Py_ssize_t shape, strides, suboffsets;
@@ -899,12 +933,24 @@ typedef struct {
 #endif
 
 
-  static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
+static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
 
-static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -918,7 +964,7 @@ static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -1004,38 +1050,6 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
 static int __Pyx_check_binary_version(void);
 
 #if !defined(__Pyx_PyIdentifier_FromString)
@@ -1046,28 +1060,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
-
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+static PyObject *__Pyx_ImportModule(const char *name);
 
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -1148,342 +1145,344 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_3[] = "{0}: {1}";
-static char __pyx_k_4[] = "Unexpected return code {0} from {1}";
-static char __pyx_k_5[] = "Bad input day (JD still computed)";
-static char __pyx_k_6[] = "Bad input year";
-static char __pyx_k_7[] = "Bad input month";
-static char __pyx_k_8[] = "bad year";
-static char __pyx_k_9[] = "bad month (must be 1 to 12)";
-static char __pyx_k_10[] = "bad day (must be within normal calendar date for a month)";
-static char __pyx_k_11[] = "bad fraction of day";
-static char __pyx_k_12[] = "unacceptable date";
-static char __pyx_k_13[] = "time is after end of day and ";
-static char __pyx_k_14[] = "time is after end of day";
-static char __pyx_k_15[] = "bad month";
-static char __pyx_k_16[] = "bad day";
-static char __pyx_k_17[] = "bad hour";
-static char __pyx_k_18[] = "bad minute";
-static char __pyx_k_19[] = "bad second (< 0)";
-static char __pyx_k_20[] = "ideg outside range 0-359";
-static char __pyx_k_21[] = "iamin outside range 0-59";
-static char __pyx_k_22[] = "asec outside range 0-59.999...";
-static char __pyx_k_24[] = "illegal identifier";
-static char __pyx_k_25[] = "illegal case";
-static char __pyx_k_26[] = "ndarray is not C contiguous";
-static char __pyx_k_28[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_30[] = "Non-native byte order not supported";
-static char __pyx_k_32[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_33[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_36[] = "Format string allocated too short.";
-static char __pyx_k_38[] = "utils.exceptions";
-static char __pyx_k_39[] = "dubious year for UTC (before 1960.0 or 5 years beyond last known leap second)";
-static char __pyx_k_42[] = "/internal/1/root/src/astropy/astropy/astropy/time/erfa_time.pyx";
-static char __pyx_k_43[] = "astropy.time.erfa_time";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__n[] = "n";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__s[] = "s";
-static char __pyx_k__u[] = "u";
-static char __pyx_k__v[] = "v";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__d1[] = "d1";
-static char __pyx_k__d2[] = "d2";
-static char __pyx_k__dt[] = "dt";
-static char __pyx_k__fd[] = "fd";
-static char __pyx_k__id[] = "id";
-static char __pyx_k__im[] = "im";
-static char __pyx_k__iy[] = "iy";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__ut[] = "ut";
-static char __pyx_k__djm[] = "djm";
-static char __pyx_k__epd[] = "epd";
-static char __pyx_k__gst[] = "gst";
-static char __pyx_k__ihr[] = "ihr";
-static char __pyx_k__imn[] = "imn";
-static char __pyx_k__in1[] = "in1";
-static char __pyx_k__in2[] = "in2";
-static char __pyx_k__jd1[] = "jd1";
-static char __pyx_k__jd2[] = "jd2";
-static char __pyx_k__ndp[] = "ndp";
-static char __pyx_k__ord[] = "ord";
-static char __pyx_k__out[] = "out";
-static char __pyx_k__phi[] = "phi";
-static char __pyx_k__rad[] = "rad";
-static char __pyx_k__ret[] = "ret";
-static char __pyx_k__sec[] = "sec";
-static char __pyx_k__tt1[] = "tt1";
-static char __pyx_k__tt2[] = "tt2";
-static char __pyx_k__xyz[] = "xyz";
-static char __pyx_k__asec[] = "asec";
-static char __pyx_k__djm0[] = "djm0";
-static char __pyx_k__errs[] = "errs";
-static char __pyx_k__gmst[] = "gmst";
-static char __pyx_k__ideg[] = "ideg";
-static char __pyx_k__intc[] = "intc";
-static char __pyx_k__out1[] = "out1";
-static char __pyx_k__out2[] = "out2";
-static char __pyx_k__sign[] = "sign";
-static char __pyx_k__ut11[] = "ut11";
-static char __pyx_k__ut12[] = "ut12";
-static char __pyx_k__warn[] = "warn";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__elong[] = "elong";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__gst94[] = "gst94";
-static char __pyx_k__iamin[] = "iamin";
-static char __pyx_k__ihmsf[] = "ihmsf";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__scale[] = "scale";
-static char __pyx_k__shape[] = "shape";
-static char __pyx_k__warns[] = "warns";
-static char __pyx_k__cal2jd[] = "cal2jd";
-static char __pyx_k__double[] = "double";
-static char __pyx_k__dtf_jd[] = "dtf_jd";
-static char __pyx_k__eraDat[] = "eraDat";
-static char __pyx_k__errors[] = "errors";
-static char __pyx_k__format[] = "format";
-static char __pyx_k__gmst00[] = "gmst00";
-static char __pyx_k__gmst06[] = "gmst06";
-static char __pyx_k__gmst82[] = "gmst82";
-static char __pyx_k__gst00a[] = "gst00a";
-static char __pyx_k__gst00b[] = "gst00b";
-static char __pyx_k__gst06a[] = "gst06a";
-static char __pyx_k__height[] = "height";
-static char __pyx_k__jd_dtf[] = "jd_dtf";
-static char __pyx_k__nitems[] = "nitems";
-static char __pyx_k__tai_tt[] = "tai_tt";
-static char __pyx_k__tcg_tt[] = "tcg_tt";
-static char __pyx_k__tdb_tt[] = "tdb_tt";
-static char __pyx_k__tt_tai[] = "tt_tai";
-static char __pyx_k__tt_tcg[] = "tt_tcg";
-static char __pyx_k__tt_tdb[] = "tt_tdb";
-static char __pyx_k__tt_ut1[] = "tt_ut1";
-static char __pyx_k__ut1_tt[] = "ut1_tt";
-static char __pyx_k__DUBIOUS[] = "DUBIOUS";
-static char __pyx_k__eraAf2a[] = "eraAf2a";
-static char __pyx_k__tai_ut1[] = "tai_ut1";
-static char __pyx_k__tai_utc[] = "tai_utc";
-static char __pyx_k__tcb_tdb[] = "tcb_tdb";
-static char __pyx_k__tdb_tcb[] = "tdb_tcb";
-static char __pyx_k__ut1_tai[] = "ut1_tai";
-static char __pyx_k__ut1_utc[] = "ut1_utc";
-static char __pyx_k__utc_tai[] = "utc_tai";
-static char __pyx_k__utc_ut1[] = "utc_ut1";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__d_tdb_tt[] = "d_tdb_tt";
-static char __pyx_k__eraD2dtf[] = "eraD2dtf";
-static char __pyx_k__eraDtf2d[] = "eraDtf2d";
-static char __pyx_k__eraGd2gc[] = "eraGd2gc";
-static char __pyx_k__eraTaitt[] = "eraTaitt";
-static char __pyx_k__eraTcgtt[] = "eraTcgtt";
-static char __pyx_k__eraTdbtt[] = "eraTdbtt";
-static char __pyx_k__eraTttai[] = "eraTttai";
-static char __pyx_k__eraTttcg[] = "eraTttcg";
-static char __pyx_k__eraTttdb[] = "eraTttdb";
-static char __pyx_k__eraTtut1[] = "eraTtut1";
-static char __pyx_k__eraUt1tt[] = "eraUt1tt";
-static char __pyx_k__era_af2a[] = "era_af2a";
-static char __pyx_k__warnings[] = "warnings";
-static char __pyx_k__xyz_item[] = "xyz_item";
-static char __pyx_k__d_tai_utc[] = "d_tai_utc";
-static char __pyx_k__eraCal2jd[] = "eraCal2jd";
-static char __pyx_k__eraTaiut1[] = "eraTaiut1";
-static char __pyx_k__eraTaiutc[] = "eraTaiutc";
-static char __pyx_k__eraTcbtdb[] = "eraTcbtdb";
-static char __pyx_k__eraTdbtcb[] = "eraTdbtcb";
-static char __pyx_k__eraUt1tai[] = "eraUt1tai";
-static char __pyx_k__eraUt1utc[] = "eraUt1utc";
-static char __pyx_k__eraUtctai[] = "eraUtctai";
-static char __pyx_k__eraUtcut1[] = "eraUtcut1";
-static char __pyx_k__era_gc2gd[] = "era_gc2gd";
-static char __pyx_k__era_gd2gc[] = "era_gd2gc";
-static char __pyx_k__func_name[] = "func_name";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k__check_return[] = "check_return";
-static char __pyx_k__jd_julian_epoch[] = "jd_julian_epoch";
-static char __pyx_k__julian_epoch_jd[] = "julian_epoch_jd";
-static char __pyx_k__AstropyUserWarning[] = "AstropyUserWarning";
-static char __pyx_k__besselian_epoch_jd[] = "besselian_epoch_jd";
-static char __pyx_k__jd_besselian_epoch[] = "jd_besselian_epoch";
-static PyObject *__pyx_kp_s_10;
-static PyObject *__pyx_kp_s_11;
-static PyObject *__pyx_kp_s_12;
-static PyObject *__pyx_kp_s_13;
-static PyObject *__pyx_kp_s_14;
-static PyObject *__pyx_kp_s_15;
-static PyObject *__pyx_kp_s_16;
-static PyObject *__pyx_kp_s_17;
-static PyObject *__pyx_kp_s_18;
-static PyObject *__pyx_kp_s_19;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_kp_s_21;
-static PyObject *__pyx_kp_s_22;
-static PyObject *__pyx_kp_s_24;
-static PyObject *__pyx_kp_s_25;
-static PyObject *__pyx_kp_u_26;
-static PyObject *__pyx_kp_u_28;
-static PyObject *__pyx_kp_s_3;
-static PyObject *__pyx_kp_u_30;
-static PyObject *__pyx_kp_u_32;
-static PyObject *__pyx_kp_u_33;
-static PyObject *__pyx_kp_u_36;
-static PyObject *__pyx_n_s_38;
-static PyObject *__pyx_kp_s_39;
-static PyObject *__pyx_kp_s_4;
-static PyObject *__pyx_kp_s_42;
-static PyObject *__pyx_n_s_43;
-static PyObject *__pyx_kp_s_5;
-static PyObject *__pyx_kp_s_6;
-static PyObject *__pyx_kp_s_7;
-static PyObject *__pyx_kp_s_8;
-static PyObject *__pyx_kp_s_9;
-static PyObject *__pyx_n_s__AstropyUserWarning;
-static PyObject *__pyx_n_s__DUBIOUS;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__asec;
-static PyObject *__pyx_n_s__besselian_epoch_jd;
-static PyObject *__pyx_n_s__cal2jd;
-static PyObject *__pyx_n_s__check_return;
-static PyObject *__pyx_n_s__d1;
-static PyObject *__pyx_n_s__d2;
-static PyObject *__pyx_n_s__d_tai_utc;
-static PyObject *__pyx_n_s__d_tdb_tt;
-static PyObject *__pyx_n_s__djm;
-static PyObject *__pyx_n_s__djm0;
-static PyObject *__pyx_n_s__double;
-static PyObject *__pyx_n_s__dt;
-static PyObject *__pyx_n_s__dtf_jd;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__elong;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__epd;
-static PyObject *__pyx_n_s__eraAf2a;
-static PyObject *__pyx_n_s__eraCal2jd;
-static PyObject *__pyx_n_s__eraD2dtf;
-static PyObject *__pyx_n_s__eraDat;
-static PyObject *__pyx_n_s__eraDtf2d;
-static PyObject *__pyx_n_s__eraGd2gc;
-static PyObject *__pyx_n_s__eraTaitt;
-static PyObject *__pyx_n_s__eraTaiut1;
-static PyObject *__pyx_n_s__eraTaiutc;
-static PyObject *__pyx_n_s__eraTcbtdb;
-static PyObject *__pyx_n_s__eraTcgtt;
-static PyObject *__pyx_n_s__eraTdbtcb;
-static PyObject *__pyx_n_s__eraTdbtt;
-static PyObject *__pyx_n_s__eraTttai;
-static PyObject *__pyx_n_s__eraTttcg;
-static PyObject *__pyx_n_s__eraTttdb;
-static PyObject *__pyx_n_s__eraTtut1;
-static PyObject *__pyx_n_s__eraUt1tai;
-static PyObject *__pyx_n_s__eraUt1tt;
-static PyObject *__pyx_n_s__eraUt1utc;
-static PyObject *__pyx_n_s__eraUtctai;
-static PyObject *__pyx_n_s__eraUtcut1;
-static PyObject *__pyx_n_s__era_af2a;
-static PyObject *__pyx_n_s__era_gc2gd;
-static PyObject *__pyx_n_s__era_gd2gc;
-static PyObject *__pyx_n_s__errors;
-static PyObject *__pyx_n_s__errs;
-static PyObject *__pyx_n_s__fd;
-static PyObject *__pyx_n_s__format;
-static PyObject *__pyx_n_s__func_name;
-static PyObject *__pyx_n_s__gmst;
-static PyObject *__pyx_n_s__gmst00;
-static PyObject *__pyx_n_s__gmst06;
-static PyObject *__pyx_n_s__gmst82;
-static PyObject *__pyx_n_s__gst;
-static PyObject *__pyx_n_s__gst00a;
-static PyObject *__pyx_n_s__gst00b;
-static PyObject *__pyx_n_s__gst06a;
-static PyObject *__pyx_n_s__gst94;
-static PyObject *__pyx_n_s__height;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__iamin;
-static PyObject *__pyx_n_s__id;
-static PyObject *__pyx_n_s__ideg;
-static PyObject *__pyx_n_s__ihmsf;
-static PyObject *__pyx_n_s__ihr;
-static PyObject *__pyx_n_s__im;
-static PyObject *__pyx_n_s__imn;
-static PyObject *__pyx_n_s__in1;
-static PyObject *__pyx_n_s__in2;
-static PyObject *__pyx_n_s__intc;
-static PyObject *__pyx_n_s__iy;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__jd1;
-static PyObject *__pyx_n_s__jd2;
-static PyObject *__pyx_n_s__jd_besselian_epoch;
-static PyObject *__pyx_n_s__jd_dtf;
-static PyObject *__pyx_n_s__jd_julian_epoch;
-static PyObject *__pyx_n_s__julian_epoch_jd;
-static PyObject *__pyx_n_s__n;
-static PyObject *__pyx_n_s__ndp;
-static PyObject *__pyx_n_s__nitems;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__ord;
-static PyObject *__pyx_n_s__out;
-static PyObject *__pyx_n_s__out1;
-static PyObject *__pyx_n_s__out2;
-static PyObject *__pyx_n_s__phi;
-static PyObject *__pyx_n_s__rad;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__ret;
-static PyObject *__pyx_n_s__s;
-static PyObject *__pyx_n_s__scale;
-static PyObject *__pyx_n_s__sec;
-static PyObject *__pyx_n_s__shape;
-static PyObject *__pyx_n_s__sign;
-static PyObject *__pyx_n_s__tai_tt;
-static PyObject *__pyx_n_s__tai_ut1;
-static PyObject *__pyx_n_s__tai_utc;
-static PyObject *__pyx_n_s__tcb_tdb;
-static PyObject *__pyx_n_s__tcg_tt;
-static PyObject *__pyx_n_s__tdb_tcb;
-static PyObject *__pyx_n_s__tdb_tt;
-static PyObject *__pyx_n_s__tt1;
-static PyObject *__pyx_n_s__tt2;
-static PyObject *__pyx_n_s__tt_tai;
-static PyObject *__pyx_n_s__tt_tcg;
-static PyObject *__pyx_n_s__tt_tdb;
-static PyObject *__pyx_n_s__tt_ut1;
-static PyObject *__pyx_n_s__u;
-static PyObject *__pyx_n_s__ut;
-static PyObject *__pyx_n_s__ut11;
-static PyObject *__pyx_n_s__ut12;
-static PyObject *__pyx_n_s__ut1_tai;
-static PyObject *__pyx_n_s__ut1_tt;
-static PyObject *__pyx_n_s__ut1_utc;
-static PyObject *__pyx_n_s__utc_tai;
-static PyObject *__pyx_n_s__utc_ut1;
-static PyObject *__pyx_n_s__v;
-static PyObject *__pyx_n_s__warn;
-static PyObject *__pyx_n_s__warnings;
-static PyObject *__pyx_n_s__warns;
-static PyObject *__pyx_n_s__xyz;
-static PyObject *__pyx_n_s__xyz_item;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_n[] = "n";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_s[] = "s";
+static char __pyx_k_u[] = "u";
+static char __pyx_k_v[] = "v";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_d1[] = "d1";
+static char __pyx_k_d2[] = "d2";
+static char __pyx_k_dt[] = "dt";
+static char __pyx_k_fd[] = "fd";
+static char __pyx_k_id[] = "id";
+static char __pyx_k_im[] = "im";
+static char __pyx_k_iy[] = "iy";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_ut[] = "ut";
+static char __pyx_k_0_1[] = "{0}: {1}";
+static char __pyx_k_djm[] = "djm";
+static char __pyx_k_epd[] = "epd";
+static char __pyx_k_gst[] = "gst";
+static char __pyx_k_ihr[] = "ihr";
+static char __pyx_k_imn[] = "imn";
+static char __pyx_k_in1[] = "in1";
+static char __pyx_k_in2[] = "in2";
+static char __pyx_k_jd1[] = "jd1";
+static char __pyx_k_jd2[] = "jd2";
+static char __pyx_k_ndp[] = "ndp";
+static char __pyx_k_ord[] = "ord";
+static char __pyx_k_out[] = "out";
+static char __pyx_k_phi[] = "phi";
+static char __pyx_k_rad[] = "rad";
+static char __pyx_k_ret[] = "ret";
+static char __pyx_k_sec[] = "sec";
+static char __pyx_k_tt1[] = "tt1";
+static char __pyx_k_tt2[] = "tt2";
+static char __pyx_k_xyz[] = "xyz";
+static char __pyx_k_asec[] = "asec";
+static char __pyx_k_djm0[] = "djm0";
+static char __pyx_k_errs[] = "errs";
+static char __pyx_k_gmst[] = "gmst";
+static char __pyx_k_ideg[] = "ideg";
+static char __pyx_k_intc[] = "intc";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_out1[] = "out1";
+static char __pyx_k_out2[] = "out2";
+static char __pyx_k_sign[] = "sign";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_ut11[] = "ut11";
+static char __pyx_k_ut12[] = "ut12";
+static char __pyx_k_warn[] = "warn";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_elong[] = "elong";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_gst94[] = "gst94";
+static char __pyx_k_iamin[] = "iamin";
+static char __pyx_k_ihmsf[] = "ihmsf";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_scale[] = "scale";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_warns[] = "warns";
+static char __pyx_k_cal2jd[] = "cal2jd";
+static char __pyx_k_double[] = "double";
+static char __pyx_k_dtf_jd[] = "dtf_jd";
+static char __pyx_k_eraDat[] = "eraDat";
+static char __pyx_k_errors[] = "errors";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_gmst00[] = "gmst00";
+static char __pyx_k_gmst06[] = "gmst06";
+static char __pyx_k_gmst82[] = "gmst82";
+static char __pyx_k_gst00a[] = "gst00a";
+static char __pyx_k_gst00b[] = "gst00b";
+static char __pyx_k_gst06a[] = "gst06a";
+static char __pyx_k_height[] = "height";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_jd_dtf[] = "jd_dtf";
+static char __pyx_k_nitems[] = "nitems";
+static char __pyx_k_tai_tt[] = "tai_tt";
+static char __pyx_k_tcg_tt[] = "tcg_tt";
+static char __pyx_k_tdb_tt[] = "tdb_tt";
+static char __pyx_k_tt_tai[] = "tt_tai";
+static char __pyx_k_tt_tcg[] = "tt_tcg";
+static char __pyx_k_tt_tdb[] = "tt_tdb";
+static char __pyx_k_tt_ut1[] = "tt_ut1";
+static char __pyx_k_ut1_tt[] = "ut1_tt";
+static char __pyx_k_DUBIOUS[] = "DUBIOUS";
+static char __pyx_k_bad_day[] = "bad day";
+static char __pyx_k_eraAf2a[] = "eraAf2a";
+static char __pyx_k_tai_ut1[] = "tai_ut1";
+static char __pyx_k_tai_utc[] = "tai_utc";
+static char __pyx_k_tcb_tdb[] = "tcb_tdb";
+static char __pyx_k_tdb_tcb[] = "tdb_tcb";
+static char __pyx_k_ut1_tai[] = "ut1_tai";
+static char __pyx_k_ut1_utc[] = "ut1_utc";
+static char __pyx_k_utc_tai[] = "utc_tai";
+static char __pyx_k_utc_ut1[] = "utc_ut1";
+static char __pyx_k_bad_hour[] = "bad hour";
+static char __pyx_k_bad_year[] = "bad year";
+static char __pyx_k_d_tdb_tt[] = "d_tdb_tt";
+static char __pyx_k_eraD2dtf[] = "eraD2dtf";
+static char __pyx_k_eraDtf2d[] = "eraDtf2d";
+static char __pyx_k_eraGd2gc[] = "eraGd2gc";
+static char __pyx_k_eraTaitt[] = "eraTaitt";
+static char __pyx_k_eraTcgtt[] = "eraTcgtt";
+static char __pyx_k_eraTdbtt[] = "eraTdbtt";
+static char __pyx_k_eraTttai[] = "eraTttai";
+static char __pyx_k_eraTttcg[] = "eraTttcg";
+static char __pyx_k_eraTttdb[] = "eraTttdb";
+static char __pyx_k_eraTtut1[] = "eraTtut1";
+static char __pyx_k_eraUt1tt[] = "eraUt1tt";
+static char __pyx_k_era_af2a[] = "era_af2a";
+static char __pyx_k_warnings[] = "warnings";
+static char __pyx_k_xyz_item[] = "xyz_item";
+static char __pyx_k_bad_month[] = "bad month";
+static char __pyx_k_d_tai_utc[] = "d_tai_utc";
+static char __pyx_k_eraCal2jd[] = "eraCal2jd";
+static char __pyx_k_eraTaiut1[] = "eraTaiut1";
+static char __pyx_k_eraTaiutc[] = "eraTaiutc";
+static char __pyx_k_eraTcbtdb[] = "eraTcbtdb";
+static char __pyx_k_eraTdbtcb[] = "eraTdbtcb";
+static char __pyx_k_eraUt1tai[] = "eraUt1tai";
+static char __pyx_k_eraUt1utc[] = "eraUt1utc";
+static char __pyx_k_eraUtctai[] = "eraUtctai";
+static char __pyx_k_eraUtcut1[] = "eraUtcut1";
+static char __pyx_k_era_gc2gd[] = "era_gc2gd";
+static char __pyx_k_era_gd2gc[] = "era_gd2gc";
+static char __pyx_k_func_name[] = "func_name";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_bad_minute[] = "bad minute";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_bad_second_0[] = "bad second (< 0)";
+static char __pyx_k_check_return[] = "check_return";
+static char __pyx_k_illegal_case[] = "illegal case";
+static char __pyx_k_Bad_input_year[] = "Bad input year";
+static char __pyx_k_Bad_input_month[] = "Bad input month";
+static char __pyx_k_jd_julian_epoch[] = "jd_julian_epoch";
+static char __pyx_k_julian_epoch_jd[] = "julian_epoch_jd";
+static char __pyx_k_utils_exceptions[] = "utils.exceptions";
+static char __pyx_k_unacceptable_date[] = "unacceptable date";
+static char __pyx_k_AstropyUserWarning[] = "AstropyUserWarning";
+static char __pyx_k_besselian_epoch_jd[] = "besselian_epoch_jd";
+static char __pyx_k_illegal_identifier[] = "illegal identifier";
+static char __pyx_k_jd_besselian_epoch[] = "jd_besselian_epoch";
+static char __pyx_k_bad_fraction_of_day[] = "bad fraction of day";
+static char __pyx_k_astropy_time_erfa_time[] = "astropy.time.erfa_time";
+static char __pyx_k_iamin_outside_range_0_59[] = "iamin outside range 0-59";
+static char __pyx_k_ideg_outside_range_0_359[] = "ideg outside range 0-359";
+static char __pyx_k_time_is_after_end_of_day[] = "time is after end of day";
+static char __pyx_k_bad_month_must_be_1_to_12[] = "bad month (must be 1 to 12)";
+static char __pyx_k_asec_outside_range_0_59_999[] = "asec outside range 0-59.999...";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_time_is_after_end_of_day_and[] = "time is after end of day and ";
+static char __pyx_k_Bad_input_day_JD_still_computed[] = "Bad input day (JD still computed)";
+static char __pyx_k_Unexpected_return_code_0_from_1[] = "Unexpected return code {0} from {1}";
+static char __pyx_k_internal_1_root_src_astropy_ast[] = "/internal/1/root/src/astropy/astropy/astropy/time/erfa_time.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_bad_day_must_be_within_normal_ca[] = "bad day (must be within normal calendar date for a month)";
+static char __pyx_k_dubious_year_for_UTC_before_1960[] = "dubious year for UTC (before 1960.0 or 5 years beyond last known leap second)";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_0_1;
+static PyObject *__pyx_n_s_AstropyUserWarning;
+static PyObject *__pyx_kp_s_Bad_input_day_JD_still_computed;
+static PyObject *__pyx_kp_s_Bad_input_month;
+static PyObject *__pyx_kp_s_Bad_input_year;
+static PyObject *__pyx_n_s_DUBIOUS;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_kp_s_Unexpected_return_code_0_from_1;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_asec;
+static PyObject *__pyx_kp_s_asec_outside_range_0_59_999;
+static PyObject *__pyx_n_s_astropy_time_erfa_time;
+static PyObject *__pyx_kp_s_bad_day;
+static PyObject *__pyx_kp_s_bad_day_must_be_within_normal_ca;
+static PyObject *__pyx_kp_s_bad_fraction_of_day;
+static PyObject *__pyx_kp_s_bad_hour;
+static PyObject *__pyx_kp_s_bad_minute;
+static PyObject *__pyx_kp_s_bad_month;
+static PyObject *__pyx_kp_s_bad_month_must_be_1_to_12;
+static PyObject *__pyx_kp_s_bad_second_0;
+static PyObject *__pyx_kp_s_bad_year;
+static PyObject *__pyx_n_s_besselian_epoch_jd;
+static PyObject *__pyx_n_s_cal2jd;
+static PyObject *__pyx_n_s_check_return;
+static PyObject *__pyx_n_s_d1;
+static PyObject *__pyx_n_s_d2;
+static PyObject *__pyx_n_s_d_tai_utc;
+static PyObject *__pyx_n_s_d_tdb_tt;
+static PyObject *__pyx_n_s_djm;
+static PyObject *__pyx_n_s_djm0;
+static PyObject *__pyx_n_s_double;
+static PyObject *__pyx_n_s_dt;
+static PyObject *__pyx_n_s_dtf_jd;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_kp_s_dubious_year_for_UTC_before_1960;
+static PyObject *__pyx_n_s_elong;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_epd;
+static PyObject *__pyx_n_s_eraAf2a;
+static PyObject *__pyx_n_s_eraCal2jd;
+static PyObject *__pyx_n_s_eraD2dtf;
+static PyObject *__pyx_n_s_eraDat;
+static PyObject *__pyx_n_s_eraDtf2d;
+static PyObject *__pyx_n_s_eraGd2gc;
+static PyObject *__pyx_n_s_eraTaitt;
+static PyObject *__pyx_n_s_eraTaiut1;
+static PyObject *__pyx_n_s_eraTaiutc;
+static PyObject *__pyx_n_s_eraTcbtdb;
+static PyObject *__pyx_n_s_eraTcgtt;
+static PyObject *__pyx_n_s_eraTdbtcb;
+static PyObject *__pyx_n_s_eraTdbtt;
+static PyObject *__pyx_n_s_eraTttai;
+static PyObject *__pyx_n_s_eraTttcg;
+static PyObject *__pyx_n_s_eraTttdb;
+static PyObject *__pyx_n_s_eraTtut1;
+static PyObject *__pyx_n_s_eraUt1tai;
+static PyObject *__pyx_n_s_eraUt1tt;
+static PyObject *__pyx_n_s_eraUt1utc;
+static PyObject *__pyx_n_s_eraUtctai;
+static PyObject *__pyx_n_s_eraUtcut1;
+static PyObject *__pyx_n_s_era_af2a;
+static PyObject *__pyx_n_s_era_gc2gd;
+static PyObject *__pyx_n_s_era_gd2gc;
+static PyObject *__pyx_n_s_errors;
+static PyObject *__pyx_n_s_errs;
+static PyObject *__pyx_n_s_fd;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_func_name;
+static PyObject *__pyx_n_s_gmst;
+static PyObject *__pyx_n_s_gmst00;
+static PyObject *__pyx_n_s_gmst06;
+static PyObject *__pyx_n_s_gmst82;
+static PyObject *__pyx_n_s_gst;
+static PyObject *__pyx_n_s_gst00a;
+static PyObject *__pyx_n_s_gst00b;
+static PyObject *__pyx_n_s_gst06a;
+static PyObject *__pyx_n_s_gst94;
+static PyObject *__pyx_n_s_height;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_iamin;
+static PyObject *__pyx_kp_s_iamin_outside_range_0_59;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_ideg;
+static PyObject *__pyx_kp_s_ideg_outside_range_0_359;
+static PyObject *__pyx_n_s_ihmsf;
+static PyObject *__pyx_n_s_ihr;
+static PyObject *__pyx_kp_s_illegal_case;
+static PyObject *__pyx_kp_s_illegal_identifier;
+static PyObject *__pyx_n_s_im;
+static PyObject *__pyx_n_s_imn;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_in1;
+static PyObject *__pyx_n_s_in2;
+static PyObject *__pyx_n_s_intc;
+static PyObject *__pyx_kp_s_internal_1_root_src_astropy_ast;
+static PyObject *__pyx_n_s_iy;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_jd1;
+static PyObject *__pyx_n_s_jd2;
+static PyObject *__pyx_n_s_jd_besselian_epoch;
+static PyObject *__pyx_n_s_jd_dtf;
+static PyObject *__pyx_n_s_jd_julian_epoch;
+static PyObject *__pyx_n_s_julian_epoch_jd;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_n;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_ndp;
+static PyObject *__pyx_n_s_nitems;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_ord;
+static PyObject *__pyx_n_s_out;
+static PyObject *__pyx_n_s_out1;
+static PyObject *__pyx_n_s_out2;
+static PyObject *__pyx_n_s_phi;
+static PyObject *__pyx_n_s_rad;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_ret;
+static PyObject *__pyx_n_s_s;
+static PyObject *__pyx_n_s_scale;
+static PyObject *__pyx_n_s_sec;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_sign;
+static PyObject *__pyx_n_s_tai_tt;
+static PyObject *__pyx_n_s_tai_ut1;
+static PyObject *__pyx_n_s_tai_utc;
+static PyObject *__pyx_n_s_tcb_tdb;
+static PyObject *__pyx_n_s_tcg_tt;
+static PyObject *__pyx_n_s_tdb_tcb;
+static PyObject *__pyx_n_s_tdb_tt;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_s_time_is_after_end_of_day;
+static PyObject *__pyx_kp_s_time_is_after_end_of_day_and;
+static PyObject *__pyx_n_s_tt1;
+static PyObject *__pyx_n_s_tt2;
+static PyObject *__pyx_n_s_tt_tai;
+static PyObject *__pyx_n_s_tt_tcg;
+static PyObject *__pyx_n_s_tt_tdb;
+static PyObject *__pyx_n_s_tt_ut1;
+static PyObject *__pyx_n_s_u;
+static PyObject *__pyx_kp_s_unacceptable_date;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_ut;
+static PyObject *__pyx_n_s_ut11;
+static PyObject *__pyx_n_s_ut12;
+static PyObject *__pyx_n_s_ut1_tai;
+static PyObject *__pyx_n_s_ut1_tt;
+static PyObject *__pyx_n_s_ut1_utc;
+static PyObject *__pyx_n_s_utc_tai;
+static PyObject *__pyx_n_s_utc_ut1;
+static PyObject *__pyx_n_s_utils_exceptions;
+static PyObject *__pyx_n_s_v;
+static PyObject *__pyx_n_s_warn;
+static PyObject *__pyx_n_s_warnings;
+static PyObject *__pyx_n_s_warns;
+static PyObject *__pyx_n_s_xyz;
+static PyObject *__pyx_n_s_xyz_item;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_2;
@@ -1495,106 +1494,116 @@ static PyObject *__pyx_int_neg_3;
 static PyObject *__pyx_int_neg_4;
 static PyObject *__pyx_int_neg_5;
 static PyObject *__pyx_int_neg_6;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_1;
-static PyObject *__pyx_k_2;
-static PyObject *__pyx_k_tuple_23;
-static PyObject *__pyx_k_tuple_27;
-static PyObject *__pyx_k_tuple_29;
-static PyObject *__pyx_k_tuple_31;
-static PyObject *__pyx_k_tuple_34;
-static PyObject *__pyx_k_tuple_35;
-static PyObject *__pyx_k_tuple_37;
-static PyObject *__pyx_k_tuple_40;
-static PyObject *__pyx_k_tuple_44;
-static PyObject *__pyx_k_tuple_46;
-static PyObject *__pyx_k_tuple_48;
-static PyObject *__pyx_k_tuple_50;
-static PyObject *__pyx_k_tuple_52;
-static PyObject *__pyx_k_tuple_54;
-static PyObject *__pyx_k_tuple_56;
-static PyObject *__pyx_k_tuple_58;
-static PyObject *__pyx_k_tuple_60;
-static PyObject *__pyx_k_tuple_62;
-static PyObject *__pyx_k_tuple_64;
-static PyObject *__pyx_k_tuple_66;
-static PyObject *__pyx_k_tuple_68;
-static PyObject *__pyx_k_tuple_70;
-static PyObject *__pyx_k_tuple_72;
-static PyObject *__pyx_k_tuple_74;
-static PyObject *__pyx_k_tuple_76;
-static PyObject *__pyx_k_tuple_78;
-static PyObject *__pyx_k_tuple_80;
-static PyObject *__pyx_k_tuple_82;
-static PyObject *__pyx_k_tuple_84;
-static PyObject *__pyx_k_tuple_86;
-static PyObject *__pyx_k_tuple_88;
-static PyObject *__pyx_k_tuple_90;
-static PyObject *__pyx_k_tuple_92;
-static PyObject *__pyx_k_tuple_94;
-static PyObject *__pyx_k_tuple_96;
-static PyObject *__pyx_k_tuple_98;
-static PyObject *__pyx_k_tuple_100;
-static PyObject *__pyx_k_tuple_102;
-static PyObject *__pyx_k_tuple_104;
-static PyObject *__pyx_k_tuple_106;
-static PyObject *__pyx_k_tuple_108;
-static PyObject *__pyx_k_tuple_110;
-static PyObject *__pyx_k_tuple_112;
-static PyObject *__pyx_k_codeobj_41;
-static PyObject *__pyx_k_codeobj_45;
-static PyObject *__pyx_k_codeobj_47;
-static PyObject *__pyx_k_codeobj_49;
-static PyObject *__pyx_k_codeobj_51;
-static PyObject *__pyx_k_codeobj_53;
-static PyObject *__pyx_k_codeobj_55;
-static PyObject *__pyx_k_codeobj_57;
-static PyObject *__pyx_k_codeobj_59;
-static PyObject *__pyx_k_codeobj_61;
-static PyObject *__pyx_k_codeobj_63;
-static PyObject *__pyx_k_codeobj_65;
-static PyObject *__pyx_k_codeobj_67;
-static PyObject *__pyx_k_codeobj_69;
-static PyObject *__pyx_k_codeobj_71;
-static PyObject *__pyx_k_codeobj_73;
-static PyObject *__pyx_k_codeobj_75;
-static PyObject *__pyx_k_codeobj_77;
-static PyObject *__pyx_k_codeobj_79;
-static PyObject *__pyx_k_codeobj_81;
-static PyObject *__pyx_k_codeobj_83;
-static PyObject *__pyx_k_codeobj_85;
-static PyObject *__pyx_k_codeobj_87;
-static PyObject *__pyx_k_codeobj_89;
-static PyObject *__pyx_k_codeobj_91;
-static PyObject *__pyx_k_codeobj_93;
-static PyObject *__pyx_k_codeobj_95;
-static PyObject *__pyx_k_codeobj_97;
-static PyObject *__pyx_k_codeobj_99;
-static PyObject *__pyx_k_codeobj_101;
-static PyObject *__pyx_k_codeobj_103;
-static PyObject *__pyx_k_codeobj_105;
-static PyObject *__pyx_k_codeobj_107;
-static PyObject *__pyx_k_codeobj_109;
-static PyObject *__pyx_k_codeobj_111;
-static PyObject *__pyx_k_codeobj_113;
+static PyObject *__pyx_k_;
+static PyObject *__pyx_k__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_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__42;
+static PyObject *__pyx_tuple__44;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_tuple__64;
+static PyObject *__pyx_tuple__66;
+static PyObject *__pyx_tuple__68;
+static PyObject *__pyx_tuple__70;
+static PyObject *__pyx_tuple__72;
+static PyObject *__pyx_tuple__74;
+static PyObject *__pyx_tuple__76;
+static PyObject *__pyx_tuple__78;
+static PyObject *__pyx_tuple__80;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
+static PyObject *__pyx_codeobj__17;
+static PyObject *__pyx_codeobj__19;
+static PyObject *__pyx_codeobj__21;
+static PyObject *__pyx_codeobj__23;
+static PyObject *__pyx_codeobj__25;
+static PyObject *__pyx_codeobj__27;
+static PyObject *__pyx_codeobj__29;
+static PyObject *__pyx_codeobj__31;
+static PyObject *__pyx_codeobj__33;
+static PyObject *__pyx_codeobj__35;
+static PyObject *__pyx_codeobj__37;
+static PyObject *__pyx_codeobj__39;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__43;
+static PyObject *__pyx_codeobj__45;
+static PyObject *__pyx_codeobj__47;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+static PyObject *__pyx_codeobj__53;
+static PyObject *__pyx_codeobj__55;
+static PyObject *__pyx_codeobj__57;
+static PyObject *__pyx_codeobj__59;
+static PyObject *__pyx_codeobj__61;
+static PyObject *__pyx_codeobj__63;
+static PyObject *__pyx_codeobj__65;
+static PyObject *__pyx_codeobj__67;
+static PyObject *__pyx_codeobj__69;
+static PyObject *__pyx_codeobj__71;
+static PyObject *__pyx_codeobj__73;
+static PyObject *__pyx_codeobj__75;
+static PyObject *__pyx_codeobj__77;
+static PyObject *__pyx_codeobj__79;
+static PyObject *__pyx_codeobj__81;
+
+/* "astropy/time/erfa_time.pyx":64
+ *           'beyond last known leap second)'
+ * 
+ * def check_return(ret, func_name, warns={}, errors={}):             # <<<<<<<<<<<<<<
+ *     """Check the return value from an era routine"""
+ *     if ret in warns:
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_1check_return(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_check_return[] = "Check the return value from an era routine";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_1check_return = {__Pyx_NAMESTR("check_return"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_1check_return, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_check_return)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_1check_return = {"check_return", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_1check_return, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_check_return};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_1check_return(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_ret = 0;
   PyObject *__pyx_v_func_name = 0;
   PyObject *__pyx_v_warns = 0;
   PyObject *__pyx_v_errors = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("check_return (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ret,&__pyx_n_s__func_name,&__pyx_n_s__warns,&__pyx_n_s__errors,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ret,&__pyx_n_s_func_name,&__pyx_n_s_warns,&__pyx_n_s_errors,0};
     PyObject* values[4] = {0,0,0,0};
-    values[2] = __pyx_k_1;
-    values[3] = __pyx_k_2;
+    values[2] = __pyx_k_;
+    values[3] = __pyx_k__2;
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -1609,21 +1618,21 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_1check_return(PyObject *__py
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ret)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ret)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_name)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func_name)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("check_return", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__warns);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_warns);
           if (value) { values[2] = value; kw_args--; }
         }
         case  3:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errors);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errors);
           if (value) { values[3] = value; kw_args--; }
         }
       }
@@ -1654,26 +1663,25 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_1check_return(PyObject *__py
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_check_return(__pyx_self, __pyx_v_ret, __pyx_v_func_name, __pyx_v_warns, __pyx_v_errors);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":64
- *           'beyond last known leap second)'
- * 
- * def check_return(ret, func_name, warns={}, errors={}):             # <<<<<<<<<<<<<<
- *     """Check the return value from an era routine"""
- *     if ret in warns:
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ret, PyObject *__pyx_v_func_name, PyObject *__pyx_v_warns, PyObject *__pyx_v_errors) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  PyObject *__pyx_t_2 = 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;
+  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_8 = NULL;
+  Py_ssize_t __pyx_t_9;
+  PyObject *__pyx_t_10 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1687,7 +1695,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  *     elif ret in errors:
  */
   __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_ret, __pyx_v_warns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
     /* "astropy/time/erfa_time.pyx":67
  *     """Check the return value from an era routine"""
@@ -1696,42 +1705,72 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  *     elif ret in errors:
  *         raise ValueError('{0}: {1}'.format(func_name, errors[ret]))
  */
-    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_3), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_GetItem(__pyx_v_warns, __pyx_v_ret); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_warns, __pyx_v_ret); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_8 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
+    if (__pyx_t_8) {
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_func_name);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_func_name);
+    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_func_name);
     __Pyx_GIVEREF(__pyx_v_func_name);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__AstropyUserWarning); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AstropyUserWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_10 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_10)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_10);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_10) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_t_4);
     __Pyx_GIVEREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
     __pyx_t_4 = 0;
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_t_6 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L3;
   }
 
@@ -1742,7 +1781,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  *         raise ValueError('{0}: {1}'.format(func_name, errors[ret]))
  *     elif ret != 0:
  */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_ret, __pyx_v_errors, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_ret, __pyx_v_errors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
     /* "astropy/time/erfa_time.pyx":69
@@ -1752,34 +1792,48 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  *     elif ret != 0:
  *         raise ValueError('Unexpected return code {0} from {1}'
  */
-    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_3), __pyx_n_s__format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_errors, __pyx_v_ret); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_errors, __pyx_v_ret); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_6 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_6) {
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_func_name);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_func_name);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_func_name);
     __Pyx_GIVEREF(__pyx_v_func_name);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
 
   /* "astropy/time/erfa_time.pyx":70
@@ -1789,9 +1843,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  *         raise ValueError('Unexpected return code {0} from {1}'
  *                          .format(repr(ret), func_name))
  */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_ret, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = PyObject_RichCompare(__pyx_v_ret, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_1) {
 
     /* "astropy/time/erfa_time.pyx":72
@@ -1801,44 +1855,78 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
  * 
  * 
  */
-    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_4), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyObject_Repr(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unexpected_return_code_0_from_1, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_Repr(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = NULL;
+    __pyx_t_9 = 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_9 = 1;
+      }
+    }
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_7) {
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_func_name);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_func_name);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_func_name);
     __Pyx_GIVEREF(__pyx_v_func_name);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+    /* "astropy/time/erfa_time.pyx":71
+ *         raise ValueError('{0}: {1}'.format(func_name, errors[ret]))
+ *     elif ret != 0:
+ *         raise ValueError('Unexpected return code {0} from {1}'             # <<<<<<<<<<<<<<
+ *                          .format(repr(ret), func_name))
+ * 
+ */
     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
   __pyx_L3:;
 
+  /* "astropy/time/erfa_time.pyx":64
+ *           'beyond last known leap second)'
+ * 
+ * def check_return(ret, func_name, warns={}, errors={}):             # <<<<<<<<<<<<<<
+ *     """Check the return value from an era routine"""
+ *     if ret in warns:
+ */
+
+  /* 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_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_10);
   __Pyx_AddTraceback("astropy.time.erfa_time.check_return", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -1847,21 +1935,32 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_check_return(CYTHON_UNUSED P
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":77
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def cal2jd(             # <<<<<<<<<<<<<<
+ *     np.ndarray[int, ndim=1] iy,
+ *     np.ndarray[int, ndim=1] im,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_3cal2jd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_2cal2jd[] = "\n    int eraCal2jd(int iy, int im, int id, double *djm0, double *djm)\n    Calendar date to high-precision JD.\n\n    **  Given:\n    **     iy,im,id  int     year, month, day in Gregorian calendar (Note 1)\n    **\n    **  Returned:\n    **     djm0      double  MJD zero-point: always 2400000.5\n    **     djm       double  Modified Julian Date for 0 hrs\n    **\n    **  Returned (function value):\n    **               int    [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_3cal2jd = {__Pyx_NAMESTR("cal2jd"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_3cal2jd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_2cal2jd)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_3cal2jd = {"cal2jd", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_3cal2jd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_2cal2jd};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_3cal2jd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_iy = 0;
   PyArrayObject *__pyx_v_im = 0;
   PyArrayObject *__pyx_v_id = 0;
   PyArrayObject *__pyx_v_djm0 = 0;
   PyArrayObject *__pyx_v_djm = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("cal2jd (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iy,&__pyx_n_s__im,&__pyx_n_s__id,&__pyx_n_s__djm0,&__pyx_n_s__djm,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iy,&__pyx_n_s_im,&__pyx_n_s_id,&__pyx_n_s_djm0,&__pyx_n_s_djm,0};
     PyObject* values[5] = {0,0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1878,25 +1977,25 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_3cal2jd(PyObject *__pyx_self
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iy)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iy)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__im)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_im)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("cal2jd", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("cal2jd", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__djm0)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_djm0)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("cal2jd", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__djm)) != 0)) kw_args--;
+        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_djm)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("cal2jd", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1933,6 +2032,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_3cal2jd(PyObject *__pyx_self
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_djm0), __pyx_ptype_5numpy_ndarray, 1, "djm0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_djm), __pyx_ptype_5numpy_ndarray, 1, "djm", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_2cal2jd(__pyx_self, __pyx_v_iy, __pyx_v_im, __pyx_v_id, __pyx_v_djm0, __pyx_v_djm);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1941,14 +2042,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_3cal2jd(PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":77
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def cal2jd(             # <<<<<<<<<<<<<<
- *     np.ndarray[int, ndim=1] iy,
- *     np.ndarray[int, ndim=1] im,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_iy, PyArrayObject *__pyx_v_im, PyArrayObject *__pyx_v_id, PyArrayObject *__pyx_v_djm0, PyArrayObject *__pyx_v_djm) {
   unsigned int __pyx_v_i;
   unsigned int __pyx_v_n;
@@ -1977,6 +2070,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
   unsigned int __pyx_t_8;
   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 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2044,8 +2140,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
  *              -2: 'Bad input month'}
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_3, ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_3, __pyx_kp_s_Bad_input_day_JD_still_computed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_warns = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -2057,9 +2153,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
  *     for i in range(n):
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_2, ((PyObject *)__pyx_kp_s_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, __pyx_kp_s_Bad_input_year) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_2, __pyx_kp_s_Bad_input_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -2095,29 +2191,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
  *     return
  * 
  */
-    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraCal2jd));
-    PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_n_s__eraCal2jd));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraCal2jd));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_9 = 0;
-    __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+    __pyx_t_11 = NULL;
+    __pyx_t_12 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && 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);
+        __pyx_t_12 = 1;
+      }
+    }
+    __pyx_t_13 = PyTuple_New(4+__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    if (__pyx_t_11) {
+      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_10);
+    __Pyx_GIVEREF(__pyx_t_10);
+    __Pyx_INCREF(__pyx_n_s_eraCal2jd);
+    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_n_s_eraCal2jd);
+    __Pyx_GIVEREF(__pyx_n_s_eraCal2jd);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_10 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":124
@@ -2131,12 +2242,21 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":77
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def cal2jd(             # <<<<<<<<<<<<<<
+ *     np.ndarray[int, ndim=1] iy,
+ *     np.ndarray[int, ndim=1] im,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_13);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_djm.rcbuffer->pybuffer);
@@ -2162,20 +2282,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_2cal2jd(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":128
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def d_tai_utc(np.ndarray[int, ndim=1] iy,             # <<<<<<<<<<<<<<
+ *               np.ndarray[int, ndim=1] im,
+ *               np.ndarray[int, ndim=1] id,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_4d_tai_utc[] = "\n    int eraDat(int iy, int im, int id, double fd, double *deltat)\n    For a given UTC date, calculate delta(AT) = TAI-UTC.\n\n    **  Given:\n    **     iy     int      UTC:  year (Notes 1 and 2)\n    **     im     int            month (Note 2)\n    **     id     int            day (Notes 2 and 3)\n    **     fd     double         fraction of day (Note 4)\n    **\n    **  Returned:\n    **     deltat double   TAI minus UT [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_5d_tai_utc = {__Pyx_NAMESTR("d_tai_utc"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_4d_tai_utc)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_5d_tai_utc = {"d_tai_utc", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_4d_tai_utc};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_iy = 0;
   PyArrayObject *__pyx_v_im = 0;
   PyArrayObject *__pyx_v_id = 0;
   PyArrayObject *__pyx_v_fd = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("d_tai_utc (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iy,&__pyx_n_s__im,&__pyx_n_s__id,&__pyx_n_s__fd,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iy,&__pyx_n_s_im,&__pyx_n_s_id,&__pyx_n_s_fd,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2191,20 +2322,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc(PyObject *__pyx_s
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iy)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iy)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__im)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_im)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tai_utc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tai_utc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tai_utc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -2238,6 +2369,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc(PyObject *__pyx_s
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_id), __pyx_ptype_5numpy_ndarray, 1, "id", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fd), __pyx_ptype_5numpy_ndarray, 1, "fd", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(__pyx_self, __pyx_v_iy, __pyx_v_im, __pyx_v_id, __pyx_v_fd);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2246,14 +2379,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_5d_tai_utc(PyObject *__pyx_s
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":128
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def d_tai_utc(np.ndarray[int, ndim=1] iy,             # <<<<<<<<<<<<<<
- *               np.ndarray[int, ndim=1] im,
- *               np.ndarray[int, ndim=1] id,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_iy, PyArrayObject *__pyx_v_im, PyArrayObject *__pyx_v_id, PyArrayObject *__pyx_v_fd) {
   int __pyx_v_i;
   int __pyx_v_n;
@@ -2287,6 +2412,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
   int __pyx_t_12;
   int __pyx_t_13;
   int __pyx_t_14;
+  Py_ssize_t __pyx_t_15;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2349,16 +2475,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  *     cdef np.ndarray[double, ndim=1] out = np.empty(n, dtype=np.double)
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_iy->dimensions[0]) == (__pyx_v_im->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_im->dimensions[0]) == (__pyx_v_id->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_iy->dimensions[0]) == (__pyx_v_im->dimensions[0]));
     if (__pyx_t_1) {
-      __pyx_t_1 = ((__pyx_v_id->dimensions[0]) == (__pyx_v_fd->dimensions[0]));
+      __pyx_t_1 = ((__pyx_v_im->dimensions[0]) == (__pyx_v_id->dimensions[0]));
+      if (__pyx_t_1) {
+        __pyx_t_1 = ((__pyx_v_id->dimensions[0]) == (__pyx_v_fd->dimensions[0]));
+      }
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   #endif
 
@@ -2369,12 +2497,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -2382,19 +2510,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -2417,8 +2545,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  *              -2: 'bad month (must be 1 to 12)',
  */
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_6, __pyx_int_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -2433,11 +2561,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  *              -3: 'bad day (must be within normal calendar date for a month)',
  */
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_2, ((PyObject *)__pyx_kp_s_9)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_3, ((PyObject *)__pyx_kp_s_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_4, ((PyObject *)__pyx_kp_s_11)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_1, __pyx_kp_s_bad_year) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_2, __pyx_kp_s_bad_month_must_be_1_to_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_3, __pyx_kp_s_bad_day_must_be_within_normal_ca) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_int_neg_4, __pyx_kp_s_bad_fraction_of_day) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_6);
   __pyx_t_6 = 0;
 
@@ -2472,6 +2600,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  * 
  */
     __pyx_t_14 = __pyx_v_i;
+
+    /* "astropy/time/erfa_time.pyx":217
+ *              -4: 'bad fraction of day'}
+ *     for i in range(n):
+ *         ret = eraDat(iy[i], im[i], id[i], fd[i],             # <<<<<<<<<<<<<<
+ *                      &out[i])
+ *         check_return(ret, 'eraDat', warns, errs)
+ */
     __pyx_v_ret = eraDat((*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_iy.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_iy.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_im.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_im.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_id.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_id.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_fd.rcbuffer->pybuffer.buf, __ [...]
 
     /* "astropy/time/erfa_time.pyx":219
@@ -2481,29 +2617,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
  * 
  *     return out
  */
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraDat));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraDat));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraDat));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_3 = NULL;
+    __pyx_t_15 = 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_15 = 1;
+      }
+    }
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_15, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraDat);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_15, __pyx_n_s_eraDat);
+    __Pyx_GIVEREF(__pyx_n_s_eraDat);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_15, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_15, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_4 = 0;
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":221
@@ -2518,8 +2669,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
   __pyx_r = ((PyObject *)__pyx_v_out);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":128
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def d_tai_utc(np.ndarray[int, ndim=1] iy,             # <<<<<<<<<<<<<<
+ *               np.ndarray[int, ndim=1] im,
+ *               np.ndarray[int, ndim=1] id,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -2552,20 +2710,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_4d_tai_utc(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":226
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_dtf(scale, ndp,             # <<<<<<<<<<<<<<
+ *               np.ndarray[double, ndim=1] d1,
+ *               np.ndarray[double, ndim=1] d2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_6jd_dtf[] = "\n    int eraD2dtf(const char *scale, int ndp, double d1, double d2,\n             int *iy, int *im, int *id, int ihmsf[4])\n\n    **  Given:\n    **     scale     char[]  time scale ID (Note 1)\n    **     ndp       int     resolution (Note 2)\n    **     d1,d2     double  time as a 2-part Julian Date (Notes 3,4)\n    **\n    **  Returned:\n    **     iy,im,id  int     year, month, day in Gregorian calendar (Note 5)\n    **    [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_7jd_dtf = {__Pyx_NAMESTR("jd_dtf"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_6jd_dtf)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_7jd_dtf = {"jd_dtf", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_6jd_dtf};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_scale = 0;
   PyObject *__pyx_v_ndp = 0;
   PyArrayObject *__pyx_v_d1 = 0;
   PyArrayObject *__pyx_v_d2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("jd_dtf (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__ndp,&__pyx_n_s__d1,&__pyx_n_s__d2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scale,&__pyx_n_s_ndp,&__pyx_n_s_d1,&__pyx_n_s_d2,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2581,20 +2750,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf(PyObject *__pyx_self
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndp)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndp)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("jd_dtf", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__d1)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d1)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("jd_dtf", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__d2)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("jd_dtf", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -2626,6 +2795,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf(PyObject *__pyx_self
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_d1), __pyx_ptype_5numpy_ndarray, 1, "d1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_d2), __pyx_ptype_5numpy_ndarray, 1, "d2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(__pyx_self, __pyx_v_scale, __pyx_v_ndp, __pyx_v_d1, __pyx_v_d2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -2634,14 +2805,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_7jd_dtf(PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":226
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def jd_dtf(scale, ndp,             # <<<<<<<<<<<<<<
- *               np.ndarray[double, ndim=1] d1,
- *               np.ndarray[double, ndim=1] d2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_scale, PyObject *__pyx_v_ndp, PyArrayObject *__pyx_v_d1, PyArrayObject *__pyx_v_d2) {
   int __pyx_v_i;
   int __pyx_v_n;
@@ -2686,6 +2849,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   int __pyx_t_18;
   int __pyx_t_19;
   long __pyx_t_20;
+  Py_ssize_t __pyx_t_21;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2741,12 +2905,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  *     cdef np.ndarray[int, ndim=1] im = np.empty(n, dtype=np.intc)
  *     cdef np.ndarray[int, ndim=1] id = np.empty(n, dtype=np.intc)
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -2754,19 +2918,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -2788,12 +2952,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  *     cdef np.ndarray[int, ndim=1] id = np.empty(n, dtype=np.intc)
  *     cdef np.ndarray[int, ndim=2] ihmsf = np.empty((n, 4), dtype=np.intc)
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -2801,19 +2965,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__intc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -2835,12 +2999,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  *     cdef np.ndarray[int, ndim=2] ihmsf = np.empty((n, 4), dtype=np.intc)
  * 
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -2848,19 +3012,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
   {
@@ -2882,12 +3046,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -2899,23 +3063,23 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   __pyx_t_2 = 0;
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
   __pyx_t_3 = 0;
   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__intc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_intc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
   {
@@ -2938,8 +3102,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  * 
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -2954,8 +3118,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  *     for i in range(n):
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, __pyx_kp_s_unacceptable_date) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -2977,8 +3141,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  *                      &iy[i], &im[i], &id[i], &ihmsf[i, 0])
  *         check_return(ret, 'eraD2dtf', warns, errs)
  */
-    __pyx_t_12 = PyBytes_AsString(__pyx_v_scale); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_ndp); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_scale); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ndp); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_14 = __pyx_v_i;
     __pyx_t_15 = __pyx_v_i;
 
@@ -2994,6 +3158,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
     __pyx_t_18 = __pyx_v_i;
     __pyx_t_19 = __pyx_v_i;
     __pyx_t_20 = 0;
+
+    /* "astropy/time/erfa_time.pyx":297
+ * 
+ *     for i in range(n):
+ *         ret = eraD2dtf(scale, ndp, d1[i], d2[i],             # <<<<<<<<<<<<<<
+ *                      &iy[i], &im[i], &id[i], &ihmsf[i, 0])
+ *         check_return(ret, 'eraD2dtf', warns, errs)
+ */
     __pyx_v_ret = eraD2dtf(__pyx_t_12, __pyx_t_13, (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_d1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_d1.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_d2.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_d2.diminfo[0].strides)), (&(*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_iy.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_iy.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(int *, __pyx_pybuff [...]
 
     /* "astropy/time/erfa_time.pyx":299
@@ -3003,29 +3175,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  * 
  *     return iy, im, id, ihmsf
  */
-    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraD2dtf));
-    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__eraD2dtf));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraD2dtf));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_t_4 = NULL;
+    __pyx_t_21 = 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_21 = 1;
+      }
+    }
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_21); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_4) {
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_21, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_n_s_eraD2dtf);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_21, __pyx_n_s_eraD2dtf);
+    __Pyx_GIVEREF(__pyx_n_s_eraD2dtf);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_21, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_21, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":301
@@ -3036,26 +3223,33 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
  * @cython.wraparound(False)
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_iy));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_iy));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_iy));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_iy));
   __Pyx_INCREF(((PyObject *)__pyx_v_im));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_im));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_im));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_im));
   __Pyx_INCREF(((PyObject *)__pyx_v_id));
-  PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_id));
+  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_id));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_id));
   __Pyx_INCREF(((PyObject *)__pyx_v_ihmsf));
-  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_ihmsf));
+  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_ihmsf));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_ihmsf));
-  __pyx_r = ((PyObject *)__pyx_t_3);
-  __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":226
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_dtf(scale, ndp,             # <<<<<<<<<<<<<<
+ *               np.ndarray[double, ndim=1] d1,
+ *               np.ndarray[double, ndim=1] d2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -3093,10 +3287,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_6jd_dtf(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":305
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def dtf_jd(scale,             # <<<<<<<<<<<<<<
+ *               np.ndarray[int, ndim=1] iy,
+ *               np.ndarray[int, ndim=1] im,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_8dtf_jd[] = "\n    int eraDtf2d(char *scale, int iy, int im, int id, int ihr, int imn, double sec, double *d1, double *d2)\n\n    **  Given:\n    **     scale     char[]  time scale ID (Note 1)\n    **     iy,im,id  int     year, month, day in Gregorian calendar (Note 2)\n    **     ihr,imn   int     hour, minute\n    **     sec       double  seconds\n    **\n    **  Returned:\n    **     d1,d2     double  2-part Julian Date (Notes 3,4)\n   [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_9dtf_jd = {__Pyx_NAMESTR("dtf_jd"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_8dtf_jd)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_9dtf_jd = {"dtf_jd", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_8dtf_jd};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_scale = 0;
   PyArrayObject *__pyx_v_iy = 0;
@@ -3105,11 +3307,14 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self
   PyArrayObject *__pyx_v_ihr = 0;
   PyArrayObject *__pyx_v_imn = 0;
   PyArrayObject *__pyx_v_sec = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("dtf_jd (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__iy,&__pyx_n_s__im,&__pyx_n_s__id,&__pyx_n_s__ihr,&__pyx_n_s__imn,&__pyx_n_s__sec,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scale,&__pyx_n_s_iy,&__pyx_n_s_im,&__pyx_n_s_id,&__pyx_n_s_ihr,&__pyx_n_s_imn,&__pyx_n_s_sec,0};
     PyObject* values[7] = {0,0,0,0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -3128,35 +3333,35 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iy)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iy)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__im)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_im)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ihr)) != 0)) kw_args--;
+        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ihr)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  5:
-        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__imn)) != 0)) kw_args--;
+        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imn)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  6:
-        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sec)) != 0)) kw_args--;
+        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("dtf_jd", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -3198,6 +3403,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_imn), __pyx_ptype_5numpy_ndarray, 1, "imn", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_5numpy_ndarray, 1, "sec", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(__pyx_self, __pyx_v_scale, __pyx_v_iy, __pyx_v_im, __pyx_v_id, __pyx_v_ihr, __pyx_v_imn, __pyx_v_sec);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -3206,14 +3413,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_9dtf_jd(PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":305
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def dtf_jd(scale,             # <<<<<<<<<<<<<<
- *               np.ndarray[int, ndim=1] iy,
- *               np.ndarray[int, ndim=1] im,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_scale, PyArrayObject *__pyx_v_iy, PyArrayObject *__pyx_v_im, PyArrayObject *__pyx_v_id, PyArrayObject *__pyx_v_ihr, PyArrayObject *__pyx_v_imn, PyArrayObject *__pyx_v_sec) {
   int __pyx_v_i;
   int __pyx_v_n;
@@ -3259,6 +3458,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
   int __pyx_t_17;
   int __pyx_t_18;
   int __pyx_t_19;
+  Py_ssize_t __pyx_t_20;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3343,30 +3543,40 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  * 
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_iy->dimensions[0]) == (__pyx_v_im->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_im->dimensions[0]) == (__pyx_v_id->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_iy->dimensions[0]) == (__pyx_v_im->dimensions[0]));
     if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_im->dimensions[0]) == (__pyx_v_id->dimensions[0]));
+      if (__pyx_t_1) {
 
-      /* "astropy/time/erfa_time.pyx":374
+        /* "astropy/time/erfa_time.pyx":374
  *     cdef int n = iy.shape[0]
  *     assert (iy.shape[0] == im.shape[0] == id.shape[0] ==
  *             ihr.shape[0] == imn.shape[0] == sec.shape[0])             # <<<<<<<<<<<<<<
  * 
  *     cdef np.ndarray[double, ndim=1] out1 = np.empty(n, dtype=np.double)
  */
-      __pyx_t_1 = ((__pyx_v_id->dimensions[0]) == (__pyx_v_ihr->dimensions[0]));
-      if (__pyx_t_1) {
-        __pyx_t_1 = ((__pyx_v_ihr->dimensions[0]) == (__pyx_v_imn->dimensions[0]));
+        __pyx_t_1 = ((__pyx_v_id->dimensions[0]) == (__pyx_v_ihr->dimensions[0]));
         if (__pyx_t_1) {
-          __pyx_t_1 = ((__pyx_v_imn->dimensions[0]) == (__pyx_v_sec->dimensions[0]));
+          __pyx_t_1 = ((__pyx_v_ihr->dimensions[0]) == (__pyx_v_imn->dimensions[0]));
+          if (__pyx_t_1) {
+            __pyx_t_1 = ((__pyx_v_imn->dimensions[0]) == (__pyx_v_sec->dimensions[0]));
+          }
         }
       }
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+    /* "astropy/time/erfa_time.pyx":373
+ *     cdef int i
+ *     cdef int n = iy.shape[0]
+ *     assert (iy.shape[0] == im.shape[0] == id.shape[0] ==             # <<<<<<<<<<<<<<
+ *             ihr.shape[0] == imn.shape[0] == sec.shape[0])
+ * 
+ */
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3377,12 +3587,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -3390,19 +3600,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -3424,12 +3634,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  * 
  *     warns = {3: 'time is after end of day and ' + DUBIOUS,
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -3437,19 +3647,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -3472,15 +3682,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  *              1: DUBIOUS}
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_13), __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyNumber_Add(__pyx_kp_s_time_is_after_end_of_day_and, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (PyDict_SetItem(__pyx_t_5, __pyx_int_3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_2, ((PyObject *)__pyx_kp_s_14)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_2, __pyx_kp_s_time_is_after_end_of_day) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":381
  *     warns = {3: 'time is after end of day and ' + DUBIOUS,
@@ -3489,7 +3699,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  *     errs = {-1: 'bad year',
  *             -2: 'bad month',
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_5, __pyx_int_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -3504,13 +3714,13 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  *             -3: 'bad day',
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_2, ((PyObject *)__pyx_kp_s_15)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_3, ((PyObject *)__pyx_kp_s_16)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_4, ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_5, ((PyObject *)__pyx_kp_s_18)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_6, ((PyObject *)__pyx_kp_s_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, __pyx_kp_s_bad_year) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_2, __pyx_kp_s_bad_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_3, __pyx_kp_s_bad_day) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_4, __pyx_kp_s_bad_hour) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_5, __pyx_kp_s_bad_minute) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_6, __pyx_kp_s_bad_second_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
@@ -3532,7 +3742,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  *                        &out1[i], &out2[i])
  *         check_return(ret, 'eraDtf2d', warns, errs)
  */
-    __pyx_t_11 = PyBytes_AsString(__pyx_v_scale); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_scale); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_12 = __pyx_v_i;
     __pyx_t_13 = __pyx_v_i;
     __pyx_t_14 = __pyx_v_i;
@@ -3549,6 +3759,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  */
     __pyx_t_18 = __pyx_v_i;
     __pyx_t_19 = __pyx_v_i;
+
+    /* "astropy/time/erfa_time.pyx":390
+ * 
+ *     for i in range(n):
+ *         ret = eraDtf2d(scale, iy[i], im[i], id[i], ihr[i], imn[i], sec[i],             # <<<<<<<<<<<<<<
+ *                        &out1[i], &out2[i])
+ *         check_return(ret, 'eraDtf2d', warns, errs)
+ */
     __pyx_v_ret = eraDtf2d(__pyx_t_11, (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_iy.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_iy.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_im.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_im.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_id.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_id.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_ihr.rcbuffer->pybu [...]
 
     /* "astropy/time/erfa_time.pyx":392
@@ -3558,29 +3776,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraDtf2d));
-    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_n_s__eraDtf2d));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraDtf2d));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_20 = 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_20 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(4+__pyx_t_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_20, __pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __Pyx_INCREF(__pyx_n_s_eraDtf2d);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_20, __pyx_n_s_eraDtf2d);
+    __Pyx_GIVEREF(__pyx_n_s_eraDtf2d);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_20, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_20, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_6 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":394
@@ -3591,20 +3824,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":305
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def dtf_jd(scale,             # <<<<<<<<<<<<<<
+ *               np.ndarray[int, ndim=1] iy,
+ *               np.ndarray[int, ndim=1] im,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -3644,18 +3884,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_8dtf_jd(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":399
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_11tai_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_10tai_tt[] = "\n    int eraTaitt(double tai1, double tai2, double *tt1, double *tt2)\n\n    **  Given:\n    **     tai1,tai2  double    TAI as a 2-part Julian Date\n    **\n    **  Returned:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Note:\n    **\n    **     tai1+tai2 is Julian Date, apportioned in any convenient w [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_11tai_tt = {__Pyx_NAMESTR("tai_tt"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_11tai_tt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_10tai_tt)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_11tai_tt = {"tai_tt", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_11tai_tt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_10tai_tt};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_11tai_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tai_tt (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -3669,10 +3920,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_11tai_tt(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tai_tt", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -3700,6 +3951,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_11tai_tt(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_10tai_tt(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -3708,14 +3961,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_11tai_tt(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":399
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tai_tt(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -3745,6 +3990,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -3784,9 +4030,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -3806,12 +4054,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -3819,19 +4067,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -3853,12 +4101,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -3866,19 +4114,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -3924,23 +4172,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTaitt));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTaitt));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTaitt));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTaitt);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTaitt);
+    __Pyx_GIVEREF(__pyx_n_s_eraTaitt);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":431
@@ -3951,20 +4214,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":399
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -3994,18 +4264,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_10tai_tt(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":436
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tcb_tdb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_12tcb_tdb[] = "\n    int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)\n\n    **  Given:\n    **     tcb1,tcb2  double    TCB as a 2-part Julian Date\n    **\n    **  Returned:\n    **     tdb1,tdb2  double    TDB as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    **\n    **  1) tcb1+tcb2 is Julian Date, apportioned in any conven [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_13tcb_tdb = {__Pyx_NAMESTR("tcb_tdb"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_12tcb_tdb)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_13tcb_tdb = {"tcb_tdb", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_12tcb_tdb};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tcb_tdb (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -4019,10 +4300,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tcb_tdb", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -4050,6 +4331,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -4058,14 +4341,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_13tcb_tdb(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":436
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tcb_tdb(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -4095,6 +4370,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4134,9 +4410,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -4156,12 +4434,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4169,19 +4447,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -4203,12 +4481,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4216,19 +4494,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -4274,23 +4552,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTcbtdb));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTcbtdb));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTcbtdb));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTcbtdb);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTcbtdb);
+    __Pyx_GIVEREF(__pyx_n_s_eraTcbtdb);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":487
@@ -4301,20 +4594,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":436
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tcb_tdb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -4344,18 +4644,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_12tcb_tdb(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":492
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tcg_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_14tcg_tt[] = "\n   int eraTcgtt(double tcg1, double tcg2, double *tt1, double *tt2)\n\n   **  Given:\n   **     tcg1,tcg2  double    TCG as a 2-part Julian Date\n   **\n   **  Returned:\n   **     tt1,tt2    double    TT as a 2-part Julian Date\n   **\n   **  Returned (function value):\n   **                int       status:  0 = OK\n    ";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_15tcg_tt = {__Pyx_NAMESTR("tcg_tt"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_14tcg_tt)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_15tcg_tt = {"tcg_tt", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_14tcg_tt};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tcg_tt (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -4369,10 +4680,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tcg_tt", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -4400,6 +4711,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -4408,14 +4721,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_15tcg_tt(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":492
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tcg_tt(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -4445,6 +4750,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4484,9 +4790,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -4506,12 +4814,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4519,19 +4827,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -4553,12 +4861,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4566,19 +4874,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -4624,23 +4932,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTcgtt));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTcgtt));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTcgtt));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTcgtt);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTcgtt);
+    __Pyx_GIVEREF(__pyx_n_s_eraTcgtt);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":518
@@ -4651,20 +4974,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":492
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tcg_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -4694,18 +5024,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_14tcg_tt(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":523
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tdb_tcb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_16tdb_tcb[] = "\n    int eraTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2)\n\n    **  Given:\n    **     tdb1,tdb2  double    TDB as a 2-part Julian Date\n    **\n    **  Returned:\n    **     tcb1,tcb2  double    TCB as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    ";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_17tdb_tcb = {__Pyx_NAMESTR("tdb_tcb"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_16tdb_tcb)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_17tdb_tcb = {"tdb_tcb", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_16tdb_tcb};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tdb_tcb (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -4719,10 +5060,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tdb_tcb", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -4750,6 +5091,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -4758,14 +5101,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_17tdb_tcb(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":523
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tdb_tcb(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -4795,6 +5130,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -4834,9 +5170,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -4856,12 +5194,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4869,19 +5207,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -4903,12 +5241,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -4916,19 +5254,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -4974,23 +5312,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTdbtcb));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTdbtcb));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTdbtcb));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTdbtcb);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTdbtcb);
+    __Pyx_GIVEREF(__pyx_n_s_eraTdbtcb);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":548
@@ -5001,20 +5354,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":523
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tdb_tcb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -5044,18 +5404,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_16tdb_tcb(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":553
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_19tt_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_18tt_tai[] = "\n    int eraTttai(double tt1, double tt2, double *tai1, double *tai2)\n\n    **  Given:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **\n    **  Returned:\n    **     tai1,tai2  double    TAI as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    ";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_19tt_tai = {__Pyx_NAMESTR("tt_tai"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_19tt_tai, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_18tt_tai)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_19tt_tai = {"tt_tai", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_19tt_tai, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_18tt_tai};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_19tt_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tt_tai (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -5069,10 +5440,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_19tt_tai(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_tai", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -5100,6 +5471,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_19tt_tai(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_18tt_tai(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -5108,14 +5481,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_19tt_tai(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":553
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tt_tai(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -5145,6 +5510,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -5184,9 +5550,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -5206,12 +5574,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5219,19 +5587,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -5253,12 +5621,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5266,19 +5634,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -5324,23 +5692,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTttai));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTttai));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTttai));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTttai);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTttai);
+    __Pyx_GIVEREF(__pyx_n_s_eraTttai);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":578
@@ -5351,20 +5734,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":553
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -5394,18 +5784,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_18tt_tai(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":583
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tcg(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_20tt_tcg[] = "\n    int eraTttcg(double tt1, double tt2, double *tcg1, double *tcg2)\n    **  Given:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **\n    **  Returned:\n    **     tcg1,tcg2  double    TCG as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    ";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_21tt_tcg = {__Pyx_NAMESTR("tt_tcg"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_20tt_tcg)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_21tt_tcg = {"tt_tcg", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_20tt_tcg};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tt_tcg (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -5419,10 +5820,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_tcg", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -5450,6 +5851,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -5458,14 +5861,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_21tt_tcg(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":583
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tt_tcg(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -5495,6 +5890,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -5534,9 +5930,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -5556,12 +5954,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5569,19 +5967,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -5603,12 +6001,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5616,19 +6014,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -5674,23 +6072,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTttcg));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTttcg));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTttcg));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTttcg);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTttcg);
+    __Pyx_GIVEREF(__pyx_n_s_eraTttcg);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":607
@@ -5701,20 +6114,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":583
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tcg(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -5744,18 +6164,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_20tt_tcg(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":612
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def utc_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_23utc_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_22utc_tai[] = "\n    int eraUtctai(double utc1, double utc2, double *tai1, double *tai2)\n\n    **  Given:\n    **     utc1,utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)\n    **\n    **  Returned:\n    **     tai1,tai2  double   TAI as a 2-part Julian Date (Note 5)\n    **\n    **  Returned (function value):\n    **                int      status: +1 = dubious year (Note 3)\n    **                                  0 = OK\n    [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_23utc_tai = {__Pyx_NAMESTR("utc_tai"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_23utc_tai, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_22utc_tai)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_23utc_tai = {"utc_tai", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_23utc_tai, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_22utc_tai};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_23utc_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("utc_tai (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -5769,10 +6200,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_23utc_tai(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("utc_tai", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -5800,6 +6231,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_23utc_tai(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_22utc_tai(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -5808,14 +6241,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_23utc_tai(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":612
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def utc_tai(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -5847,6 +6272,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -5886,9 +6312,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -5908,12 +6336,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5921,19 +6349,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -5955,12 +6383,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -5968,19 +6396,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -6003,8 +6431,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  * 
  */
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   if (PyDict_SetItem(__pyx_t_4, __pyx_int_1, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -6019,8 +6447,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  *     for i in range(n):
  */
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, __pyx_kp_s_unacceptable_date) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
@@ -6055,29 +6483,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraUtctai));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraUtctai));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraUtctai));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraUtctai);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraUtctai);
+    __Pyx_GIVEREF(__pyx_n_s_eraUtctai);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_14, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_14, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":665
@@ -6088,20 +6531,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":612
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def utc_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -6133,18 +6583,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_22utc_tai(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":670
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_utc(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_25tai_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_24tai_utc[] = "\n    int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2)\n\n    **  Given:\n    **     tai1,tai2  double   TAI as a 2-part Julian Date (Note 1)\n    **\n    **  Returned:\n    **     utc1,utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-3)\n    **\n    **  Returned (function value):\n    **                int      status: +1 = dubious year (Note 4)\n    **                                  0 = OK\n    [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_25tai_utc = {__Pyx_NAMESTR("tai_utc"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_25tai_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_24tai_utc)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_25tai_utc = {"tai_utc", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_25tai_utc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_24tai_utc};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_25tai_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tai_utc (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -6158,10 +6619,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_25tai_utc(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tai_utc", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -6189,6 +6650,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_25tai_utc(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in1), __pyx_ptype_5numpy_ndarray, 1, "in1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_24tai_utc(__pyx_self, __pyx_v_in1, __pyx_v_in2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -6197,14 +6660,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_25tai_utc(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":670
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tai_utc(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2):
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -6236,6 +6691,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_11;
   unsigned int __pyx_t_12;
   unsigned int __pyx_t_13;
+  Py_ssize_t __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -6275,9 +6731,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -6297,12 +6755,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -6310,19 +6768,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -6344,12 +6802,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -6357,19 +6815,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -6392,8 +6850,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  * 
  */
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   if (PyDict_SetItem(__pyx_t_4, __pyx_int_1, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -6408,8 +6866,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  *     for i in range(n):
  */
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, __pyx_kp_s_unacceptable_date) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
@@ -6444,29 +6902,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTaiutc));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__eraTaiutc));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTaiutc));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_1 = NULL;
+    __pyx_t_14 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_14 = 1;
+      }
+    }
+    __pyx_t_2 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    if (__pyx_t_1) {
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_14, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_eraTaiutc);
+    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_14, __pyx_n_s_eraTaiutc);
+    __Pyx_GIVEREF(__pyx_n_s_eraTaiutc);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_14, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_14, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_3 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":722
@@ -6477,20 +6950,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":670
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_utc(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -6522,19 +7002,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_24tai_utc(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":727
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_26tai_ut1[] = "\n    int eraTaiut1(double tai1, double tai2, double dta, double *ut11, double *ut12)\n\n    **  Given:\n    **     tai1,tai2  double    TAI as a 2-part Julian Date\n    **     dta        double    UT1-TAI in seconds\n    **\n    **  Returned:\n    **     ut11,ut12  double    UT1 as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    ** [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_27tai_ut1 = {__Pyx_NAMESTR("tai_ut1"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_26tai_ut1)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_27tai_ut1 = {"tai_ut1", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_26tai_ut1};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tai_ut1 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -6549,15 +7040,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tai_ut1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tai_ut1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -6588,6 +7079,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -6596,14 +7089,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_27tai_ut1(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":727
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tai_ut1(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -6637,6 +7122,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -6685,13 +7171,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -6711,12 +7199,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -6724,19 +7212,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -6758,12 +7246,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -6771,19 +7259,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -6830,23 +7318,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTaiut1));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraTaiut1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTaiut1));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraTaiut1);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraTaiut1);
+    __Pyx_GIVEREF(__pyx_n_s_eraTaiut1);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":764
@@ -6857,20 +7360,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":727
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tai_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -6902,19 +7412,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_26tai_ut1(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":769
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_28ut1_tai[] = "\n    int eraUt1tai(double ut11, double ut12, double dta, double *tai1, double *tai2)\n\n    **  Given:\n    **     ut11,ut12  double    UT1 as a 2-part Julian Date\n    **     dta        double    UT1-TAI in seconds\n    **\n    **  Returned:\n    **     tai1,tai2  double    TAI as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    ** [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_29ut1_tai = {__Pyx_NAMESTR("ut1_tai"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_28ut1_tai)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_29ut1_tai = {"ut1_tai", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_28ut1_tai};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("ut1_tai (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -6929,15 +7450,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_tai", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_tai", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -6968,6 +7489,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -6976,14 +7499,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_29ut1_tai(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":769
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def ut1_tai(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -7017,6 +7532,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -7065,13 +7581,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -7091,12 +7609,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7104,19 +7622,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -7138,12 +7656,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7151,19 +7669,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -7210,23 +7728,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraUt1tai));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraUt1tai));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraUt1tai));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraUt1tai);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraUt1tai);
+    __Pyx_GIVEREF(__pyx_n_s_eraUt1tai);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":806
@@ -7237,20 +7770,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":769
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_tai(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -7282,19 +7822,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_28ut1_tai(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":811
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_30tt_ut1[] = "\n    int eraTtut1(double tt1, double tt2, double dt, double *ut11, double *ut12)\n\n    **  Given:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **     dt         double    TT-UT1 in seconds\n    **\n    **  Returned:\n    **     ut11,ut12  double    UT1 as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    **\n    * [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_31tt_ut1 = {__Pyx_NAMESTR("tt_ut1"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_30tt_ut1)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_31tt_ut1 = {"tt_ut1", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_30tt_ut1};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tt_ut1 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -7309,15 +7860,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_ut1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_ut1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -7348,6 +7899,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -7356,14 +7909,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_31tt_ut1(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":811
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tt_ut1(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -7397,6 +7942,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -7445,13 +7991,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -7471,12 +8019,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7484,19 +8032,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -7518,12 +8066,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7531,19 +8079,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -7590,23 +8138,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTtut1));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraTtut1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTtut1));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraTtut1);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraTtut1);
+    __Pyx_GIVEREF(__pyx_n_s_eraTtut1);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":847
@@ -7617,22 +8180,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
+  /* "astropy/time/erfa_time.pyx":811
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* 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_5);
@@ -7662,19 +8232,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_30tt_ut1(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":852
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_32ut1_tt[] = "\n    int eraUt1tt(double ut11, double ut12, double dt, double *tt1, double *tt2)\n\n    **  Given:\n    **     ut11,ut12  double    UT1 as a 2-part Julian Date\n    **     dt         double    TT-UT1 in seconds\n    **\n    **  Returned:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    **\n    * [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_33ut1_tt = {__Pyx_NAMESTR("ut1_tt"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_32ut1_tt)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_33ut1_tt = {"ut1_tt", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_32ut1_tt};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("ut1_tt (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -7689,15 +8270,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_tt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_tt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -7728,6 +8309,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -7736,14 +8319,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_33ut1_tt(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":852
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def ut1_tt(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -7777,6 +8352,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -7825,13 +8401,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -7851,12 +8429,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7864,19 +8442,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -7898,12 +8476,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -7911,19 +8489,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -7970,23 +8548,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraUt1tt));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraUt1tt));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraUt1tt));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraUt1tt);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraUt1tt);
+    __Pyx_GIVEREF(__pyx_n_s_eraUt1tt);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":888
@@ -7997,20 +8590,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":852
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -8042,19 +8642,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_32ut1_tt(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":893
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tdb_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_34tdb_tt[] = "\n    int eraTdbtt(double tdb1, double tdb2, double dtr, double *tt1, double *tt2)\n\n    **  Given:\n    **     tdb1,tdb2  double    TDB as a 2-part Julian Date\n    **     dtr        double    TDB-TT in seconds\n    **\n    **  Returned:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    **\n     [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_35tdb_tt = {__Pyx_NAMESTR("tdb_tt"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_34tdb_tt)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_35tdb_tt = {"tdb_tt", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_34tdb_tt};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tdb_tt (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -8069,15 +8680,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tdb_tt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tdb_tt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -8108,6 +8719,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -8116,14 +8729,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_35tdb_tt(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":893
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tdb_tt(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -8157,6 +8762,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -8205,13 +8811,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -8231,12 +8839,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -8244,19 +8852,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -8278,12 +8886,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -8291,19 +8899,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -8350,23 +8958,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTdbtt));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraTdbtt));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTdbtt));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraTdbtt);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraTdbtt);
+    __Pyx_GIVEREF(__pyx_n_s_eraTdbtt);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":938
@@ -8377,20 +9000,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":893
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tdb_tt(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -8422,19 +9052,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_34tdb_tt(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":943
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tdb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_36tt_tdb[] = "\n    int eraTttdb(double tt1, double tt2, double dtr, double *tdb1, double *tdb2)\n\n    **  Given:\n    **     tt1,tt2    double    TT as a 2-part Julian Date\n    **     dtr        double    TDB-TT in seconds\n    **\n    **  Returned:\n    **     tdb1,tdb2  double    TDB as a 2-part Julian Date\n    **\n    **  Returned (function value):\n    **                int       status:  0 = OK\n    **\n    **  Notes:\n    **\n     [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_37tt_tdb = {__Pyx_NAMESTR("tt_tdb"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_36tt_tdb)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_37tt_tdb = {"tt_tdb", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_36tt_tdb};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tt_tdb (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -8449,15 +9090,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_tdb", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("tt_tdb", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -8488,6 +9129,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -8496,14 +9139,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_37tt_tdb(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":943
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def tt_tdb(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -8537,6 +9172,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -8585,13 +9221,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -8611,12 +9249,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -8624,19 +9262,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -8658,12 +9296,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -8671,19 +9309,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -8730,23 +9368,38 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraTttdb));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraTttdb));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraTttdb));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraTttdb);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraTttdb);
+    __Pyx_GIVEREF(__pyx_n_s_eraTttdb);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":988
@@ -8757,20 +9410,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":943
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def tt_tdb(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -8802,19 +9462,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_36tt_tdb(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":993
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_utc(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_38ut1_utc[] = "\n    int eraUt1utc(double ut11, double ut12, double dut1, double *utc1, double *utc2)\n\n    **  Given:\n    **     ut11,ut12  double   UT1 as a 2-part Julian Date (Note 1)\n    **     dut1       double   Delta UT1: UT1-UTC in seconds (Note 2)\n    **\n    **  Returned:\n    **     utc1,utc2  double   UTC as a 2-part quasi Julian Date (Notes 3,4)\n    **\n    **  Returned (function value):\n    **                int      sta [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_39ut1_utc = {__Pyx_NAMESTR("ut1_utc"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_38ut1_utc)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_39ut1_utc = {"ut1_utc", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_38ut1_utc};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("ut1_utc (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -8829,15 +9500,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_utc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("ut1_utc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -8868,6 +9539,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -8876,14 +9549,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_39ut1_utc(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":993
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def ut1_utc(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -8919,6 +9584,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -8967,13 +9633,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -8993,12 +9661,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -9006,19 +9674,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -9040,12 +9708,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -9053,19 +9721,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -9088,8 +9756,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  * 
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   if (PyDict_SetItem(__pyx_t_5, __pyx_int_1, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -9104,8 +9772,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  *     for i in range(n):
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, __pyx_kp_s_unacceptable_date) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
@@ -9141,29 +9809,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraUt1utc));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraUt1utc));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraUt1utc));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraUt1utc);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraUt1utc);
+    __Pyx_GIVEREF(__pyx_n_s_eraUt1utc);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_16, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_16, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":1052
@@ -9174,20 +9857,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":993
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def ut1_utc(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -9221,19 +9911,30 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_38ut1_utc(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1057
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def utc_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_40utc_ut1[] = "\n    int eraUtcut1(double utc1, double utc2, double dut1, double *ut11, double *ut12)\n\n    **  Given:\n    **     utc1,utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)\n    **     dut1       double   Delta UT1 = UT1-UTC in seconds (Note 5)\n    **\n    **  Returned:\n    **     ut11,ut12  double   UT1 as a 2-part Julian Date (Note 6)\n    **\n    **  Returned (function value):\n    **                int      st [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_41utc_ut1 = {__Pyx_NAMESTR("utc_ut1"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_40utc_ut1)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_41utc_ut1 = {"utc_ut1", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_40utc_ut1};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
   PyArrayObject *__pyx_v_dt = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("utc_ut1 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__dt,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_dt,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -9248,15 +9949,15 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1(PyObject *__pyx_se
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("utc_ut1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dt)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("utc_ut1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -9287,6 +9988,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1(PyObject *__pyx_se
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in2), __pyx_ptype_5numpy_ndarray, 1, "in2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_5numpy_ndarray, 1, "dt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_dt);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -9295,14 +9998,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_41utc_ut1(PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1057
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def utc_ut1(             # <<<<<<<<<<<<<<
- *     np.ndarray[double, ndim=1] in1,
- *     np.ndarray[double, ndim=1] in2,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_dt) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -9338,6 +10033,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
   unsigned int __pyx_t_13;
   unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
+  Py_ssize_t __pyx_t_16;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -9386,13 +10082,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_dt->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -9412,12 +10110,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  *     cdef np.ndarray[double, ndim=1] out2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -9425,19 +10123,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -9459,12 +10157,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  * 
  *     warns = {1: DUBIOUS}
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -9472,19 +10170,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -9507,8 +10205,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  * 
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DUBIOUS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   if (PyDict_SetItem(__pyx_t_5, __pyx_int_1, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -9523,8 +10221,8 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  *     for i in range(n):
  */
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_int_neg_1, __pyx_kp_s_unacceptable_date) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
@@ -9560,29 +10258,44 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  * 
  *     return out1, out2
  */
-    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraUtcut1));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__eraUtcut1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraUtcut1));
-    __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-    PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_warns));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-    __Pyx_INCREF(((PyObject *)__pyx_v_errs));
-    PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_errs));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_errs));
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_2 = NULL;
+    __pyx_t_16 = 0;
+    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);
+        __pyx_t_16 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_2) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_16, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_n_s_eraUtcut1);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_16, __pyx_n_s_eraUtcut1);
+    __Pyx_GIVEREF(__pyx_n_s_eraUtcut1);
+    __Pyx_INCREF(__pyx_v_warns);
+    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_16, __pyx_v_warns);
+    __Pyx_GIVEREF(__pyx_v_warns);
+    __Pyx_INCREF(__pyx_v_errs);
+    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_16, __pyx_v_errs);
+    __Pyx_GIVEREF(__pyx_v_errs);
+    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
 
   /* "astropy/time/erfa_time.pyx":1120
@@ -9593,20 +10306,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_out1));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out1));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out1));
   __Pyx_INCREF(((PyObject *)__pyx_v_out2));
-  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out2));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_out2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_out2));
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1057
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def utc_ut1(             # <<<<<<<<<<<<<<
+ *     np.ndarray[double, ndim=1] in1,
+ *     np.ndarray[double, ndim=1] in2,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -9640,10 +10360,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_40utc_ut1(CYTHON_UNUSED PyOb
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1125
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def d_tdb_tt(np.ndarray[double, ndim=1] in1,             # <<<<<<<<<<<<<<
+ *              np.ndarray[double, ndim=1] in2,
+ *              np.ndarray[double, ndim=1] ut,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_42d_tdb_tt[] = "\n    compute DTR = TDB-TT\n    double eraDtdb(double date1, double date2, double ut,\n                   double elong, double u, double v)\n\n    **  Given:\n    **     date1,date2   double  date, TDB (Notes 1-3)\n    **     ut            double  universal time (UT1, fraction of one day)\n    **     elong         double  longitude (east positive, radians)\n    **     u             double  distance from Earth spin axis (km)\ [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_43d_tdb_tt = {__Pyx_NAMESTR("d_tdb_tt"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_42d_tdb_tt)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_43d_tdb_tt = {"d_tdb_tt", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_42d_tdb_tt};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_in1 = 0;
   PyArrayObject *__pyx_v_in2 = 0;
@@ -9651,11 +10379,14 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_s
   PyArrayObject *__pyx_v_elong = 0;
   PyArrayObject *__pyx_v_u = 0;
   PyArrayObject *__pyx_v_v = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("d_tdb_tt (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in1,&__pyx_n_s__in2,&__pyx_n_s__ut,&__pyx_n_s__elong,&__pyx_n_s__u,&__pyx_n_s__v,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in1,&__pyx_n_s_in2,&__pyx_n_s_ut,&__pyx_n_s_elong,&__pyx_n_s_u,&__pyx_n_s_v,0};
     PyObject* values[6] = {0,0,0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -9673,30 +10404,30 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_s
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tdb_tt", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tdb_tt", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__elong)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elong)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tdb_tt", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__u)) != 0)) kw_args--;
+        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tdb_tt", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  5:
-        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__v)) != 0)) kw_args--;
+        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("d_tdb_tt", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -9736,6 +10467,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_s
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(__pyx_self, __pyx_v_in1, __pyx_v_in2, __pyx_v_ut, __pyx_v_elong, __pyx_v_u, __pyx_v_v);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -9744,14 +10477,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_43d_tdb_tt(PyObject *__pyx_s
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1125
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def d_tdb_tt(np.ndarray[double, ndim=1] in1,             # <<<<<<<<<<<<<<
- *              np.ndarray[double, ndim=1] in2,
- *              np.ndarray[double, ndim=1] ut,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_in1, PyArrayObject *__pyx_v_in2, PyArrayObject *__pyx_v_ut, PyArrayObject *__pyx_v_elong, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -9775,24 +10500,23 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
+  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;
-  PyArrayObject *__pyx_t_9 = NULL;
+  PyArrayObject *__pyx_t_8 = NULL;
+  unsigned int __pyx_t_9;
   unsigned int __pyx_t_10;
-  unsigned int __pyx_t_11;
-  long __pyx_t_12;
-  unsigned int __pyx_t_13;
-  long __pyx_t_14;
+  long __pyx_t_11;
+  unsigned int __pyx_t_12;
+  long __pyx_t_13;
+  unsigned int __pyx_t_14;
   unsigned int __pyx_t_15;
   unsigned int __pyx_t_16;
   unsigned int __pyx_t_17;
   unsigned int __pyx_t_18;
   unsigned int __pyx_t_19;
-  unsigned int __pyx_t_20;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -9864,13 +10588,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *     assert elong.shape[0] == 1 or elong.shape[0] == in1.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_ut->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_in1->dimensions[0]) == (__pyx_v_in2->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_in2->dimensions[0]) == (__pyx_v_ut->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -9882,13 +10608,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *     cdef unsigned n = in1.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_elong->dimensions[0]) == (__pyx_v_u->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_u->dimensions[0]) == (__pyx_v_v->dimensions[0]));
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_elong->dimensions[0]) == (__pyx_v_u->dimensions[0]));
+    if (__pyx_t_1) {
+      __pyx_t_1 = ((__pyx_v_u->dimensions[0]) == (__pyx_v_v->dimensions[0]));
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -9900,16 +10628,20 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *     cdef unsigned int i, j
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_elong->dimensions[0]) == 1);
-  if (!__pyx_t_1) {
-    __pyx_t_2 = ((__pyx_v_elong->dimensions[0]) == (__pyx_v_in1->dimensions[0]));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (unlikely(!__pyx_t_3)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = (((__pyx_v_elong->dimensions[0]) == 1) != 0);
+    if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L3_bool_binop_done;
+    }
+    __pyx_t_2 = (((__pyx_v_elong->dimensions[0]) == (__pyx_v_in1->dimensions[0])) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L3_bool_binop_done:;
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -9929,45 +10661,45 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  * 
  *     for i in range(n):
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
       __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];
     }
   }
-  __pyx_t_9 = 0;
-  __pyx_v_out = ((PyArrayObject *)__pyx_t_8);
   __pyx_t_8 = 0;
+  __pyx_v_out = ((PyArrayObject *)__pyx_t_7);
+  __pyx_t_7 = 0;
 
   /* "astropy/time/erfa_time.pyx":1240
  *     cdef np.ndarray[double, ndim=1] out = np.empty(n, dtype=np.double)
@@ -9976,9 +10708,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *         j = min(i, elong.shape[0]-1)
  *         out[i] = eraDtdb(in1[i], in2[i], ut[i], elong[j], u[j], v[j])
  */
-  __pyx_t_10 = __pyx_v_n;
-  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
-    __pyx_v_i = __pyx_t_11;
+  __pyx_t_9 = __pyx_v_n;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
 
     /* "astropy/time/erfa_time.pyx":1241
  * 
@@ -9987,14 +10719,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *         out[i] = eraDtdb(in1[i], in2[i], ut[i], elong[j], u[j], v[j])
  *     return out
  */
-    __pyx_t_12 = ((__pyx_v_elong->dimensions[0]) - 1);
-    __pyx_t_13 = __pyx_v_i;
-    if ((__pyx_t_12 < __pyx_t_13)) {
-      __pyx_t_14 = __pyx_t_12;
+    __pyx_t_11 = ((__pyx_v_elong->dimensions[0]) - 1);
+    __pyx_t_12 = __pyx_v_i;
+    if (((__pyx_t_11 < __pyx_t_12) != 0)) {
+      __pyx_t_13 = __pyx_t_11;
     } else {
-      __pyx_t_14 = __pyx_t_13;
+      __pyx_t_13 = __pyx_t_12;
     }
-    __pyx_v_j = __pyx_t_14;
+    __pyx_v_j = __pyx_t_13;
 
     /* "astropy/time/erfa_time.pyx":1242
  *     for i in range(n):
@@ -10003,14 +10735,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
  *     return out
  * 
  */
-    __pyx_t_13 = __pyx_v_i;
+    __pyx_t_12 = __pyx_v_i;
+    __pyx_t_14 = __pyx_v_i;
     __pyx_t_15 = __pyx_v_i;
-    __pyx_t_16 = __pyx_v_i;
+    __pyx_t_16 = __pyx_v_j;
     __pyx_t_17 = __pyx_v_j;
     __pyx_t_18 = __pyx_v_j;
-    __pyx_t_19 = __pyx_v_j;
-    __pyx_t_20 = __pyx_v_i;
-    *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides) = eraDtdb((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_in1.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_in1.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_in2.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_in2.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ut.rcbuffer->pybuffer.buf, _ [...]
+    __pyx_t_19 = __pyx_v_i;
+    *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = eraDtdb((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_in1.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_in1.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_in2.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_in2.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ut.rcbuffer->pybuffer.buf, _ [...]
   }
 
   /* "astropy/time/erfa_time.pyx":1243
@@ -10025,14 +10757,21 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
   __pyx_r = ((PyObject *)__pyx_v_out);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1125
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def d_tdb_tt(np.ndarray[double, ndim=1] in1,             # <<<<<<<<<<<<<<
+ *              np.ndarray[double, ndim=1] in2,
+ *              np.ndarray[double, ndim=1] ut,
+ */
+
+  /* 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);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elong.rcbuffer->pybuffer);
@@ -10061,20 +10800,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_42d_tdb_tt(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1246
+ * 
+ * 
+ * def era_af2a(sign, ideg, iamin, asec):             # <<<<<<<<<<<<<<
+ *     """
+ *     int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_45era_af2a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_44era_af2a[] = "\n    int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)\n\n    **  Given:\n    **     s         char    sign:  '-' = negative, otherwise positive\n    **     ideg      int     degrees\n    **     iamin     int     arcminutes\n    **     asec      double  arcseconds\n    **\n    **  Returned:\n    **     rad       double  angle in radians\n    **\n    **  Returned (function value):\n    **               int   [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_45era_af2a = {__Pyx_NAMESTR("era_af2a"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_45era_af2a, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_44era_af2a)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_45era_af2a = {"era_af2a", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_45era_af2a, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_44era_af2a};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_45era_af2a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_sign = 0;
   PyObject *__pyx_v_ideg = 0;
   PyObject *__pyx_v_iamin = 0;
   PyObject *__pyx_v_asec = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("era_af2a (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sign,&__pyx_n_s__ideg,&__pyx_n_s__iamin,&__pyx_n_s__asec,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sign,&__pyx_n_s_ideg,&__pyx_n_s_iamin,&__pyx_n_s_asec,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -10090,20 +10840,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_45era_af2a(PyObject *__pyx_s
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sign)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sign)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ideg)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ideg)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_af2a", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iamin)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iamin)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_af2a", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__asec)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_asec)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_af2a", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -10133,18 +10883,12 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_45era_af2a(PyObject *__pyx_s
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_44era_af2a(__pyx_self, __pyx_v_sign, __pyx_v_ideg, __pyx_v_iamin, __pyx_v_asec);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1246
- * 
- * 
- * def era_af2a(sign, ideg, iamin, asec):             # <<<<<<<<<<<<<<
- *     """
- *     int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sign, PyObject *__pyx_v_ideg, PyObject *__pyx_v_iamin, PyObject *__pyx_v_asec) {
   double __pyx_v_rad;
   PyObject *__pyx_v_s = NULL;
@@ -10159,6 +10903,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
   int __pyx_t_5;
   double __pyx_t_6;
   PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_8 = NULL;
+  Py_ssize_t __pyx_t_9;
+  PyObject *__pyx_t_10 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -10176,9 +10923,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
   __Pyx_INCREF(__pyx_v_sign);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sign);
   __Pyx_GIVEREF(__pyx_v_sign);
-  __pyx_t_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_s = __pyx_t_2;
   __pyx_t_2 = 0;
 
@@ -10190,10 +10937,10 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
  *              3: 'asec outside range 0-59.999...'}
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, ((PyObject *)__pyx_kp_s_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, ((PyObject *)__pyx_kp_s_21)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, ((PyObject *)__pyx_kp_s_22)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_kp_s_ideg_outside_range_0_359) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_kp_s_iamin_outside_range_0_59) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_kp_s_asec_outside_range_0_59_999) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_warns = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
@@ -10204,9 +10951,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
  *     check_return(ret, 'eraAf2a', warns)
  * 
  */
-  __pyx_t_3 = __Pyx_PyInt_AsChar(__pyx_v_s); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_ideg); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_iamin); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_As_char(__pyx_v_s); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ideg); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_iamin); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_asec); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_ret = eraAf2a(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, (&__pyx_v_rad));
 
@@ -10217,26 +10964,41 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
  * 
  *     return rad
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__eraAf2a));
-  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__eraAf2a));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraAf2a));
-  __Pyx_INCREF(((PyObject *)__pyx_v_warns));
-  PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_warns));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_warns));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  __pyx_t_8 = NULL;
+  __pyx_t_9 = 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_9 = 1;
+    }
+  }
+  __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  if (__pyx_t_8) {
+    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __Pyx_INCREF(__pyx_n_s_eraAf2a);
+  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_n_s_eraAf2a);
+  __Pyx_GIVEREF(__pyx_n_s_eraAf2a);
+  __Pyx_INCREF(__pyx_v_warns);
+  PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_warns);
+  __Pyx_GIVEREF(__pyx_v_warns);
+  __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1285
  *     check_return(ret, 'eraAf2a', warns)
@@ -10246,18 +11008,27 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
  * def era_gd2gc(n, elong, phi, height):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_rad); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1246
+ * 
+ * 
+ * def era_af2a(sign, ideg, iamin, asec):             # <<<<<<<<<<<<<<
+ *     """
+ *     int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_10);
   __Pyx_AddTraceback("astropy.time.erfa_time.era_af2a", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -10268,20 +11039,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_44era_af2a(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1287
+ *     return rad
+ * 
+ * def era_gd2gc(n, elong, phi, height):             # <<<<<<<<<<<<<<
+ *     """
+ *     Wrap
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_46era_gd2gc[] = "\n    Wrap\n    int eraGd2gc(int n, double elong, double phi, double height, double xyz[3])\n\n    **  Given:\n    **     n       int        ellipsoid identifier (Note 1)\n    **     elong   double     longitude (radians, east +ve)\n    **     phi     double     latitude (geodetic, radians, Note 3)\n    **     height  double     height above ellipsoid (geodetic, Notes 2,3)\n    **\n    **  Returned:\n    **     xyz     doub [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_47era_gd2gc = {__Pyx_NAMESTR("era_gd2gc"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_46era_gd2gc)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_47era_gd2gc = {"era_gd2gc", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_46era_gd2gc};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_n = 0;
   PyObject *__pyx_v_elong = 0;
   PyObject *__pyx_v_phi = 0;
   PyObject *__pyx_v_height = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("era_gd2gc (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__elong,&__pyx_n_s__phi,&__pyx_n_s__height,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_elong,&__pyx_n_s_phi,&__pyx_n_s_height,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -10297,20 +11079,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc(PyObject *__pyx_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__elong)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elong)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_gd2gc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phi)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_gd2gc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__height)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_gd2gc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -10340,18 +11122,12 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_47era_gd2gc(PyObject *__pyx_
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(__pyx_self, __pyx_v_n, __pyx_v_elong, __pyx_v_phi, __pyx_v_height);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1287
- *     return rad
- * 
- * def era_gd2gc(n, elong, phi, height):             # <<<<<<<<<<<<<<
- *     """
- *     Wrap
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_elong, PyObject *__pyx_v_phi, PyObject *__pyx_v_height) {
   unsigned int __pyx_v_i;
   unsigned int __pyx_v_nitems;
@@ -10402,50 +11178,52 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  *     cdef unsigned int nitems = elong.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_elong, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_phi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elong, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_phi, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
+      __Pyx_DECREF(__pyx_t_1);
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_height, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(!__pyx_t_6)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+  }
+  #endif
+
+  /* "astropy/time/erfa_time.pyx":1333
+ *     assert elong.shape[0] == phi.shape[0] == height.shape[0]
+ *     cdef unsigned int i
+ *     cdef unsigned int nitems = elong.shape[0]             # <<<<<<<<<<<<<<
+ *     cdef np.ndarray[double, ndim=1] xyz = np.empty(3, dtype=np.double)
+ *     cdef np.ndarray[double, ndim=2] out = np.empty((nitems, 3), dtype=np.double)
+ */
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elong, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
-    __Pyx_DECREF(__pyx_t_1);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_v_height, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_6)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  #endif
-
-  /* "astropy/time/erfa_time.pyx":1333
- *     assert elong.shape[0] == phi.shape[0] == height.shape[0]
- *     cdef unsigned int i
- *     cdef unsigned int nitems = elong.shape[0]             # <<<<<<<<<<<<<<
- *     cdef np.ndarray[double, ndim=1] xyz = np.empty(3, dtype=np.double)
- *     cdef np.ndarray[double, ndim=2] out = np.empty((nitems, 3), dtype=np.double)
- */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_elong, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_nitems = __pyx_t_7;
 
@@ -10456,24 +11234,24 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  *     cdef np.ndarray[double, ndim=2] out = np.empty((nitems, 3), dtype=np.double)
  * 
  */
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_23), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -10495,12 +11273,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  * 
  *     errs = {-1: 'illegal identifier',
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_nitems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_nitems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
@@ -10512,23 +11290,23 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
   __pyx_t_5 = 0;
   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -10551,9 +11329,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  * 
  */
   __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_24)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_2, ((PyObject *)__pyx_kp_s_25)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, __pyx_kp_s_illegal_identifier) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_2, __pyx_kp_s_illegal_case) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
@@ -10575,16 +11353,16 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  *         check_return(ret, 'eraGd2gc', errors=errs)
  *         out[i] = xyz
  */
-    __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_n); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elong, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elong, __pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_height, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_height, __pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -10607,26 +11385,26 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  *         out[i] = xyz
  * 
  */
-    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraGd2gc));
-    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__eraGd2gc));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraGd2gc));
+    __Pyx_INCREF(__pyx_n_s_eraGd2gc);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_eraGd2gc);
+    __Pyx_GIVEREF(__pyx_n_s_eraGd2gc);
     __pyx_t_1 = 0;
     __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__errors), ((PyObject *)__pyx_v_errs)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_v_errs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "astropy/time/erfa_time.pyx":1343
@@ -10636,7 +11414,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
  * 
  *     return out
  */
-    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, ((PyObject *)__pyx_v_xyz), sizeof(unsigned int)+1, PyLong_FromUnsignedLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, ((PyObject *)__pyx_v_xyz), unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
 
   /* "astropy/time/erfa_time.pyx":1345
@@ -10651,8 +11429,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
   __pyx_r = ((PyObject *)__pyx_v_out);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1287
+ *     return rad
+ * 
+ * def era_gd2gc(n, elong, phi, height):             # <<<<<<<<<<<<<<
+ *     """
+ *     Wrap
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -10679,18 +11464,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_46era_gd2gc(CYTHON_UNUSED Py
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1349
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def era_gc2gd(n, xyz):             # <<<<<<<<<<<<<<
+ *     """
+ *     Wrap
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_48era_gc2gd[] = "\n    Wrap\n    int eraGc2gd(int n, double xyz[3], double *elong, double *phi, double *height )\n\n    **  Given:\n    **     n       int        ellipsoid identifier (Note 1)\n    **     xyz     double[3]  geocentric vector (Note 2)\n    **\n    **  Returned:\n    **     elong   double     longitude (radians, east +ve)\n    **     phi     double     latitude (geodetic, radians, Note 3)\n    **     height  double     height  [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_49era_gc2gd = {__Pyx_NAMESTR("era_gc2gd"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_48era_gc2gd)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_49era_gc2gd = {"era_gc2gd", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_48era_gc2gd};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_n = 0;
   PyObject *__pyx_v_xyz = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("era_gc2gd (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__xyz,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_xyz,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -10704,10 +11500,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd(PyObject *__pyx_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xyz)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xyz)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("era_gc2gd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -10733,18 +11529,12 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_49era_gc2gd(PyObject *__pyx_
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(__pyx_self, __pyx_v_n, __pyx_v_xyz);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1349
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def era_gc2gd(n, xyz):             # <<<<<<<<<<<<<<
- *     """
- *     Wrap
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_xyz) {
   unsigned int __pyx_v_i;
   unsigned int __pyx_v_nitems;
@@ -10805,18 +11595,20 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     cdef unsigned int nitems = xyz.shape[0]
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_xyz, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __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_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_3)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __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_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(!__pyx_t_3)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -10827,12 +11619,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     cdef np.ndarray[double, ndim=1] elong = np.empty(nitems, dtype=np.double)
  *     cdef np.ndarray[double, ndim=1] phi = np.empty(nitems, dtype=np.double)
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_xyz, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_nitems = __pyx_t_4;
 
@@ -10843,12 +11635,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     cdef np.ndarray[double, ndim=1] phi = np.empty(nitems, dtype=np.double)
  *     cdef np.ndarray[double, ndim=1] height = np.empty(nitems, dtype=np.double)
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_nitems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_nitems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
@@ -10856,19 +11648,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
   {
@@ -10890,12 +11682,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     cdef np.ndarray[double, ndim=1] height = np.empty(nitems, dtype=np.double)
  *     cdef double xyz_item[3]
  */
-  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_nitems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_nitems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
@@ -10903,19 +11695,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_7 = 0;
   __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -10937,12 +11729,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     cdef double xyz_item[3]
  * 
  */
-  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
@@ -10950,19 +11742,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
   __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
   {
@@ -10985,9 +11777,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *     for i in range(nitems):
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, ((PyObject *)__pyx_kp_s_24)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_2, ((PyObject *)__pyx_kp_s_25)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, __pyx_kp_s_illegal_identifier) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_2, __pyx_kp_s_illegal_case) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_errs = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -11019,9 +11811,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *         ret = eraGc2gd(n, xyz_item, &elong[i], &phi[i], &height[i])
  *         check_return(ret, 'eraGd2gc', errors=errs)
  */
-      __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_j); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
@@ -11031,9 +11823,9 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
       __Pyx_GIVEREF(__pyx_t_6);
       __pyx_t_1 = 0;
       __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_GetItem(__pyx_v_xyz, ((PyObject *)__pyx_t_5)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = PyObject_GetItem(__pyx_v_xyz, __pyx_t_5); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       (__pyx_v_xyz_item[__pyx_v_j]) = __pyx_t_13;
@@ -11046,7 +11838,7 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  *         check_return(ret, 'eraGd2gc', errors=errs)
  * 
  */
-    __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_v_n); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_15 = __pyx_v_i;
     __pyx_t_16 = __pyx_v_i;
     __pyx_t_17 = __pyx_v_i;
@@ -11059,26 +11851,26 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
  * 
  *     return elong, phi, height
  */
-    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_return); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
     __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__eraGd2gc));
-    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__eraGd2gc));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__eraGd2gc));
+    __Pyx_INCREF(__pyx_n_s_eraGd2gc);
+    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_eraGd2gc);
+    __Pyx_GIVEREF(__pyx_n_s_eraGd2gc);
     __pyx_t_5 = 0;
     __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__errors), ((PyObject *)__pyx_v_errs)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_errors, __pyx_v_errs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
 
@@ -11101,12 +11893,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
   __Pyx_INCREF(((PyObject *)__pyx_v_height));
   PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_height));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_height));
-  __pyx_r = ((PyObject *)__pyx_t_7);
+  __pyx_r = __pyx_t_7;
   __pyx_t_7 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1349
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def era_gc2gd(n, xyz):             # <<<<<<<<<<<<<<
+ *     """
+ *     Wrap
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -11136,18 +11935,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_48era_gc2gd(CYTHON_UNUSED Py
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1419
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_julian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
+ *                     np.ndarray[double, ndim=1] jd2):
+ *     """ Wrap double eraEpj(double dj1, double dj2)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_50jd_julian_epoch[] = " Wrap double eraEpj(double dj1, double dj2)\n    **  Julian Date to Julian Epoch.\n\n    **  Given:\n    **     dj1,dj2    double     Julian Date (see note)\n    **\n    **  Returned (function value):\n    **                double     Julian Epoch\n    **\n    **  Note:\n    **\n    **     The Julian Date is supplied in two pieces, in the usual ERFA\n    **     manner, which is designed to preserve time resolution.  T [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_51jd_julian_epoch = {__Pyx_NAMESTR("jd_julian_epoch"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_50jd_julian_epoch)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_51jd_julian_epoch = {"jd_julian_epoch", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_50jd_julian_epoch};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_jd1 = 0;
   PyArrayObject *__pyx_v_jd2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("jd_julian_epoch (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__jd1,&__pyx_n_s__jd2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jd1,&__pyx_n_s_jd2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -11161,10 +11971,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch(PyObject *
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__jd1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jd1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__jd2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jd2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("jd_julian_epoch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -11192,6 +12002,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch(PyObject *
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jd1), __pyx_ptype_5numpy_ndarray, 1, "jd1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jd2), __pyx_ptype_5numpy_ndarray, 1, "jd2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(__pyx_self, __pyx_v_jd1, __pyx_v_jd2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -11200,14 +12012,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_51jd_julian_epoch(PyObject *
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1419
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def jd_julian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
- *                     np.ndarray[double, ndim=1] jd2):
- *     """ Wrap double eraEpj(double dj1, double dj2)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_jd1, PyArrayObject *__pyx_v_jd2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -11266,9 +12070,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNU
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_jd1->dimensions[0]) == (__pyx_v_jd2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_jd1->dimensions[0]) == (__pyx_v_jd2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -11288,12 +12094,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNU
  * 
  *     for i in range(n):
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -11301,19 +12107,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNU
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -11364,8 +12170,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNU
   __pyx_r = ((PyObject *)__pyx_v_epd);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1419
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_julian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
+ *                     np.ndarray[double, ndim=1] jd2):
+ *     """ Wrap double eraEpj(double dj1, double dj2)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -11392,16 +12205,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_50jd_julian_epoch(CYTHON_UNU
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1450
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def julian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
+ *     """ Wrap void eraEpj2jd(double epj, double *djm0, double *djm)
+ *     **  Julian Epoch to Julian Date.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_53julian_epoch_jd(PyObject *__pyx_self, PyObject *__pyx_v_epd); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_52julian_epoch_jd[] = " Wrap void eraEpj2jd(double epj, double *djm0, double *djm)\n    **  Julian Epoch to Julian Date.\n    **  Given:\n    **     epj      double    Julian Epoch (e.g. 1996.8D0)\n    **\n    **  Returned:\n    **     djm0     double    MJD zero-point: always 2400000.5\n    **     djm      double    Modified Julian Date\n    ";
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_53julian_epoch_jd = {__Pyx_NAMESTR("julian_epoch_jd"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_53julian_epoch_jd, METH_O, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_52julian_epoch_jd)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_53julian_epoch_jd = {"julian_epoch_jd", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_53julian_epoch_jd, METH_O, __pyx_doc_7astropy_4time_9erfa_time_52julian_epoch_jd};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_53julian_epoch_jd(PyObject *__pyx_self, PyObject *__pyx_v_epd) {
+  CYTHON_UNUSED int __pyx_lineno = 0;
+  CYTHON_UNUSED const char *__pyx_filename = NULL;
+  CYTHON_UNUSED int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("julian_epoch_jd (wrapper)", 0);
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_epd), __pyx_ptype_5numpy_ndarray, 1, "epd", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(__pyx_self, ((PyArrayObject *)__pyx_v_epd));
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -11410,14 +12236,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_53julian_epoch_jd(PyObject *
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1450
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def julian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
- *     """ Wrap void eraEpj2jd(double epj, double *djm0, double *djm)
- *     **  Julian Epoch to Julian Date.
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_epd) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -11481,12 +12299,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
  *     cdef np.ndarray[double, ndim=1] jd2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -11494,19 +12312,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -11528,12 +12346,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -11541,19 +12359,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -11608,12 +12426,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
   __Pyx_INCREF(((PyObject *)__pyx_v_jd2));
   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_jd2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_jd2));
-  __pyx_r = ((PyObject *)__pyx_t_4);
+  __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1450
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def julian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
+ *     """ Wrap void eraEpj2jd(double epj, double *djm0, double *djm)
+ *     **  Julian Epoch to Julian Date.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -11641,18 +12466,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_52julian_epoch_jd(CYTHON_UNU
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1472
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_besselian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
+ *                        np.ndarray[double, ndim=1] jd2):
+ *     """ Wrap double eraEpb(double dj1, double dj2)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_54jd_besselian_epoch[] = " Wrap double eraEpb(double dj1, double dj2)\n    **  Julian Date to Besselian Epoch.\n\n    **  Given:\n    **     dj1,dj2    double     Julian Date (see note)\n    **\n    **  Returned (function value):\n    **                double     Besselian Epoch.\n    **\n    **  Note:\n    **\n    **     The Julian Date is supplied in two pieces, in the usual ERFA\n    **     manner, which is designed to preserve time reso [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_55jd_besselian_epoch = {__Pyx_NAMESTR("jd_besselian_epoch"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_54jd_besselian_epoch)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_55jd_besselian_epoch = {"jd_besselian_epoch", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_54jd_besselian_epoch};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_jd1 = 0;
   PyArrayObject *__pyx_v_jd2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("jd_besselian_epoch (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__jd1,&__pyx_n_s__jd2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jd1,&__pyx_n_s_jd2,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -11666,10 +12502,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch(PyObjec
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__jd1)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jd1)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__jd2)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jd2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("jd_besselian_epoch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -11697,6 +12533,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch(PyObjec
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jd1), __pyx_ptype_5numpy_ndarray, 1, "jd1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jd2), __pyx_ptype_5numpy_ndarray, 1, "jd2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(__pyx_self, __pyx_v_jd1, __pyx_v_jd2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -11705,14 +12543,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_55jd_besselian_epoch(PyObjec
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1472
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def jd_besselian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
- *                        np.ndarray[double, ndim=1] jd2):
- *     """ Wrap double eraEpb(double dj1, double dj2)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_jd1, PyArrayObject *__pyx_v_jd2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -11771,9 +12601,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_jd1->dimensions[0]) == (__pyx_v_jd2->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_jd1->dimensions[0]) == (__pyx_v_jd2->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -11793,12 +12625,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_
  * 
  *     for i in range(n):
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -11806,19 +12638,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -11869,8 +12701,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_
   __pyx_r = ((PyObject *)__pyx_v_epd);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1472
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def jd_besselian_epoch(np.ndarray[double, ndim=1] jd1,             # <<<<<<<<<<<<<<
+ *                        np.ndarray[double, ndim=1] jd2):
+ *     """ Wrap double eraEpb(double dj1, double dj2)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -11897,16 +12736,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_54jd_besselian_epoch(CYTHON_
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1503
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def besselian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
+ *     """ Wrap void eraEpb2jd(double epj, double *djm0, double *djm)
+ *     **  Besselian Epoch to Julian Date.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_57besselian_epoch_jd(PyObject *__pyx_self, PyObject *__pyx_v_epd); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_56besselian_epoch_jd[] = " Wrap void eraEpb2jd(double epj, double *djm0, double *djm)\n    **  Besselian Epoch to Julian Date.\n\n    **  Given:\n    **     epb      double    Besselian Epoch (e.g. 1957.3D0)\n    **\n    **  Returned:\n    **     djm0     double    MJD zero-point: always 2400000.5\n    **     djm      double    Modified Julian Date\n    **\n    **  Note:\n    **\n    **     The Julian Date is returned in two pieces, in the  [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_57besselian_epoch_jd = {__Pyx_NAMESTR("besselian_epoch_jd"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_57besselian_epoch_jd, METH_O, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_56besselian_epoch_jd)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_57besselian_epoch_jd = {"besselian_epoch_jd", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_57besselian_epoch_jd, METH_O, __pyx_doc_7astropy_4time_9erfa_time_56besselian_epoch_jd};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_57besselian_epoch_jd(PyObject *__pyx_self, PyObject *__pyx_v_epd) {
+  CYTHON_UNUSED int __pyx_lineno = 0;
+  CYTHON_UNUSED const char *__pyx_filename = NULL;
+  CYTHON_UNUSED int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("besselian_epoch_jd (wrapper)", 0);
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_epd), __pyx_ptype_5numpy_ndarray, 1, "epd", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(__pyx_self, ((PyArrayObject *)__pyx_v_epd));
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -11915,14 +12767,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_57besselian_epoch_jd(PyObjec
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1503
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def besselian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
- *     """ Wrap void eraEpb2jd(double epj, double *djm0, double *djm)
- *     **  Besselian Epoch to Julian Date.
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_epd) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -11986,12 +12830,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
  *     cdef np.ndarray[double, ndim=1] jd2 = np.empty(n, dtype=np.double)
  * 
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -11999,19 +12843,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -12033,12 +12877,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
  * 
  *     for i in range(n):
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -12046,19 +12890,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
   {
@@ -12113,12 +12957,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
   __Pyx_INCREF(((PyObject *)__pyx_v_jd2));
   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_jd2));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_jd2));
-  __pyx_r = ((PyObject *)__pyx_t_4);
+  __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1503
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def besselian_epoch_jd(np.ndarray[double, ndim=1] epd):             # <<<<<<<<<<<<<<
+ *     """ Wrap void eraEpb2jd(double epj, double *djm0, double *djm)
+ *     **  Besselian Epoch to Julian Date.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -12146,20 +12997,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_56besselian_epoch_jd(CYTHON_
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1532
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst00(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_59gmst00(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_58gmst00[] = "Wrap double eraGmst00(double uta, double utb, double tta, double ttb)\n    **  Greenwich mean sidereal time (model consistent with IAU 2000\n    **  resolutions).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **     tta,ttb    double    TT as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich mean sidere [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_59gmst00 = {__Pyx_NAMESTR("gmst00"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_59gmst00, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_58gmst00)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_59gmst00 = {"gmst00", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_59gmst00, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_58gmst00};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_59gmst00(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
   PyArrayObject *__pyx_v_tt1 = 0;
   PyArrayObject *__pyx_v_tt2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gmst00 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,&__pyx_n_s__tt1,&__pyx_n_s__tt2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,&__pyx_n_s_tt1,&__pyx_n_s_tt2,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -12175,20 +13037,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_59gmst00(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst00", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt1)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt1)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst00", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt2)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst00", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -12222,6 +13084,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_59gmst00(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt1), __pyx_ptype_5numpy_ndarray, 1, "tt1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt2), __pyx_ptype_5numpy_ndarray, 1, "tt2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_58gmst00(__pyx_self, __pyx_v_ut11, __pyx_v_ut12, __pyx_v_tt1, __pyx_v_tt2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -12230,14 +13094,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_59gmst00(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1532
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gmst00(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *            np.ndarray[double, ndim=1] ut12,
- *            np.ndarray[double, ndim=1] tt1,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12, PyArrayObject *__pyx_v_tt1, PyArrayObject *__pyx_v_tt2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -12321,16 +13177,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
     if (__pyx_t_1) {
-      __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+      if (__pyx_t_1) {
+        __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      }
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   #endif
 
@@ -12350,12 +13208,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -12363,19 +13221,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -12428,8 +13286,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gmst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1532
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst00(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -12460,20 +13325,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_58gmst00(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1614
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst06(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_61gmst06(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_60gmst06[] = "Wrap double eraGmst06(double uta, double utb, double tta, double ttb)\n    **  Greenwich mean sidereal time (consistent with IAU 2006 precession).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **     tta,ttb    double    TT as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich mean sidereal time (radians [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_61gmst06 = {__Pyx_NAMESTR("gmst06"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_61gmst06, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_60gmst06)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_61gmst06 = {"gmst06", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_61gmst06, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_60gmst06};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_61gmst06(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
   PyArrayObject *__pyx_v_tt1 = 0;
   PyArrayObject *__pyx_v_tt2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gmst06 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,&__pyx_n_s__tt1,&__pyx_n_s__tt2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,&__pyx_n_s_tt1,&__pyx_n_s_tt2,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -12489,20 +13365,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_61gmst06(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst06", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt1)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt1)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst06", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt2)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst06", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -12536,6 +13412,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_61gmst06(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt1), __pyx_ptype_5numpy_ndarray, 1, "tt1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt2), __pyx_ptype_5numpy_ndarray, 1, "tt2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_60gmst06(__pyx_self, __pyx_v_ut11, __pyx_v_ut12, __pyx_v_tt1, __pyx_v_tt2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -12544,14 +13422,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_61gmst06(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1614
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gmst06(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *            np.ndarray[double, ndim=1] ut12,
- *            np.ndarray[double, ndim=1] tt1,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12, PyArrayObject *__pyx_v_tt1, PyArrayObject *__pyx_v_tt2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -12635,16 +13505,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
     if (__pyx_t_1) {
-      __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+      if (__pyx_t_1) {
+        __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      }
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   #endif
 
@@ -12664,12 +13536,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -12677,19 +13549,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -12742,8 +13614,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gmst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1614
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst06(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -12774,18 +13653,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_60gmst06(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1683
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst82(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double double eraGmst82(double dj1, double dj2)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_63gmst82(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_62gmst82[] = "Wrap double double eraGmst82(double dj1, double dj2)\n    **  Universal Time to Greenwich mean sidereal time (IAU 1982 model).\n    **\n    **  Given:\n    **     dj1,dj2    double    UT1 Julian Date (see note)\n    **\n    **  Returned (function value):\n    **                double    Greenwich mean sidereal time (radians)\n    **\n    **  Notes:\n    **\n    **  1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any\n [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_63gmst82 = {__Pyx_NAMESTR("gmst82"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_63gmst82, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_62gmst82)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_63gmst82 = {"gmst82", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_63gmst82, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_62gmst82};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_63gmst82(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gmst82 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -12799,10 +13689,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_63gmst82(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gmst82", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -12830,6 +13720,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_63gmst82(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut11), __pyx_ptype_5numpy_ndarray, 1, "ut11", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut12), __pyx_ptype_5numpy_ndarray, 1, "ut12", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_62gmst82(__pyx_self, __pyx_v_ut11, __pyx_v_ut12);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -12838,14 +13730,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_63gmst82(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1683
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gmst82(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *            np.ndarray[double, ndim=1] ut12):
- *     """Wrap double double eraGmst82(double dj1, double dj2)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -12904,9 +13788,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -12926,12 +13812,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -12939,19 +13825,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -13002,8 +13888,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gmst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1683
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gmst82(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double double eraGmst82(double dj1, double dj2)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -13030,20 +13923,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_62gmst82(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1752
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst00a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_65gst00a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_64gst00a[] = "Wrap double eraGst00a(double uta, double utb, double tta, double ttb)\n    **  Greenwich apparent sidereal time (consistent with IAU 2000\n    **  resolutions).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **     tta,ttb    double    TT as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich apparent side [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_65gst00a = {__Pyx_NAMESTR("gst00a"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_65gst00a, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_64gst00a)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_65gst00a = {"gst00a", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_65gst00a, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_64gst00a};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_65gst00a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
   PyArrayObject *__pyx_v_tt1 = 0;
   PyArrayObject *__pyx_v_tt2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gst00a (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,&__pyx_n_s__tt1,&__pyx_n_s__tt2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,&__pyx_n_s_tt1,&__pyx_n_s_tt2,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -13059,20 +13963,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_65gst00a(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst00a", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt1)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt1)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst00a", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt2)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst00a", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -13106,6 +14010,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_65gst00a(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt1), __pyx_ptype_5numpy_ndarray, 1, "tt1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt2), __pyx_ptype_5numpy_ndarray, 1, "tt2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_64gst00a(__pyx_self, __pyx_v_ut11, __pyx_v_ut12, __pyx_v_tt1, __pyx_v_tt2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -13114,14 +14020,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_65gst00a(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1752
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gst00a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *            np.ndarray[double, ndim=1] ut12,
- *            np.ndarray[double, ndim=1] tt1,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12, PyArrayObject *__pyx_v_tt1, PyArrayObject *__pyx_v_tt2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -13205,16 +14103,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
     if (__pyx_t_1) {
-      __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+      if (__pyx_t_1) {
+        __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      }
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   #endif
 
@@ -13234,12 +14134,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -13247,19 +14147,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -13312,8 +14212,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1752
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst00a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -13344,18 +14251,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_64gst00a(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1832
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst00b(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *             np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double eraGst00b(double uta, double utb)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_67gst00b(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_66gst00b[] = "Wrap double eraGst00b(double uta, double utb)\n    **  Greenwich apparent sidereal time (consistent with IAU 2000\n    **  resolutions but using the truncated nutation model IAU 2000B).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich apparent sidereal time (radians)\n    **\n    **  Notes:\n   [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_67gst00b = {__Pyx_NAMESTR("gst00b"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_67gst00b, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_66gst00b)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_67gst00b = {"gst00b", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_67gst00b, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_66gst00b};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_67gst00b(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gst00b (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -13369,10 +14287,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_67gst00b(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst00b", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -13400,6 +14318,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_67gst00b(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut11), __pyx_ptype_5numpy_ndarray, 1, "ut11", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut12), __pyx_ptype_5numpy_ndarray, 1, "ut12", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_66gst00b(__pyx_self, __pyx_v_ut11, __pyx_v_ut12);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -13408,14 +14328,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_67gst00b(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1832
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gst00b(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *             np.ndarray[double, ndim=1] ut12):
- *     """Wrap double eraGst00b(double uta, double utb)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -13474,9 +14386,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -13496,12 +14410,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -13509,19 +14423,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -13572,8 +14486,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1832
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst00b(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *             np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double eraGst00b(double uta, double utb)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -13600,20 +14521,31 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_66gst00b(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1918
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst06a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_69gst06a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_68gst06a[] = "Wrap double eraGst06a(double uta, double utb, double tta, double ttb)\n    **  Greenwich apparent sidereal time (consistent with IAU 2000 and 2006\n    **  resolutions).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **     tta,ttb    double    TT as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich appa [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_69gst06a = {__Pyx_NAMESTR("gst06a"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_69gst06a, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_68gst06a)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_69gst06a = {"gst06a", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_69gst06a, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_68gst06a};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_69gst06a(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
   PyArrayObject *__pyx_v_tt1 = 0;
   PyArrayObject *__pyx_v_tt2 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gst06a (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,&__pyx_n_s__tt1,&__pyx_n_s__tt2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,&__pyx_n_s_tt1,&__pyx_n_s_tt2,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -13629,20 +14561,20 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_69gst06a(PyObject *__pyx_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst06a", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt1)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt1)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst06a", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tt2)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tt2)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst06a", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -13676,6 +14608,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_69gst06a(PyObject *__pyx_sel
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt1), __pyx_ptype_5numpy_ndarray, 1, "tt1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tt2), __pyx_ptype_5numpy_ndarray, 1, "tt2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_68gst06a(__pyx_self, __pyx_v_ut11, __pyx_v_ut12, __pyx_v_tt1, __pyx_v_tt2);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -13684,14 +14618,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_69gst06a(PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1918
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gst06a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *            np.ndarray[double, ndim=1] ut12,
- *            np.ndarray[double, ndim=1] tt1,
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12, PyArrayObject *__pyx_v_tt1, PyArrayObject *__pyx_v_tt2) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -13775,16 +14701,18 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
-  if (__pyx_t_1) {
-    __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = ((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0]));
     if (__pyx_t_1) {
-      __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      __pyx_t_1 = ((__pyx_v_ut12->dimensions[0]) == (__pyx_v_tt1->dimensions[0]));
+      if (__pyx_t_1) {
+        __pyx_t_1 = ((__pyx_v_tt1->dimensions[0]) == (__pyx_v_tt2->dimensions[0]));
+      }
+    }
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-  }
-  if (unlikely(!__pyx_t_1)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   #endif
 
@@ -13804,12 +14732,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
  * 
  *     for i in range(n):
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
@@ -13817,19 +14745,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
   {
@@ -13882,8 +14810,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
   __pyx_r = ((PyObject *)__pyx_v_gst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1918
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst06a(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *            np.ndarray[double, ndim=1] ut12,
+ *            np.ndarray[double, ndim=1] tt1,
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -13914,18 +14849,29 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_68gst06a(CYTHON_UNUSED PyObj
   return __pyx_r;
 }
 
+/* "astropy/time/erfa_time.pyx":1989
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst94(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *           np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double eraGst94(double uta, double utb)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_71gst94(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_7astropy_4time_9erfa_time_70gst94[] = "Wrap double eraGst94(double uta, double utb)\n    **  Greenwich apparent sidereal time (consistent with IAU 1982/94\n    **  resolutions).\n    **\n    **  Given:\n    **     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)\n    **\n    **  Returned (function value):\n    **                double    Greenwich apparent sidereal time (radians)\n    **\n    **  Notes:\n    **\n    **  1) The UT1 date uta+utb is a Julia [...]
-static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_71gst94 = {__Pyx_NAMESTR("gst94"), (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_71gst94, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7astropy_4time_9erfa_time_70gst94)};
+static PyMethodDef __pyx_mdef_7astropy_4time_9erfa_time_71gst94 = {"gst94", (PyCFunction)__pyx_pw_7astropy_4time_9erfa_time_71gst94, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7astropy_4time_9erfa_time_70gst94};
 static PyObject *__pyx_pw_7astropy_4time_9erfa_time_71gst94(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_ut11 = 0;
   PyArrayObject *__pyx_v_ut12 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gst94 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ut11,&__pyx_n_s__ut12,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ut11,&__pyx_n_s_ut12,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -13939,10 +14885,10 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_71gst94(PyObject *__pyx_self
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut11)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut11)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ut12)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ut12)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("gst94", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -13970,6 +14916,8 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_71gst94(PyObject *__pyx_self
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut11), __pyx_ptype_5numpy_ndarray, 1, "ut11", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ut12), __pyx_ptype_5numpy_ndarray, 1, "ut12", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_7astropy_4time_9erfa_time_70gst94(__pyx_self, __pyx_v_ut11, __pyx_v_ut12);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -13978,14 +14926,6 @@ static PyObject *__pyx_pw_7astropy_4time_9erfa_time_71gst94(PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "astropy/time/erfa_time.pyx":1989
- * @cython.wraparound(False)
- * @cython.boundscheck(False)
- * def gst94(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
- *           np.ndarray[double, ndim=1] ut12):
- *     """Wrap double eraGst94(double uta, double utb)
- */
-
 static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ut11, PyArrayObject *__pyx_v_ut12) {
   unsigned int __pyx_v_n;
   unsigned int __pyx_v_i;
@@ -14044,9 +14984,11 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObje
  *     cdef unsigned int i
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])))) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!(((__pyx_v_ut11->dimensions[0]) == (__pyx_v_ut12->dimensions[0])) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
   #endif
 
@@ -14066,12 +15008,12 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObje
  * 
  *     for i in range(n):
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
@@ -14079,19 +15021,19 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObje
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
@@ -14140,8 +15082,15 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObje
   __pyx_r = ((PyObject *)__pyx_v_gst);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "astropy/time/erfa_time.pyx":1989
+ * @cython.wraparound(False)
+ * @cython.boundscheck(False)
+ * def gst94(np.ndarray[double, ndim=1] ut11,             # <<<<<<<<<<<<<<
+ *           np.ndarray[double, ndim=1] ut12):
+ *     """Wrap double eraGst94(double uta, double utb)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -14168,6 +15117,14 @@ static PyObject *__pyx_pf_7astropy_4time_9erfa_time_70gst94(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -14175,18 +15132,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -14202,13 +15153,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -14218,22 +15167,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
  * 
  *             cdef int copy_shape, i, ndim
  */
-  __pyx_t_1 = (__pyx_v_info == NULL);
+  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -14242,7 +15189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -14251,7 +15198,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -14260,17 +15207,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 copy_shape = 1
  *             else:
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -14282,7 +15229,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -14293,87 +15240,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
-  if (__pyx_t_1) {
-
-    /* "numpy.pxd":214
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
+
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -14382,7 +15329,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -14391,16 +15338,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  if (__pyx_v_copy_shape) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -14409,7 +15357,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -14418,18 +15366,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -14438,7 +15386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -14447,11 +15395,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -14460,7 +15408,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -14469,9 +15417,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -14480,7 +15428,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -14489,16 +15437,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
+  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -14507,19 +15455,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -14528,23 +15476,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  __pyx_t_2 = (!__pyx_v_hasfields);
+  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = (!__pyx_v_copy_shape);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -14556,11 +15506,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -14573,328 +15523,304 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  */
-  __pyx_t_1 = (!__pyx_v_hasfields);
+  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
-    if (__pyx_t_1) {
-      __pyx_t_2 = __pyx_v_little_endian;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
 
-      /* "numpy.pxd":256
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
-      if (__pyx_t_1) {
-        __pyx_t_3 = (!__pyx_v_little_endian);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":258
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ *                 elif t == NPY_CDOUBLE:     f = "Zd"
+ *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
+ *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+    switch (__pyx_v_t) {
+
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__b;
-      goto __pyx_L13;
-    }
+      case NPY_BYTE:
+      __pyx_v_f = __pyx_k_b;
+      break;
 
-    /* "numpy.pxd":259
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__B;
-      goto __pyx_L13;
-    }
+      case NPY_UBYTE:
+      __pyx_v_f = __pyx_k_B;
+      break;
 
-    /* "numpy.pxd":260
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__h;
-      goto __pyx_L13;
-    }
+      case NPY_SHORT:
+      __pyx_v_f = __pyx_k_h;
+      break;
 
-    /* "numpy.pxd":261
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__H;
-      goto __pyx_L13;
-    }
+      case NPY_USHORT:
+      __pyx_v_f = __pyx_k_H;
+      break;
 
-    /* "numpy.pxd":262
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_INT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__i;
-      goto __pyx_L13;
-    }
+      case NPY_INT:
+      __pyx_v_f = __pyx_k_i;
+      break;
 
-    /* "numpy.pxd":263
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__I;
-      goto __pyx_L13;
-    }
+      case NPY_UINT:
+      __pyx_v_f = __pyx_k_I;
+      break;
 
-    /* "numpy.pxd":264
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__l;
-      goto __pyx_L13;
-    }
+      case NPY_LONG:
+      __pyx_v_f = __pyx_k_l;
+      break;
 
-    /* "numpy.pxd":265
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__L;
-      goto __pyx_L13;
-    }
+      case NPY_ULONG:
+      __pyx_v_f = __pyx_k_L;
+      break;
 
-    /* "numpy.pxd":266
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__q;
-      goto __pyx_L13;
-    }
+      case NPY_LONGLONG:
+      __pyx_v_f = __pyx_k_q;
+      break;
 
-    /* "numpy.pxd":267
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L13;
-    }
+      case NPY_ULONGLONG:
+      __pyx_v_f = __pyx_k_Q;
+      break;
 
-    /* "numpy.pxd":268
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__f;
-      goto __pyx_L13;
-    }
+      case NPY_FLOAT:
+      __pyx_v_f = __pyx_k_f;
+      break;
 
-    /* "numpy.pxd":269
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__d;
-      goto __pyx_L13;
-    }
+      case NPY_DOUBLE:
+      __pyx_v_f = __pyx_k_d;
+      break;
 
-    /* "numpy.pxd":270
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__g;
-      goto __pyx_L13;
-    }
+      case NPY_LONGDOUBLE:
+      __pyx_v_f = __pyx_k_g;
+      break;
 
-    /* "numpy.pxd":271
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L13;
-    }
+      case NPY_CFLOAT:
+      __pyx_v_f = __pyx_k_Zf;
+      break;
 
-    /* "numpy.pxd":272
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L13;
-    }
+      case NPY_CDOUBLE:
+      __pyx_v_f = __pyx_k_Zd;
+      break;
 
-    /* "numpy.pxd":273
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L13;
-    }
+      case NPY_CLONGDOUBLE:
+      __pyx_v_f = __pyx_k_Zg;
+      break;
 
-    /* "numpy.pxd":274
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
-    if (__pyx_t_1) {
-      __pyx_v_f = __pyx_k__O;
-      goto __pyx_L13;
-    }
-    /*else*/ {
+      case NPY_OBJECT:
+      __pyx_v_f = __pyx_k_O;
+      break;
+      default:
 
-      /* "numpy.pxd":276
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_32), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      break;
     }
-    __pyx_L13:;
 
-    /* "numpy.pxd":277
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -14903,7 +15829,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -14912,11 +15838,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -14925,7 +15850,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -14934,7 +15859,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -14943,17 +15868,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -14962,13 +15887,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -14987,39 +15920,41 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
+  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -15031,17 +15966,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.strides)
  *                 # info.shape was stored after info.strides in the same block
  */
-  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -15053,10 +15988,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -15073,7 +16017,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -15087,8 +16031,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -15099,7 +16050,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -15116,7 +16067,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -15130,8 +16081,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -15142,7 +16100,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -15159,7 +16117,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -15173,8 +16131,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -15185,7 +16150,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -15202,7 +16167,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -15216,8 +16181,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -15228,7 +16200,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -15245,7 +16217,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -15259,8 +16231,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -15271,7 +16250,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -15293,20 +16272,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -15315,7 +16291,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -15324,18 +16300,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -15343,33 +16319,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -15391,129 +16365,99 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_7) {
-      __pyx_t_8 = __pyx_v_little_endian;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
     } else {
-      __pyx_t_8 = __pyx_t_7;
     }
-    if (!__pyx_t_8) {
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
+    } else {
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
+    }
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_7) {
-        __pyx_t_9 = (!__pyx_v_little_endian);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -15521,15 +16465,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -15538,7 +16482,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -15547,413 +16491,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_32), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -15961,25 +16902,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -15989,13 +16938,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -16008,7 +16963,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -16020,9 +16975,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -16030,9 +16986,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  *      else:
  */
   __pyx_t_1 = (__pyx_v_base == Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -16044,7 +17001,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -16053,7 +17010,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -16064,7 +17021,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -16073,7 +17030,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -16082,10 +17039,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -16099,17 +17065,17 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
  *         return None
  *     else:
  */
-  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -16120,11 +17086,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -16134,9 +17099,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -16154,7 +17126,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("erfa_time"),
+    "erfa_time",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -16166,173 +17138,174 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
-  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
-  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 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_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
-  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
-  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
-  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 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_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
-  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
-  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
-  {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
-  {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
-  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
-  {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
-  {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
-  {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
-  {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
-  {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
-  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
-  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
-  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
-  {&__pyx_n_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 1},
-  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
-  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
-  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
-  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
-  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
-  {&__pyx_n_s__AstropyUserWarning, __pyx_k__AstropyUserWarning, sizeof(__pyx_k__AstropyUserWarning), 0, 0, 1, 1},
-  {&__pyx_n_s__DUBIOUS, __pyx_k__DUBIOUS, sizeof(__pyx_k__DUBIOUS), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__asec, __pyx_k__asec, sizeof(__pyx_k__asec), 0, 0, 1, 1},
-  {&__pyx_n_s__besselian_epoch_jd, __pyx_k__besselian_epoch_jd, sizeof(__pyx_k__besselian_epoch_jd), 0, 0, 1, 1},
-  {&__pyx_n_s__cal2jd, __pyx_k__cal2jd, sizeof(__pyx_k__cal2jd), 0, 0, 1, 1},
-  {&__pyx_n_s__check_return, __pyx_k__check_return, sizeof(__pyx_k__check_return), 0, 0, 1, 1},
-  {&__pyx_n_s__d1, __pyx_k__d1, sizeof(__pyx_k__d1), 0, 0, 1, 1},
-  {&__pyx_n_s__d2, __pyx_k__d2, sizeof(__pyx_k__d2), 0, 0, 1, 1},
-  {&__pyx_n_s__d_tai_utc, __pyx_k__d_tai_utc, sizeof(__pyx_k__d_tai_utc), 0, 0, 1, 1},
-  {&__pyx_n_s__d_tdb_tt, __pyx_k__d_tdb_tt, sizeof(__pyx_k__d_tdb_tt), 0, 0, 1, 1},
-  {&__pyx_n_s__djm, __pyx_k__djm, sizeof(__pyx_k__djm), 0, 0, 1, 1},
-  {&__pyx_n_s__djm0, __pyx_k__djm0, sizeof(__pyx_k__djm0), 0, 0, 1, 1},
-  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
-  {&__pyx_n_s__dt, __pyx_k__dt, sizeof(__pyx_k__dt), 0, 0, 1, 1},
-  {&__pyx_n_s__dtf_jd, __pyx_k__dtf_jd, sizeof(__pyx_k__dtf_jd), 0, 0, 1, 1},
-  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
-  {&__pyx_n_s__elong, __pyx_k__elong, sizeof(__pyx_k__elong), 0, 0, 1, 1},
-  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
-  {&__pyx_n_s__epd, __pyx_k__epd, sizeof(__pyx_k__epd), 0, 0, 1, 1},
-  {&__pyx_n_s__eraAf2a, __pyx_k__eraAf2a, sizeof(__pyx_k__eraAf2a), 0, 0, 1, 1},
-  {&__pyx_n_s__eraCal2jd, __pyx_k__eraCal2jd, sizeof(__pyx_k__eraCal2jd), 0, 0, 1, 1},
-  {&__pyx_n_s__eraD2dtf, __pyx_k__eraD2dtf, sizeof(__pyx_k__eraD2dtf), 0, 0, 1, 1},
-  {&__pyx_n_s__eraDat, __pyx_k__eraDat, sizeof(__pyx_k__eraDat), 0, 0, 1, 1},
-  {&__pyx_n_s__eraDtf2d, __pyx_k__eraDtf2d, sizeof(__pyx_k__eraDtf2d), 0, 0, 1, 1},
-  {&__pyx_n_s__eraGd2gc, __pyx_k__eraGd2gc, sizeof(__pyx_k__eraGd2gc), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTaitt, __pyx_k__eraTaitt, sizeof(__pyx_k__eraTaitt), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTaiut1, __pyx_k__eraTaiut1, sizeof(__pyx_k__eraTaiut1), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTaiutc, __pyx_k__eraTaiutc, sizeof(__pyx_k__eraTaiutc), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTcbtdb, __pyx_k__eraTcbtdb, sizeof(__pyx_k__eraTcbtdb), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTcgtt, __pyx_k__eraTcgtt, sizeof(__pyx_k__eraTcgtt), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTdbtcb, __pyx_k__eraTdbtcb, sizeof(__pyx_k__eraTdbtcb), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTdbtt, __pyx_k__eraTdbtt, sizeof(__pyx_k__eraTdbtt), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTttai, __pyx_k__eraTttai, sizeof(__pyx_k__eraTttai), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTttcg, __pyx_k__eraTttcg, sizeof(__pyx_k__eraTttcg), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTttdb, __pyx_k__eraTttdb, sizeof(__pyx_k__eraTttdb), 0, 0, 1, 1},
-  {&__pyx_n_s__eraTtut1, __pyx_k__eraTtut1, sizeof(__pyx_k__eraTtut1), 0, 0, 1, 1},
-  {&__pyx_n_s__eraUt1tai, __pyx_k__eraUt1tai, sizeof(__pyx_k__eraUt1tai), 0, 0, 1, 1},
-  {&__pyx_n_s__eraUt1tt, __pyx_k__eraUt1tt, sizeof(__pyx_k__eraUt1tt), 0, 0, 1, 1},
-  {&__pyx_n_s__eraUt1utc, __pyx_k__eraUt1utc, sizeof(__pyx_k__eraUt1utc), 0, 0, 1, 1},
-  {&__pyx_n_s__eraUtctai, __pyx_k__eraUtctai, sizeof(__pyx_k__eraUtctai), 0, 0, 1, 1},
-  {&__pyx_n_s__eraUtcut1, __pyx_k__eraUtcut1, sizeof(__pyx_k__eraUtcut1), 0, 0, 1, 1},
-  {&__pyx_n_s__era_af2a, __pyx_k__era_af2a, sizeof(__pyx_k__era_af2a), 0, 0, 1, 1},
-  {&__pyx_n_s__era_gc2gd, __pyx_k__era_gc2gd, sizeof(__pyx_k__era_gc2gd), 0, 0, 1, 1},
-  {&__pyx_n_s__era_gd2gc, __pyx_k__era_gd2gc, sizeof(__pyx_k__era_gd2gc), 0, 0, 1, 1},
-  {&__pyx_n_s__errors, __pyx_k__errors, sizeof(__pyx_k__errors), 0, 0, 1, 1},
-  {&__pyx_n_s__errs, __pyx_k__errs, sizeof(__pyx_k__errs), 0, 0, 1, 1},
-  {&__pyx_n_s__fd, __pyx_k__fd, sizeof(__pyx_k__fd), 0, 0, 1, 1},
-  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
-  {&__pyx_n_s__func_name, __pyx_k__func_name, sizeof(__pyx_k__func_name), 0, 0, 1, 1},
-  {&__pyx_n_s__gmst, __pyx_k__gmst, sizeof(__pyx_k__gmst), 0, 0, 1, 1},
-  {&__pyx_n_s__gmst00, __pyx_k__gmst00, sizeof(__pyx_k__gmst00), 0, 0, 1, 1},
-  {&__pyx_n_s__gmst06, __pyx_k__gmst06, sizeof(__pyx_k__gmst06), 0, 0, 1, 1},
-  {&__pyx_n_s__gmst82, __pyx_k__gmst82, sizeof(__pyx_k__gmst82), 0, 0, 1, 1},
-  {&__pyx_n_s__gst, __pyx_k__gst, sizeof(__pyx_k__gst), 0, 0, 1, 1},
-  {&__pyx_n_s__gst00a, __pyx_k__gst00a, sizeof(__pyx_k__gst00a), 0, 0, 1, 1},
-  {&__pyx_n_s__gst00b, __pyx_k__gst00b, sizeof(__pyx_k__gst00b), 0, 0, 1, 1},
-  {&__pyx_n_s__gst06a, __pyx_k__gst06a, sizeof(__pyx_k__gst06a), 0, 0, 1, 1},
-  {&__pyx_n_s__gst94, __pyx_k__gst94, sizeof(__pyx_k__gst94), 0, 0, 1, 1},
-  {&__pyx_n_s__height, __pyx_k__height, sizeof(__pyx_k__height), 0, 0, 1, 1},
-  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
-  {&__pyx_n_s__iamin, __pyx_k__iamin, sizeof(__pyx_k__iamin), 0, 0, 1, 1},
-  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
-  {&__pyx_n_s__ideg, __pyx_k__ideg, sizeof(__pyx_k__ideg), 0, 0, 1, 1},
-  {&__pyx_n_s__ihmsf, __pyx_k__ihmsf, sizeof(__pyx_k__ihmsf), 0, 0, 1, 1},
-  {&__pyx_n_s__ihr, __pyx_k__ihr, sizeof(__pyx_k__ihr), 0, 0, 1, 1},
-  {&__pyx_n_s__im, __pyx_k__im, sizeof(__pyx_k__im), 0, 0, 1, 1},
-  {&__pyx_n_s__imn, __pyx_k__imn, sizeof(__pyx_k__imn), 0, 0, 1, 1},
-  {&__pyx_n_s__in1, __pyx_k__in1, sizeof(__pyx_k__in1), 0, 0, 1, 1},
-  {&__pyx_n_s__in2, __pyx_k__in2, sizeof(__pyx_k__in2), 0, 0, 1, 1},
-  {&__pyx_n_s__intc, __pyx_k__intc, sizeof(__pyx_k__intc), 0, 0, 1, 1},
-  {&__pyx_n_s__iy, __pyx_k__iy, sizeof(__pyx_k__iy), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__jd1, __pyx_k__jd1, sizeof(__pyx_k__jd1), 0, 0, 1, 1},
-  {&__pyx_n_s__jd2, __pyx_k__jd2, sizeof(__pyx_k__jd2), 0, 0, 1, 1},
-  {&__pyx_n_s__jd_besselian_epoch, __pyx_k__jd_besselian_epoch, sizeof(__pyx_k__jd_besselian_epoch), 0, 0, 1, 1},
-  {&__pyx_n_s__jd_dtf, __pyx_k__jd_dtf, sizeof(__pyx_k__jd_dtf), 0, 0, 1, 1},
-  {&__pyx_n_s__jd_julian_epoch, __pyx_k__jd_julian_epoch, sizeof(__pyx_k__jd_julian_epoch), 0, 0, 1, 1},
-  {&__pyx_n_s__julian_epoch_jd, __pyx_k__julian_epoch_jd, sizeof(__pyx_k__julian_epoch_jd), 0, 0, 1, 1},
-  {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
-  {&__pyx_n_s__ndp, __pyx_k__ndp, sizeof(__pyx_k__ndp), 0, 0, 1, 1},
-  {&__pyx_n_s__nitems, __pyx_k__nitems, sizeof(__pyx_k__nitems), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1},
-  {&__pyx_n_s__out, __pyx_k__out, sizeof(__pyx_k__out), 0, 0, 1, 1},
-  {&__pyx_n_s__out1, __pyx_k__out1, sizeof(__pyx_k__out1), 0, 0, 1, 1},
-  {&__pyx_n_s__out2, __pyx_k__out2, sizeof(__pyx_k__out2), 0, 0, 1, 1},
-  {&__pyx_n_s__phi, __pyx_k__phi, sizeof(__pyx_k__phi), 0, 0, 1, 1},
-  {&__pyx_n_s__rad, __pyx_k__rad, sizeof(__pyx_k__rad), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__ret, __pyx_k__ret, sizeof(__pyx_k__ret), 0, 0, 1, 1},
-  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
-  {&__pyx_n_s__scale, __pyx_k__scale, sizeof(__pyx_k__scale), 0, 0, 1, 1},
-  {&__pyx_n_s__sec, __pyx_k__sec, sizeof(__pyx_k__sec), 0, 0, 1, 1},
-  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
-  {&__pyx_n_s__sign, __pyx_k__sign, sizeof(__pyx_k__sign), 0, 0, 1, 1},
-  {&__pyx_n_s__tai_tt, __pyx_k__tai_tt, sizeof(__pyx_k__tai_tt), 0, 0, 1, 1},
-  {&__pyx_n_s__tai_ut1, __pyx_k__tai_ut1, sizeof(__pyx_k__tai_ut1), 0, 0, 1, 1},
-  {&__pyx_n_s__tai_utc, __pyx_k__tai_utc, sizeof(__pyx_k__tai_utc), 0, 0, 1, 1},
-  {&__pyx_n_s__tcb_tdb, __pyx_k__tcb_tdb, sizeof(__pyx_k__tcb_tdb), 0, 0, 1, 1},
-  {&__pyx_n_s__tcg_tt, __pyx_k__tcg_tt, sizeof(__pyx_k__tcg_tt), 0, 0, 1, 1},
-  {&__pyx_n_s__tdb_tcb, __pyx_k__tdb_tcb, sizeof(__pyx_k__tdb_tcb), 0, 0, 1, 1},
-  {&__pyx_n_s__tdb_tt, __pyx_k__tdb_tt, sizeof(__pyx_k__tdb_tt), 0, 0, 1, 1},
-  {&__pyx_n_s__tt1, __pyx_k__tt1, sizeof(__pyx_k__tt1), 0, 0, 1, 1},
-  {&__pyx_n_s__tt2, __pyx_k__tt2, sizeof(__pyx_k__tt2), 0, 0, 1, 1},
-  {&__pyx_n_s__tt_tai, __pyx_k__tt_tai, sizeof(__pyx_k__tt_tai), 0, 0, 1, 1},
-  {&__pyx_n_s__tt_tcg, __pyx_k__tt_tcg, sizeof(__pyx_k__tt_tcg), 0, 0, 1, 1},
-  {&__pyx_n_s__tt_tdb, __pyx_k__tt_tdb, sizeof(__pyx_k__tt_tdb), 0, 0, 1, 1},
-  {&__pyx_n_s__tt_ut1, __pyx_k__tt_ut1, sizeof(__pyx_k__tt_ut1), 0, 0, 1, 1},
-  {&__pyx_n_s__u, __pyx_k__u, sizeof(__pyx_k__u), 0, 0, 1, 1},
-  {&__pyx_n_s__ut, __pyx_k__ut, sizeof(__pyx_k__ut), 0, 0, 1, 1},
-  {&__pyx_n_s__ut11, __pyx_k__ut11, sizeof(__pyx_k__ut11), 0, 0, 1, 1},
-  {&__pyx_n_s__ut12, __pyx_k__ut12, sizeof(__pyx_k__ut12), 0, 0, 1, 1},
-  {&__pyx_n_s__ut1_tai, __pyx_k__ut1_tai, sizeof(__pyx_k__ut1_tai), 0, 0, 1, 1},
-  {&__pyx_n_s__ut1_tt, __pyx_k__ut1_tt, sizeof(__pyx_k__ut1_tt), 0, 0, 1, 1},
-  {&__pyx_n_s__ut1_utc, __pyx_k__ut1_utc, sizeof(__pyx_k__ut1_utc), 0, 0, 1, 1},
-  {&__pyx_n_s__utc_tai, __pyx_k__utc_tai, sizeof(__pyx_k__utc_tai), 0, 0, 1, 1},
-  {&__pyx_n_s__utc_ut1, __pyx_k__utc_ut1, sizeof(__pyx_k__utc_ut1), 0, 0, 1, 1},
-  {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 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__warns, __pyx_k__warns, sizeof(__pyx_k__warns), 0, 0, 1, 1},
-  {&__pyx_n_s__xyz, __pyx_k__xyz, sizeof(__pyx_k__xyz), 0, 0, 1, 1},
-  {&__pyx_n_s__xyz_item, __pyx_k__xyz_item, sizeof(__pyx_k__xyz_item), 0, 0, 1, 1},
+  {&__pyx_kp_s_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 0, 1, 0},
+  {&__pyx_n_s_AstropyUserWarning, __pyx_k_AstropyUserWarning, sizeof(__pyx_k_AstropyUserWarning), 0, 0, 1, 1},
+  {&__pyx_kp_s_Bad_input_day_JD_still_computed, __pyx_k_Bad_input_day_JD_still_computed, sizeof(__pyx_k_Bad_input_day_JD_still_computed), 0, 0, 1, 0},
+  {&__pyx_kp_s_Bad_input_month, __pyx_k_Bad_input_month, sizeof(__pyx_k_Bad_input_month), 0, 0, 1, 0},
+  {&__pyx_kp_s_Bad_input_year, __pyx_k_Bad_input_year, sizeof(__pyx_k_Bad_input_year), 0, 0, 1, 0},
+  {&__pyx_n_s_DUBIOUS, __pyx_k_DUBIOUS, sizeof(__pyx_k_DUBIOUS), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_kp_s_Unexpected_return_code_0_from_1, __pyx_k_Unexpected_return_code_0_from_1, sizeof(__pyx_k_Unexpected_return_code_0_from_1), 0, 0, 1, 0},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s_asec, __pyx_k_asec, sizeof(__pyx_k_asec), 0, 0, 1, 1},
+  {&__pyx_kp_s_asec_outside_range_0_59_999, __pyx_k_asec_outside_range_0_59_999, sizeof(__pyx_k_asec_outside_range_0_59_999), 0, 0, 1, 0},
+  {&__pyx_n_s_astropy_time_erfa_time, __pyx_k_astropy_time_erfa_time, sizeof(__pyx_k_astropy_time_erfa_time), 0, 0, 1, 1},
+  {&__pyx_kp_s_bad_day, __pyx_k_bad_day, sizeof(__pyx_k_bad_day), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_day_must_be_within_normal_ca, __pyx_k_bad_day_must_be_within_normal_ca, sizeof(__pyx_k_bad_day_must_be_within_normal_ca), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_fraction_of_day, __pyx_k_bad_fraction_of_day, sizeof(__pyx_k_bad_fraction_of_day), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_hour, __pyx_k_bad_hour, sizeof(__pyx_k_bad_hour), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_minute, __pyx_k_bad_minute, sizeof(__pyx_k_bad_minute), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_month, __pyx_k_bad_month, sizeof(__pyx_k_bad_month), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_month_must_be_1_to_12, __pyx_k_bad_month_must_be_1_to_12, sizeof(__pyx_k_bad_month_must_be_1_to_12), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_second_0, __pyx_k_bad_second_0, sizeof(__pyx_k_bad_second_0), 0, 0, 1, 0},
+  {&__pyx_kp_s_bad_year, __pyx_k_bad_year, sizeof(__pyx_k_bad_year), 0, 0, 1, 0},
+  {&__pyx_n_s_besselian_epoch_jd, __pyx_k_besselian_epoch_jd, sizeof(__pyx_k_besselian_epoch_jd), 0, 0, 1, 1},
+  {&__pyx_n_s_cal2jd, __pyx_k_cal2jd, sizeof(__pyx_k_cal2jd), 0, 0, 1, 1},
+  {&__pyx_n_s_check_return, __pyx_k_check_return, sizeof(__pyx_k_check_return), 0, 0, 1, 1},
+  {&__pyx_n_s_d1, __pyx_k_d1, sizeof(__pyx_k_d1), 0, 0, 1, 1},
+  {&__pyx_n_s_d2, __pyx_k_d2, sizeof(__pyx_k_d2), 0, 0, 1, 1},
+  {&__pyx_n_s_d_tai_utc, __pyx_k_d_tai_utc, sizeof(__pyx_k_d_tai_utc), 0, 0, 1, 1},
+  {&__pyx_n_s_d_tdb_tt, __pyx_k_d_tdb_tt, sizeof(__pyx_k_d_tdb_tt), 0, 0, 1, 1},
+  {&__pyx_n_s_djm, __pyx_k_djm, sizeof(__pyx_k_djm), 0, 0, 1, 1},
+  {&__pyx_n_s_djm0, __pyx_k_djm0, sizeof(__pyx_k_djm0), 0, 0, 1, 1},
+  {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
+  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
+  {&__pyx_n_s_dtf_jd, __pyx_k_dtf_jd, sizeof(__pyx_k_dtf_jd), 0, 0, 1, 1},
+  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+  {&__pyx_kp_s_dubious_year_for_UTC_before_1960, __pyx_k_dubious_year_for_UTC_before_1960, sizeof(__pyx_k_dubious_year_for_UTC_before_1960), 0, 0, 1, 0},
+  {&__pyx_n_s_elong, __pyx_k_elong, sizeof(__pyx_k_elong), 0, 0, 1, 1},
+  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
+  {&__pyx_n_s_epd, __pyx_k_epd, sizeof(__pyx_k_epd), 0, 0, 1, 1},
+  {&__pyx_n_s_eraAf2a, __pyx_k_eraAf2a, sizeof(__pyx_k_eraAf2a), 0, 0, 1, 1},
+  {&__pyx_n_s_eraCal2jd, __pyx_k_eraCal2jd, sizeof(__pyx_k_eraCal2jd), 0, 0, 1, 1},
+  {&__pyx_n_s_eraD2dtf, __pyx_k_eraD2dtf, sizeof(__pyx_k_eraD2dtf), 0, 0, 1, 1},
+  {&__pyx_n_s_eraDat, __pyx_k_eraDat, sizeof(__pyx_k_eraDat), 0, 0, 1, 1},
+  {&__pyx_n_s_eraDtf2d, __pyx_k_eraDtf2d, sizeof(__pyx_k_eraDtf2d), 0, 0, 1, 1},
+  {&__pyx_n_s_eraGd2gc, __pyx_k_eraGd2gc, sizeof(__pyx_k_eraGd2gc), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTaitt, __pyx_k_eraTaitt, sizeof(__pyx_k_eraTaitt), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTaiut1, __pyx_k_eraTaiut1, sizeof(__pyx_k_eraTaiut1), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTaiutc, __pyx_k_eraTaiutc, sizeof(__pyx_k_eraTaiutc), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTcbtdb, __pyx_k_eraTcbtdb, sizeof(__pyx_k_eraTcbtdb), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTcgtt, __pyx_k_eraTcgtt, sizeof(__pyx_k_eraTcgtt), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTdbtcb, __pyx_k_eraTdbtcb, sizeof(__pyx_k_eraTdbtcb), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTdbtt, __pyx_k_eraTdbtt, sizeof(__pyx_k_eraTdbtt), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTttai, __pyx_k_eraTttai, sizeof(__pyx_k_eraTttai), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTttcg, __pyx_k_eraTttcg, sizeof(__pyx_k_eraTttcg), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTttdb, __pyx_k_eraTttdb, sizeof(__pyx_k_eraTttdb), 0, 0, 1, 1},
+  {&__pyx_n_s_eraTtut1, __pyx_k_eraTtut1, sizeof(__pyx_k_eraTtut1), 0, 0, 1, 1},
+  {&__pyx_n_s_eraUt1tai, __pyx_k_eraUt1tai, sizeof(__pyx_k_eraUt1tai), 0, 0, 1, 1},
+  {&__pyx_n_s_eraUt1tt, __pyx_k_eraUt1tt, sizeof(__pyx_k_eraUt1tt), 0, 0, 1, 1},
+  {&__pyx_n_s_eraUt1utc, __pyx_k_eraUt1utc, sizeof(__pyx_k_eraUt1utc), 0, 0, 1, 1},
+  {&__pyx_n_s_eraUtctai, __pyx_k_eraUtctai, sizeof(__pyx_k_eraUtctai), 0, 0, 1, 1},
+  {&__pyx_n_s_eraUtcut1, __pyx_k_eraUtcut1, sizeof(__pyx_k_eraUtcut1), 0, 0, 1, 1},
+  {&__pyx_n_s_era_af2a, __pyx_k_era_af2a, sizeof(__pyx_k_era_af2a), 0, 0, 1, 1},
+  {&__pyx_n_s_era_gc2gd, __pyx_k_era_gc2gd, sizeof(__pyx_k_era_gc2gd), 0, 0, 1, 1},
+  {&__pyx_n_s_era_gd2gc, __pyx_k_era_gd2gc, sizeof(__pyx_k_era_gd2gc), 0, 0, 1, 1},
+  {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
+  {&__pyx_n_s_errs, __pyx_k_errs, sizeof(__pyx_k_errs), 0, 0, 1, 1},
+  {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
+  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+  {&__pyx_n_s_func_name, __pyx_k_func_name, sizeof(__pyx_k_func_name), 0, 0, 1, 1},
+  {&__pyx_n_s_gmst, __pyx_k_gmst, sizeof(__pyx_k_gmst), 0, 0, 1, 1},
+  {&__pyx_n_s_gmst00, __pyx_k_gmst00, sizeof(__pyx_k_gmst00), 0, 0, 1, 1},
+  {&__pyx_n_s_gmst06, __pyx_k_gmst06, sizeof(__pyx_k_gmst06), 0, 0, 1, 1},
+  {&__pyx_n_s_gmst82, __pyx_k_gmst82, sizeof(__pyx_k_gmst82), 0, 0, 1, 1},
+  {&__pyx_n_s_gst, __pyx_k_gst, sizeof(__pyx_k_gst), 0, 0, 1, 1},
+  {&__pyx_n_s_gst00a, __pyx_k_gst00a, sizeof(__pyx_k_gst00a), 0, 0, 1, 1},
+  {&__pyx_n_s_gst00b, __pyx_k_gst00b, sizeof(__pyx_k_gst00b), 0, 0, 1, 1},
+  {&__pyx_n_s_gst06a, __pyx_k_gst06a, sizeof(__pyx_k_gst06a), 0, 0, 1, 1},
+  {&__pyx_n_s_gst94, __pyx_k_gst94, sizeof(__pyx_k_gst94), 0, 0, 1, 1},
+  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
+  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+  {&__pyx_n_s_iamin, __pyx_k_iamin, sizeof(__pyx_k_iamin), 0, 0, 1, 1},
+  {&__pyx_kp_s_iamin_outside_range_0_59, __pyx_k_iamin_outside_range_0_59, sizeof(__pyx_k_iamin_outside_range_0_59), 0, 0, 1, 0},
+  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+  {&__pyx_n_s_ideg, __pyx_k_ideg, sizeof(__pyx_k_ideg), 0, 0, 1, 1},
+  {&__pyx_kp_s_ideg_outside_range_0_359, __pyx_k_ideg_outside_range_0_359, sizeof(__pyx_k_ideg_outside_range_0_359), 0, 0, 1, 0},
+  {&__pyx_n_s_ihmsf, __pyx_k_ihmsf, sizeof(__pyx_k_ihmsf), 0, 0, 1, 1},
+  {&__pyx_n_s_ihr, __pyx_k_ihr, sizeof(__pyx_k_ihr), 0, 0, 1, 1},
+  {&__pyx_kp_s_illegal_case, __pyx_k_illegal_case, sizeof(__pyx_k_illegal_case), 0, 0, 1, 0},
+  {&__pyx_kp_s_illegal_identifier, __pyx_k_illegal_identifier, sizeof(__pyx_k_illegal_identifier), 0, 0, 1, 0},
+  {&__pyx_n_s_im, __pyx_k_im, sizeof(__pyx_k_im), 0, 0, 1, 1},
+  {&__pyx_n_s_imn, __pyx_k_imn, sizeof(__pyx_k_imn), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_n_s_in1, __pyx_k_in1, sizeof(__pyx_k_in1), 0, 0, 1, 1},
+  {&__pyx_n_s_in2, __pyx_k_in2, sizeof(__pyx_k_in2), 0, 0, 1, 1},
+  {&__pyx_n_s_intc, __pyx_k_intc, sizeof(__pyx_k_intc), 0, 0, 1, 1},
+  {&__pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_k_internal_1_root_src_astropy_ast, sizeof(__pyx_k_internal_1_root_src_astropy_ast), 0, 0, 1, 0},
+  {&__pyx_n_s_iy, __pyx_k_iy, sizeof(__pyx_k_iy), 0, 0, 1, 1},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_jd1, __pyx_k_jd1, sizeof(__pyx_k_jd1), 0, 0, 1, 1},
+  {&__pyx_n_s_jd2, __pyx_k_jd2, sizeof(__pyx_k_jd2), 0, 0, 1, 1},
+  {&__pyx_n_s_jd_besselian_epoch, __pyx_k_jd_besselian_epoch, sizeof(__pyx_k_jd_besselian_epoch), 0, 0, 1, 1},
+  {&__pyx_n_s_jd_dtf, __pyx_k_jd_dtf, sizeof(__pyx_k_jd_dtf), 0, 0, 1, 1},
+  {&__pyx_n_s_jd_julian_epoch, __pyx_k_jd_julian_epoch, sizeof(__pyx_k_jd_julian_epoch), 0, 0, 1, 1},
+  {&__pyx_n_s_julian_epoch_jd, __pyx_k_julian_epoch_jd, sizeof(__pyx_k_julian_epoch_jd), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_ndp, __pyx_k_ndp, sizeof(__pyx_k_ndp), 0, 0, 1, 1},
+  {&__pyx_n_s_nitems, __pyx_k_nitems, sizeof(__pyx_k_nitems), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
+  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
+  {&__pyx_n_s_out1, __pyx_k_out1, sizeof(__pyx_k_out1), 0, 0, 1, 1},
+  {&__pyx_n_s_out2, __pyx_k_out2, sizeof(__pyx_k_out2), 0, 0, 1, 1},
+  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
+  {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
+  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
+  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
+  {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1},
+  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+  {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
+  {&__pyx_n_s_tai_tt, __pyx_k_tai_tt, sizeof(__pyx_k_tai_tt), 0, 0, 1, 1},
+  {&__pyx_n_s_tai_ut1, __pyx_k_tai_ut1, sizeof(__pyx_k_tai_ut1), 0, 0, 1, 1},
+  {&__pyx_n_s_tai_utc, __pyx_k_tai_utc, sizeof(__pyx_k_tai_utc), 0, 0, 1, 1},
+  {&__pyx_n_s_tcb_tdb, __pyx_k_tcb_tdb, sizeof(__pyx_k_tcb_tdb), 0, 0, 1, 1},
+  {&__pyx_n_s_tcg_tt, __pyx_k_tcg_tt, sizeof(__pyx_k_tcg_tt), 0, 0, 1, 1},
+  {&__pyx_n_s_tdb_tcb, __pyx_k_tdb_tcb, sizeof(__pyx_k_tdb_tcb), 0, 0, 1, 1},
+  {&__pyx_n_s_tdb_tt, __pyx_k_tdb_tt, sizeof(__pyx_k_tdb_tt), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_kp_s_time_is_after_end_of_day, __pyx_k_time_is_after_end_of_day, sizeof(__pyx_k_time_is_after_end_of_day), 0, 0, 1, 0},
+  {&__pyx_kp_s_time_is_after_end_of_day_and, __pyx_k_time_is_after_end_of_day_and, sizeof(__pyx_k_time_is_after_end_of_day_and), 0, 0, 1, 0},
+  {&__pyx_n_s_tt1, __pyx_k_tt1, sizeof(__pyx_k_tt1), 0, 0, 1, 1},
+  {&__pyx_n_s_tt2, __pyx_k_tt2, sizeof(__pyx_k_tt2), 0, 0, 1, 1},
+  {&__pyx_n_s_tt_tai, __pyx_k_tt_tai, sizeof(__pyx_k_tt_tai), 0, 0, 1, 1},
+  {&__pyx_n_s_tt_tcg, __pyx_k_tt_tcg, sizeof(__pyx_k_tt_tcg), 0, 0, 1, 1},
+  {&__pyx_n_s_tt_tdb, __pyx_k_tt_tdb, sizeof(__pyx_k_tt_tdb), 0, 0, 1, 1},
+  {&__pyx_n_s_tt_ut1, __pyx_k_tt_ut1, sizeof(__pyx_k_tt_ut1), 0, 0, 1, 1},
+  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
+  {&__pyx_kp_s_unacceptable_date, __pyx_k_unacceptable_date, sizeof(__pyx_k_unacceptable_date), 0, 0, 1, 0},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_ut, __pyx_k_ut, sizeof(__pyx_k_ut), 0, 0, 1, 1},
+  {&__pyx_n_s_ut11, __pyx_k_ut11, sizeof(__pyx_k_ut11), 0, 0, 1, 1},
+  {&__pyx_n_s_ut12, __pyx_k_ut12, sizeof(__pyx_k_ut12), 0, 0, 1, 1},
+  {&__pyx_n_s_ut1_tai, __pyx_k_ut1_tai, sizeof(__pyx_k_ut1_tai), 0, 0, 1, 1},
+  {&__pyx_n_s_ut1_tt, __pyx_k_ut1_tt, sizeof(__pyx_k_ut1_tt), 0, 0, 1, 1},
+  {&__pyx_n_s_ut1_utc, __pyx_k_ut1_utc, sizeof(__pyx_k_ut1_utc), 0, 0, 1, 1},
+  {&__pyx_n_s_utc_tai, __pyx_k_utc_tai, sizeof(__pyx_k_utc_tai), 0, 0, 1, 1},
+  {&__pyx_n_s_utc_ut1, __pyx_k_utc_ut1, sizeof(__pyx_k_utc_ut1), 0, 0, 1, 1},
+  {&__pyx_n_s_utils_exceptions, __pyx_k_utils_exceptions, sizeof(__pyx_k_utils_exceptions), 0, 0, 1, 1},
+  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 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_warns, __pyx_k_warns, sizeof(__pyx_k_warns), 0, 0, 1, 1},
+  {&__pyx_n_s_xyz, __pyx_k_xyz, sizeof(__pyx_k_xyz), 0, 0, 1, 1},
+  {&__pyx_n_s_xyz_item, __pyx_k_xyz_item, sizeof(__pyx_k_xyz_item), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -16349,75 +17322,75 @@ static int __Pyx_InitCachedConstants(void) {
  *     cdef np.ndarray[double, ndim=2] out = np.empty((nitems, 3), dtype=np.double)
  * 
  */
-  __pyx_k_tuple_23 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_23);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":215
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_26)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_27);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":219
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_29 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_28)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_29);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":257
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_30)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_31);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "numpy.pxd":799
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_33)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_34);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "numpy.pxd":803
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_35 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_30)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_35);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "numpy.pxd":823
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_37 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_36)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_37);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
   /* "astropy/time/erfa_time.pyx":64
  *           'beyond last known leap second)'
@@ -16426,10 +17399,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """Check the return value from an era routine"""
  *     if ret in warns:
  */
-  __pyx_k_tuple_40 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__func_name), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errors)); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_40);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
-  __pyx_k_codeobj_41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__check_return, 64, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_ret, __pyx_n_s_func_name, __pyx_n_s_warns, __pyx_n_s_errors); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_check_return, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":77
  * @cython.wraparound(False)
@@ -16438,10 +17411,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[int, ndim=1] iy,
  *     np.ndarray[int, ndim=1] im,
  */
-  __pyx_k_tuple_44 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__iy), ((PyObject *)__pyx_n_s__im), ((PyObject *)__pyx_n_s__id), ((PyObject *)__pyx_n_s__djm0), ((PyObject *)__pyx_n_s__djm), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_44);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
-  __pyx_k_codeobj_45 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__cal2jd, 77, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_iy, __pyx_n_s_im, __pyx_n_s_id, __pyx_n_s_djm0, __pyx_n_s_djm, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_cal2jd, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":128
  * @cython.wraparound(False)
@@ -16450,10 +17423,10 @@ static int __Pyx_InitCachedConstants(void) {
  *               np.ndarray[int, ndim=1] im,
  *               np.ndarray[int, ndim=1] id,
  */
-  __pyx_k_tuple_46 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__iy), ((PyObject *)__pyx_n_s__im), ((PyObject *)__pyx_n_s__id), ((PyObject *)__pyx_n_s__fd), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__out), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_46);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
-  __pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__d_tai_utc, 128, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__14 = PyTuple_Pack(10, __pyx_n_s_iy, __pyx_n_s_im, __pyx_n_s_id, __pyx_n_s_fd, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_d_tai_utc, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":226
  * @cython.wraparound(False)
@@ -16462,10 +17435,10 @@ static int __Pyx_InitCachedConstants(void) {
  *               np.ndarray[double, ndim=1] d1,
  *               np.ndarray[double, ndim=1] d2):
  */
-  __pyx_k_tuple_48 = PyTuple_Pack(13, ((PyObject *)__pyx_n_s__scale), ((PyObject *)__pyx_n_s__ndp), ((PyObject *)__pyx_n_s__d1), ((PyObject *)__pyx_n_s__d2), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__iy), ((PyObject *)__pyx_n_s__im), ((PyObject *)__pyx_n_s__id), ((PyObject *)__pyx_n_s__ihmsf), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __ [...]
-  __Pyx_GOTREF(__pyx_k_tuple_48);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));
-  __pyx_k_codeobj_49 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__jd_dtf, 226, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__16 = PyTuple_Pack(13, __pyx_n_s_scale, __pyx_n_s_ndp, __pyx_n_s_d1, __pyx_n_s_d2, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_iy, __pyx_n_s_im, __pyx_n_s_id, __pyx_n_s_ihmsf, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_jd_dtf, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":305
  * @cython.wraparound(False)
@@ -16474,10 +17447,10 @@ static int __Pyx_InitCachedConstants(void) {
  *               np.ndarray[int, ndim=1] iy,
  *               np.ndarray[int, ndim=1] im,
  */
-  __pyx_k_tuple_50 = PyTuple_Pack(14, ((PyObject *)__pyx_n_s__scale), ((PyObject *)__pyx_n_s__iy), ((PyObject *)__pyx_n_s__im), ((PyObject *)__pyx_n_s__id), ((PyObject *)__pyx_n_s__ihr), ((PyObject *)__pyx_n_s__imn), ((PyObject *)__pyx_n_s__sec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_50))  [...]
-  __Pyx_GOTREF(__pyx_k_tuple_50);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
-  __pyx_k_codeobj_51 = (PyObject*)__Pyx_PyCode_New(7, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__dtf_jd, 305, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__18 = PyTuple_Pack(14, __pyx_n_s_scale, __pyx_n_s_iy, __pyx_n_s_im, __pyx_n_s_id, __pyx_n_s_ihr, __pyx_n_s_imn, __pyx_n_s_sec, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(7, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_dtf_jd, 305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":399
  * @cython.wraparound(False)
@@ -16486,10 +17459,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_52 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_52);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
-  __pyx_k_codeobj_53 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tai_tt, 399, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tai_tt, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":436
  * @cython.wraparound(False)
@@ -16498,10 +17471,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_54 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_54);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
-  __pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tcb_tdb, 436, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__22 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tcb_tdb, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":492
  * @cython.wraparound(False)
@@ -16510,10 +17483,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_56 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_56);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
-  __pyx_k_codeobj_57 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tcg_tt, 492, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tcg_tt, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":523
  * @cython.wraparound(False)
@@ -16522,10 +17495,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_58 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_58);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));
-  __pyx_k_codeobj_59 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tdb_tcb, 523, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__26 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tdb_tcb, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":553
  * @cython.wraparound(False)
@@ -16534,10 +17507,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_60 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_60);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
-  __pyx_k_codeobj_61 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tt_tai, 553, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__28 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tt_tai, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":583
  * @cython.wraparound(False)
@@ -16546,10 +17519,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_62 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_62);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
-  __pyx_k_codeobj_63 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tt_tcg, 583, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tt_tcg, 583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":612
  * @cython.wraparound(False)
@@ -16558,10 +17531,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_64 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_64);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));
-  __pyx_k_codeobj_65 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__utc_tai, 612, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__32 = PyTuple_Pack(9, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_utc_tai, 612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":670
  * @cython.wraparound(False)
@@ -16570,10 +17543,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_k_tuple_66 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_66);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));
-  __pyx_k_codeobj_67 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tai_utc, 670, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__34 = PyTuple_Pack(9, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tai_utc, 670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":727
  * @cython.wraparound(False)
@@ -16582,10 +17555,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_68 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_68);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
-  __pyx_k_codeobj_69 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tai_ut1, 727, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tai_ut1, 727, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":769
  * @cython.wraparound(False)
@@ -16594,10 +17567,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_70 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_70);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
-  __pyx_k_codeobj_71 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__ut1_tai, 769, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
+  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_ut1_tai, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":811
  * @cython.wraparound(False)
@@ -16606,10 +17579,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_72 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_72);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));
-  __pyx_k_codeobj_73 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tt_ut1, 811, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tt_ut1, 811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":852
  * @cython.wraparound(False)
@@ -16618,10 +17591,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_74 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_74);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));
-  __pyx_k_codeobj_75 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__ut1_tt, 852, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__42 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
+  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_ut1_tt, 852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":893
  * @cython.wraparound(False)
@@ -16630,10 +17603,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_76 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_76);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));
-  __pyx_k_codeobj_77 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tdb_tt, 893, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__44 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__44);
+  __Pyx_GIVEREF(__pyx_tuple__44);
+  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tdb_tt, 893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":943
  * @cython.wraparound(False)
@@ -16642,10 +17615,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_78 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_78);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));
-  __pyx_k_codeobj_79 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__tt_tdb, 943, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__46 = PyTuple_Pack(8, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
+  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_tt_tdb, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":993
  * @cython.wraparound(False)
@@ -16654,10 +17627,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_80 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_80);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
-  __pyx_k_codeobj_81 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__ut1_utc, 993, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__48 = PyTuple_Pack(10, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_ut1_utc, 993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1057
  * @cython.wraparound(False)
@@ -16666,10 +17639,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_k_tuple_82 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__dt), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__out1), ((PyObject *)__pyx_n_s__out2), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_82);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));
-  __pyx_k_codeobj_83 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__utc_ut1, 1057, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__50 = PyTuple_Pack(10, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_dt, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_out1, __pyx_n_s_out2, __pyx_n_s_warns, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_utc_ut1, 1057, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1125
  * @cython.wraparound(False)
@@ -16678,10 +17651,10 @@ static int __Pyx_InitCachedConstants(void) {
  *              np.ndarray[double, ndim=1] in2,
  *              np.ndarray[double, ndim=1] ut,
  */
-  __pyx_k_tuple_84 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__in1), ((PyObject *)__pyx_n_s__in2), ((PyObject *)__pyx_n_s__ut), ((PyObject *)__pyx_n_s__elong), ((PyObject *)__pyx_n_s__u), ((PyObject *)__pyx_n_s__v), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__out)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_84);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));
-  __pyx_k_codeobj_85 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__d_tdb_tt, 1125, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__52 = PyTuple_Pack(10, __pyx_n_s_in1, __pyx_n_s_in2, __pyx_n_s_ut, __pyx_n_s_elong, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_out); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_d_tdb_tt, 1125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1246
  * 
@@ -16690,10 +17663,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """
  *     int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
  */
-  __pyx_k_tuple_86 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__sign), ((PyObject *)__pyx_n_s__ideg), ((PyObject *)__pyx_n_s__iamin), ((PyObject *)__pyx_n_s__asec), ((PyObject *)__pyx_n_s__rad), ((PyObject *)__pyx_n_s__s), ((PyObject *)__pyx_n_s__warns), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_86);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));
-  __pyx_k_codeobj_87 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__era_af2a, 1246, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__54 = PyTuple_Pack(8, __pyx_n_s_sign, __pyx_n_s_ideg, __pyx_n_s_iamin, __pyx_n_s_asec, __pyx_n_s_rad, __pyx_n_s_s, __pyx_n_s_warns, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
+  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_era_af2a, 1246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1287
  *     return rad
@@ -16702,10 +17675,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """
  *     Wrap
  */
-  __pyx_k_tuple_88 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__elong), ((PyObject *)__pyx_n_s__phi), ((PyObject *)__pyx_n_s__height), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nitems), ((PyObject *)__pyx_n_s__xyz), ((PyObject *)__pyx_n_s__out), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_88);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));
-  __pyx_k_codeobj_89 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__era_gd2gc, 1287, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__56 = PyTuple_Pack(10, __pyx_n_s_n, __pyx_n_s_elong, __pyx_n_s_phi, __pyx_n_s_height, __pyx_n_s_i, __pyx_n_s_nitems, __pyx_n_s_xyz, __pyx_n_s_out, __pyx_n_s_errs, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
+  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_era_gd2gc, 1287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1349
  * @cython.wraparound(False)
@@ -16714,10 +17687,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """
  *     Wrap
  */
-  __pyx_k_tuple_90 = PyTuple_Pack(11, ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__xyz), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nitems), ((PyObject *)__pyx_n_s__elong), ((PyObject *)__pyx_n_s__phi), ((PyObject *)__pyx_n_s__height), ((PyObject *)__pyx_n_s__xyz_item), ((PyObject *)__pyx_n_s__errs), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__ret)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto  [...]
-  __Pyx_GOTREF(__pyx_k_tuple_90);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));
-  __pyx_k_codeobj_91 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__era_gc2gd, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__58 = PyTuple_Pack(11, __pyx_n_s_n, __pyx_n_s_xyz, __pyx_n_s_i, __pyx_n_s_nitems, __pyx_n_s_elong, __pyx_n_s_phi, __pyx_n_s_height, __pyx_n_s_xyz_item, __pyx_n_s_errs, __pyx_n_s_j, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_era_gc2gd, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1419
  * @cython.wraparound(False)
@@ -16726,10 +17699,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                     np.ndarray[double, ndim=1] jd2):
  *     """ Wrap double eraEpj(double dj1, double dj2)
  */
-  __pyx_k_tuple_92 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__jd1), ((PyObject *)__pyx_n_s__jd2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__epd)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_92);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));
-  __pyx_k_codeobj_93 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__jd_julian_epoch, 1419, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_jd1, __pyx_n_s_jd2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_epd); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_jd_julian_epoch, 1419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1450
  * @cython.wraparound(False)
@@ -16738,10 +17711,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """ Wrap void eraEpj2jd(double epj, double *djm0, double *djm)
  *     **  Julian Epoch to Julian Date.
  */
-  __pyx_k_tuple_94 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__epd), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__jd1), ((PyObject *)__pyx_n_s__jd2)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_94);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));
-  __pyx_k_codeobj_95 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__julian_epoch_jd, 1450, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_epd, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_jd1, __pyx_n_s_jd2); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
+  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_julian_epoch_jd, 1450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1472
  * @cython.wraparound(False)
@@ -16750,10 +17723,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                        np.ndarray[double, ndim=1] jd2):
  *     """ Wrap double eraEpb(double dj1, double dj2)
  */
-  __pyx_k_tuple_96 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__jd1), ((PyObject *)__pyx_n_s__jd2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__epd)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_96);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
-  __pyx_k_codeobj_97 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__jd_besselian_epoch, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_jd1, __pyx_n_s_jd2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_epd); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
+  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_jd_besselian_epoch, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1503
  * @cython.wraparound(False)
@@ -16762,10 +17735,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     """ Wrap void eraEpb2jd(double epj, double *djm0, double *djm)
  *     **  Besselian Epoch to Julian Date.
  */
-  __pyx_k_tuple_98 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__epd), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__jd1), ((PyObject *)__pyx_n_s__jd2)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_98);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));
-  __pyx_k_codeobj_99 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__besselian_epoch_jd, 1503, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_epd, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_jd1, __pyx_n_s_jd2); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
+  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_besselian_epoch_jd, 1503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1532
  * @cython.wraparound(False)
@@ -16774,10 +17747,10 @@ static int __Pyx_InitCachedConstants(void) {
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_k_tuple_100 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__tt1), ((PyObject *)__pyx_n_s__tt2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gmst)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_100);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));
-  __pyx_k_codeobj_101 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gmst00, 1532, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__68 = PyTuple_Pack(7, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_tt1, __pyx_n_s_tt2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gmst); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
+  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gmst00, 1532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1614
  * @cython.wraparound(False)
@@ -16786,10 +17759,10 @@ static int __Pyx_InitCachedConstants(void) {
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_k_tuple_102 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__tt1), ((PyObject *)__pyx_n_s__tt2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gmst)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_102);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));
-  __pyx_k_codeobj_103 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gmst06, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__70 = PyTuple_Pack(7, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_tt1, __pyx_n_s_tt2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gmst); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
+  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gmst06, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1683
  * @cython.wraparound(False)
@@ -16798,10 +17771,10 @@ static int __Pyx_InitCachedConstants(void) {
  *            np.ndarray[double, ndim=1] ut12):
  *     """Wrap double double eraGmst82(double dj1, double dj2)
  */
-  __pyx_k_tuple_104 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gmst)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_104);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));
-  __pyx_k_codeobj_105 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gmst82, 1683, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gmst); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__72);
+  __Pyx_GIVEREF(__pyx_tuple__72);
+  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gmst82, 1683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1752
  * @cython.wraparound(False)
@@ -16810,10 +17783,10 @@ static int __Pyx_InitCachedConstants(void) {
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_k_tuple_106 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__tt1), ((PyObject *)__pyx_n_s__tt2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gst)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_106);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));
-  __pyx_k_codeobj_107 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gst00a, 1752, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__74 = PyTuple_Pack(7, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_tt1, __pyx_n_s_tt2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gst); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__74);
+  __Pyx_GIVEREF(__pyx_tuple__74);
+  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gst00a, 1752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1832
  * @cython.wraparound(False)
@@ -16822,10 +17795,10 @@ static int __Pyx_InitCachedConstants(void) {
  *             np.ndarray[double, ndim=1] ut12):
  *     """Wrap double eraGst00b(double uta, double utb)
  */
-  __pyx_k_tuple_108 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gst)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_108);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));
-  __pyx_k_codeobj_109 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gst00b, 1832, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gst); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gst00b, 1832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1918
  * @cython.wraparound(False)
@@ -16834,10 +17807,10 @@ static int __Pyx_InitCachedConstants(void) {
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_k_tuple_110 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__tt1), ((PyObject *)__pyx_n_s__tt2), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gst)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_110);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));
-  __pyx_k_codeobj_111 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gst06a, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__78 = PyTuple_Pack(7, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_tt1, __pyx_n_s_tt2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gst); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__78);
+  __Pyx_GIVEREF(__pyx_tuple__78);
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gst06a, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":1989
  * @cython.wraparound(False)
@@ -16846,10 +17819,10 @@ static int __Pyx_InitCachedConstants(void) {
  *           np.ndarray[double, ndim=1] ut12):
  *     """Wrap double eraGst94(double uta, double utb)
  */
-  __pyx_k_tuple_112 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__ut11), ((PyObject *)__pyx_n_s__ut12), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__gst)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_112);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));
-  __pyx_k_codeobj_113 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_42, __pyx_n_s__gst94, 1989, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__80 = PyTuple_Pack(5, __pyx_n_s_ut11, __pyx_n_s_ut12, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_gst); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_internal_1_root_src_astropy_ast, __pyx_n_s_gst94, 1989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -16859,18 +17832,17 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_4 = PyInt_FromLong(-4); if (unlikely(!__pyx_int_neg_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_5 = PyInt_FromLong(-5); if (unlikely(!__pyx_int_neg_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_6 = PyInt_FromLong(-6); if (unlikely(!__pyx_int_neg_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_4 = PyInt_FromLong(-4); if (unlikely(!__pyx_int_neg_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_5 = PyInt_FromLong(-5); if (unlikely(!__pyx_int_neg_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_6 = PyInt_FromLong(-6); if (unlikely(!__pyx_int_neg_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -16886,6 +17858,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -16918,11 +17893,26 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("erfa_time"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("erfa_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_astropy__time__erfa_time) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -16931,16 +17921,6 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_astropy__time__erfa_time) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -16971,9 +17951,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  * 
  * from ..utils.exceptions import AstropyUserWarning
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "astropy/time/erfa_time.pyx":3
@@ -16985,19 +17965,15 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  */
   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__AstropyUserWarning));
-  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__AstropyUserWarning));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__AstropyUserWarning));
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_38), ((PyObject *)__pyx_t_1), 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_AstropyUserWarning);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AstropyUserWarning);
+  __Pyx_GIVEREF(__pyx_n_s_AstropyUserWarning);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils_exceptions, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__AstropyUserWarning);
-  if (__pyx_t_1 == NULL) {
-    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__AstropyUserWarning);
-    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AstropyUserWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__AstropyUserWarning, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AstropyUserWarning, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
@@ -17008,9 +17984,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  * cimport numpy as np
  * import cython
  */
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":61
@@ -17020,7 +17996,7 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *           'beyond last known leap second)'
  * 
  */
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DUBIOUS, ((PyObject *)__pyx_kp_s_39)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DUBIOUS, __pyx_kp_s_dubious_year_for_UTC_before_1960) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "astropy/time/erfa_time.pyx":64
  *           'beyond last known leap second)'
@@ -17030,18 +18006,18 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     if ret in warns:
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_k_1 = ((PyObject *)__pyx_t_2);
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_k_ = __pyx_t_2;
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_k_2 = ((PyObject *)__pyx_t_2);
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_k__2 = __pyx_t_2;
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_1check_return, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_1check_return, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__check_return, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_return, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":77
@@ -17051,9 +18027,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[int, ndim=1] iy,
  *     np.ndarray[int, ndim=1] im,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_3cal2jd, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_3cal2jd, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cal2jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cal2jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":128
@@ -17063,9 +18039,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *               np.ndarray[int, ndim=1] im,
  *               np.ndarray[int, ndim=1] id,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_5d_tai_utc, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_5d_tai_utc, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__d_tai_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_d_tai_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":226
@@ -17075,9 +18051,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *               np.ndarray[double, ndim=1] d1,
  *               np.ndarray[double, ndim=1] d2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_7jd_dtf, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_7jd_dtf, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__jd_dtf, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jd_dtf, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":305
@@ -17087,9 +18063,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *               np.ndarray[int, ndim=1] iy,
  *               np.ndarray[int, ndim=1] im,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_9dtf_jd, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_9dtf_jd, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dtf_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtf_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":399
@@ -17099,9 +18075,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_11tai_tt, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_11tai_tt, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tai_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tai_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":436
@@ -17111,9 +18087,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_13tcb_tdb, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_13tcb_tdb, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tcb_tdb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tcb_tdb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":492
@@ -17123,9 +18099,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_15tcg_tt, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_15tcg_tt, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tcg_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tcg_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":523
@@ -17135,9 +18111,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_17tdb_tcb, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_17tdb_tcb, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tdb_tcb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tdb_tcb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":553
@@ -17147,9 +18123,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_19tt_tai, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_19tt_tai, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tt_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tt_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":583
@@ -17159,9 +18135,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_21tt_tcg, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_21tt_tcg, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tt_tcg, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tt_tcg, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":612
@@ -17171,9 +18147,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_23utc_tai, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_23utc_tai, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__utc_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":670
@@ -17183,9 +18159,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2):
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_25tai_utc, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_25tai_utc, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tai_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tai_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":727
@@ -17195,9 +18171,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_27tai_ut1, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_27tai_ut1, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tai_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tai_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":769
@@ -17207,9 +18183,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_29ut1_tai, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_29ut1_tai, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ut1_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ut1_tai, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":811
@@ -17219,9 +18195,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_31tt_ut1, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_31tt_ut1, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tt_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tt_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":852
@@ -17231,9 +18207,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_33ut1_tt, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_33ut1_tt, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ut1_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ut1_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":893
@@ -17243,9 +18219,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_35tdb_tt, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_35tdb_tt, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tdb_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tdb_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":943
@@ -17255,9 +18231,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_37tt_tdb, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_37tt_tdb, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tt_tdb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tt_tdb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":993
@@ -17267,9 +18243,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_39ut1_utc, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_39ut1_utc, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ut1_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ut1_utc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1057
@@ -17279,9 +18255,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     np.ndarray[double, ndim=1] in1,
  *     np.ndarray[double, ndim=1] in2,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_41utc_ut1, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_41utc_ut1, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__utc_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_ut1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1125
@@ -17291,9 +18267,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *              np.ndarray[double, ndim=1] in2,
  *              np.ndarray[double, ndim=1] ut,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_43d_tdb_tt, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_43d_tdb_tt, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__d_tdb_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_d_tdb_tt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1246
@@ -17303,9 +18279,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     """
  *     int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_45era_af2a, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_45era_af2a, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__era_af2a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_era_af2a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1287
@@ -17315,9 +18291,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     """
  *     Wrap
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_47era_gd2gc, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_47era_gd2gc, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__era_gd2gc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_era_gd2gc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1349
@@ -17327,9 +18303,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     """
  *     Wrap
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_49era_gc2gd, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_49era_gc2gd, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__era_gc2gd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_era_gc2gd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1419
@@ -17339,9 +18315,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *                     np.ndarray[double, ndim=1] jd2):
  *     """ Wrap double eraEpj(double dj1, double dj2)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_51jd_julian_epoch, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_51jd_julian_epoch, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__jd_julian_epoch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jd_julian_epoch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1450
@@ -17351,9 +18327,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     """ Wrap void eraEpj2jd(double epj, double *djm0, double *djm)
  *     **  Julian Epoch to Julian Date.
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_53julian_epoch_jd, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_53julian_epoch_jd, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__julian_epoch_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_julian_epoch_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1472
@@ -17363,9 +18339,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *                        np.ndarray[double, ndim=1] jd2):
  *     """ Wrap double eraEpb(double dj1, double dj2)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_55jd_besselian_epoch, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_55jd_besselian_epoch, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__jd_besselian_epoch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jd_besselian_epoch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1503
@@ -17375,9 +18351,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *     """ Wrap void eraEpb2jd(double epj, double *djm0, double *djm)
  *     **  Besselian Epoch to Julian Date.
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_57besselian_epoch_jd, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_57besselian_epoch_jd, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__besselian_epoch_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_besselian_epoch_jd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1532
@@ -17387,9 +18363,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_59gmst00, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_59gmst00, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gmst00, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gmst00, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1614
@@ -17399,9 +18375,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_61gmst06, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_61gmst06, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gmst06, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gmst06, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1683
@@ -17411,9 +18387,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *            np.ndarray[double, ndim=1] ut12):
  *     """Wrap double double eraGmst82(double dj1, double dj2)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_63gmst82, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_63gmst82, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gmst82, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gmst82, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1752
@@ -17423,9 +18399,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_65gst00a, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_65gst00a, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gst00a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gst00a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1832
@@ -17435,9 +18411,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *             np.ndarray[double, ndim=1] ut12):
  *     """Wrap double eraGst00b(double uta, double utb)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_67gst00b, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_67gst00b, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gst00b, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gst00b, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1918
@@ -17447,9 +18423,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *            np.ndarray[double, ndim=1] ut12,
  *            np.ndarray[double, ndim=1] tt1,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_69gst06a, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_69gst06a, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gst06a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gst06a, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1989
@@ -17459,9 +18435,9 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  *           np.ndarray[double, ndim=1] ut12):
  *     """Wrap double eraGst94(double uta, double utb)
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_71gst94, NULL, __pyx_n_s_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7astropy_4time_9erfa_time_71gst94, NULL, __pyx_n_s_astropy_time_erfa_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gst94, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gst94, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "astropy/time/erfa_time.pyx":1
@@ -17470,23 +18446,28 @@ PyMODINIT_FUNC PyInit_erfa_time(void)
  * from ..utils.exceptions import AstropyUserWarning
  */
   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../usr/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init astropy.time.erfa_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init astropy.time.erfa_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init astropy.time.erfa_time");
@@ -17515,19 +18496,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+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;
 }
@@ -17552,7 +18531,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.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);
 }
@@ -17656,12 +18635,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -17671,6 +18650,42 @@ bad:
     return -1;
 }
 
+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;
+}
+
+#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
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -17720,11 +18735,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -17739,26 +18750,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            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;
-            }
-        #endif
+        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_ErrRestore(type, value, tb);
     return;
@@ -17768,7 +18766,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -17789,46 +18787,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        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;
+        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 (PyExceptionClass_Check(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)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -17838,6 +18852,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     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) {
@@ -17845,6 +18866,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -17852,23 +18874,29 @@ bad:
 }
 #endif
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+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 (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        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 (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -17920,7 +18948,7 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
 }
 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
     int number = __Pyx_BufFmt_ParseNumber(ts);
-    if (number == -1) /* First char was not a digit */
+    if (number == -1)
         PyErr_Format(PyExc_ValueError,\
                      "Does not understand character buffer dtype format string ('%c')", **ts);
     return number;
@@ -18165,7 +19193,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
     ctx->fmt_offset += size;
     if (arraysize)
       ctx->fmt_offset += (arraysize - 1) * size;
-    --ctx->enc_count; /* Consume from buffer string */
+    --ctx->enc_count;
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -18173,7 +19201,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
           __Pyx_BufFmt_RaiseExpected(ctx);
           return -1;
         }
-        break; /* breaks both loops as ctx->enc_count == 0 */
+        break;
       }
       ctx->head->field = ++field;
       if (field->type == NULL) {
@@ -18182,7 +19210,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
         continue;
       } else if (field->type->typegroup == 'S') {
         size_t parent_offset = ctx->head->parent_offset + field->offset;
-        if (field->type->fields->type == NULL) continue; /* empty struct */
+        if (field->type->fields->type == NULL) continue;
         field = field->type->fields;
         ++ctx->head;
         ctx->head->field = field;
@@ -18212,8 +19240,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
     }
     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
     while (*ts && *ts != ')') {
-        if (isspace(*ts))
-            continue;
+        switch (*ts) {
+            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
+            default:  break;
+        }
         number = __Pyx_BufFmt_ExpectNumber(&ts);
         if (number == -1) return NULL;
         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -18253,10 +19283,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-                return ts;
+        return ts;
       case ' ':
-      case 10:
-      case 13:
+      case '\r':
+      case '\n':
         ++ts;
         break;
       case '<':
@@ -18281,7 +19311,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case '^':
         ctx->new_packmode = *ts++;
         break;
-      case 'T': /* substruct */
+      case 'T':
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
@@ -18293,7 +19323,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             return NULL;
           }
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           ctx->enc_count = 0;
           ctx->struct_alignment = 0;
           ++ts;
@@ -18306,12 +19336,12 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
-      case '}': /* end of substruct; either repeat or move on */
+      case '}':
         {
           size_t alignment = ctx->struct_alignment;
           ++ts;
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_type = 0;
           if (alignment && ctx->fmt_offset % alignment) {
             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
           }
@@ -18332,21 +19362,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
           return NULL;
-        }        /* fall through */
+        }
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O': case 's': case 'p':
+      case 'O': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
           ctx->enc_count += ctx->new_count;
-        } else {
-          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
-          ctx->enc_count = ctx->new_count;
-          ctx->enc_packmode = ctx->new_packmode;
-          ctx->enc_type = *ts;
-          ctx->is_complex = got_Z;
+          ctx->new_count = 1;
+          got_Z = 0;
+          ++ts;
+          break;
         }
+      case 's':
+        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+        ctx->enc_count = ctx->new_count;
+        ctx->enc_packmode = ctx->new_packmode;
+        ctx->enc_type = *ts;
+        ctx->is_complex = got_Z;
         ++ts;
         ctx->new_count = 1;
         got_Z = 0;
@@ -18417,7 +19451,7 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -18427,233 +19461,895 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     return 0;
 }
 
-static void __Pyx_RaiseBufferIndexError(int axis) {
-  PyErr_Format(PyExc_IndexError,
-     "Out of bounds on buffer access (axis %d)", axis);
-}
-
-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);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
-    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+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 int __Pyx_IterFinish(void) {
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck) {
 #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;
-        }
+    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 0;
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
 #else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
+    return PySequence_GetItem(o, i);
 #endif
 }
-
-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();
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, 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 0;
+    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, int wraparound, 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))
+                        PyErr_Clear();
+                    else
+                        return NULL;
+                }
+            }
+            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));
+}
+
+static void __Pyx_RaiseBufferIndexError(int axis) {
+  PyErr_Format(PyExc_IndexError,
+     "Out of bounds on buffer access (axis %d)", axis);
+}
+
+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, int wraparound, 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))
+                        PyErr_Clear();
+                    else
+                        return -1;
+                }
+            }
+            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);
+}
+
+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);
+}
+
+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");
+}
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+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;
+}
+
+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) / 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);
+}
+
+#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);
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
-    CYTHON_UNUSED PyObject *getbuffer_cobj;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                             "__pyx_getbuffer"))) {
-        getbufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
-      #else
-        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
-      #endif
-        Py_DECREF(getbuffer_cobj);
-        if (!func)
-            goto fail;
-        return func(obj, view, flags);
-    } else {
-        PyErr_Clear();
-    }
-  #endif
-    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
+    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
     return -1;
 }
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
     PyObject *obj = view->obj;
-    CYTHON_UNUSED PyObject *releasebuffer_cobj;
     if (!obj) return;
-  #if PY_VERSION_HEX >= 0x02060000
     if (PyObject_CheckBuffer(obj)) {
         PyBuffer_Release(view);
         return;
     }
-  #endif
         if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
-  #if PY_VERSION_HEX < 0x02060000
-    if (obj->ob_type->tp_dict &&
-        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
-                                                      "__pyx_releasebuffer"))) {
-        releasebufferproc func;
-      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
-        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
-      #else
-        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
-      #endif
-        Py_DECREF(releasebuffer_cobj);
-        if (!func)
-            goto fail;
-        func(obj, view);
-        return;
+    Py_DECREF(obj);
+    view->obj = NULL;
+}
+#endif
+
+
+        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;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
     } else {
-        PyErr_Clear();
+        if (sizeof(unsigned int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(unsigned int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
     }
-  #endif
-    goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
+                                     little, !is_unsigned);
+    }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        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 (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
 #endif
-    PyErr_WriteUnraisable(obj);
-nofail:
-    Py_DECREF(obj);
-    view->obj = NULL;
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(unsigned int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (unsigned int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(unsigned int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, long, PyLong_AsLong(x))
+            } else if (sizeof(unsigned int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(unsigned int, 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
+            unsigned int val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (unsigned int) -1;
+        }
+    } else {
+        unsigned int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned int) -1;
+        val = __Pyx_PyInt_As_unsigned_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to unsigned int");
+    return (unsigned int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to unsigned int");
+    return (unsigned int) -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((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);
+    }
+}
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, 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_Int(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_Int(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;
+}
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+    const char neg_one = (char) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(char) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (char) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(char) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(char) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(char) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong(x))
+            } else if (sizeof(char) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(char, 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
+            char val;
+            PyObject *v = __Pyx_PyNumber_Int(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 (char) -1;
+        }
+    } else {
+        char val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (char) -1;
+        val = __Pyx_PyInt_As_char(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to char");
+    return (char) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to char");
+    return (char) -1;
 }
-#endif /*  PY_MAJOR_VERSION < 3 */
-
 
-    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 = 0;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__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_VERSION_HEX >= 0x02050000
-    {
-        #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; /* try absolute import on failure */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 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 long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
-        #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
+    } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
+                                     little, !is_unsigned);
     }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
-bad:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
 }
 
-static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
-    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
-                 PyString_AsString(name));
+    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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, 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
-    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
+            long val;
+            PyObject *v = __Pyx_PyNumber_Int(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_Int(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;
 }
 
 #if CYTHON_CCOMPLEX
@@ -18867,434 +20563,34 @@ static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
                         return a;
                     case 2:
                         z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(a, a);
-                    case 3:
-                        z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(z, a);
-                    case 4:
-                        z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(z, z);
-                }
-            }
-            if (a.imag == 0) {
-                if (a.real == 0) {
-                    return a;
-                }
-                r = a.real;
-                theta = 0;
-            } else {
-                r = __Pyx_c_abs(a);
-                theta = atan2(a.imag, a.real);
-            }
-            lnr = log(r);
-            z_r = exp(lnr * b.real - theta * b.imag);
-            z_theta = theta * b.real + lnr * b.imag;
-            z.real = z_r * cos(z_theta);
-            z.imag = z_r * sin(z_theta);
-            return z;
-        }
-    #endif
-#endif
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
-            }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                        return __Pyx_c_prod(a, a);
+                    case 3:
+                        z = __Pyx_c_prod(a, a);
+                        return __Pyx_c_prod(z, a);
+                    case 4:
+                        z = __Pyx_c_prod(a, a);
+                        return __Pyx_c_prod(z, z);
+                }
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
-        }
-        return (signed long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+            if (a.imag == 0) {
+                if (a.real == 0) {
+                    return a;
+                }
+                r = a.real;
+                theta = 0;
+            } else {
+                r = __Pyx_c_abs(a);
+                theta = atan2(a.imag, a.real);
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
+            lnr = log(r);
+            z_r = exp(lnr * b.real - theta * b.imag);
+            z_theta = theta * b.real + lnr * b.imag;
+            z.real = z_r * cos(z_theta);
+            z.imag = z_r * sin(z_theta);
+            return z;
         }
-        return (signed PY_LONG_LONG)val;
-    } else
+    #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
-            }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        signed PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
 
 static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
@@ -19306,11 +20602,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -19360,7 +20652,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -19380,15 +20672,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -19400,168 +20688,6 @@ bad:
 }
 #endif
 
-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) / 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, 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);
-}
-
-#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,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __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,      /*int firstlineno,*/
-        __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;
-    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*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);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -19572,7 +20698,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -19592,6 +20718,71 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *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 __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
+    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;
@@ -19601,14 +20792,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -19624,13 +20815,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -19644,35 +20835,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #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) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/astropy/units/core.py b/astropy/units/core.py
index c89c723..3b4ecac 100644
--- a/astropy/units/core.py
+++ b/astropy/units/core.py
@@ -19,7 +19,8 @@ import numpy as np
 
 from ..utils.exceptions import AstropyWarning
 from ..utils.misc import isiterable, InheritDocstrings, lazyproperty
-from .utils import is_effectively_unity, sanitize_scale, validate_power
+from .utils import (is_effectively_unity, sanitize_scale, validate_power,
+                    add_powers)
 from . import format as unit_format
 
 # TODO: Support functional units, e.g. log(x), ln(x)
@@ -667,7 +668,7 @@ class UnitBase(object):
 
         try:
             other = Unit(other, parse_strict='silent')
-        except (ValueError, UnitsError):
+        except (ValueError, UnitsError, TypeError):
             return False
         try:
             return is_effectively_unity(self._to(other))
@@ -968,9 +969,14 @@ class UnitBase(object):
         for funit, tunit, a, b in equivalencies:
             if tunit is not None:
                 if self._is_equivalent(funit):
-                    units.append(tunit.decompose())
+                    scale = funit.decompose().scale / unit.scale
+                    units.append(Unit(a(1.0 / scale) * tunit).decompose())
                 elif self._is_equivalent(tunit):
-                    units.append(funit.decompose())
+                    scale = tunit.decompose().scale / unit.scale
+                    units.append(Unit(b(1.0 / scale) * funit).decompose())
+            else:
+                if self._is_equivalent(funit):
+                    units.append(Unit(unit.scale))
 
         # Store partial results
         partial_results = []
@@ -1008,8 +1014,9 @@ class UnitBase(object):
         # Do we have any minimal results?
         for final_result in final_results:
             if len(final_result):
-                cached_results[key] = final_result
-                return final_result
+                results = final_results[0].union(final_results[1])
+                cached_results[key] = results
+                return results
 
         partial_results.sort(key=lambda x: x[0])
 
@@ -1120,6 +1127,10 @@ class UnitBase(object):
                     elif unit._is_equivalent(tunit):
                         if has_bases_in_common(funit.decompose(), other):
                             return True
+                else:
+                    if unit._is_equivalent(funit):
+                        if has_bases_in_common(dimensionless_unscaled, other):
+                            return True
             return False
 
         def filter_units(units):
@@ -1275,12 +1286,15 @@ class UnitBase(object):
         units = set(unit_registry.get_units_with_physical_type(self))
         for funit, tunit, a, b in equivalencies:
             if tunit is not None:
-                if funit not in units:
-                    units.update(
-                        unit_registry.get_units_with_physical_type(funit))
-                if tunit not in units:
+                if self.is_equivalent(funit) and tunit not in units:
                     units.update(
                         unit_registry.get_units_with_physical_type(tunit))
+                if self._is_equivalent(tunit) and funit not in units:
+                    units.update(
+                        unit_registry.get_units_with_physical_type(funit))
+            else:
+                if self.is_equivalent(funit):
+                    units.add(dimensionless_unscaled)
         return units
 
     class EquivalentUnitsList(list):
@@ -1346,8 +1360,8 @@ class UnitBase(object):
         results = self.compose(
             equivalencies=equivalencies, units=units, max_depth=1,
             include_prefix_units=include_prefix_units)
-        results = [
-            x.bases[0] for x in results if len(x.bases) == 1]
+        results = set(
+            x.bases[0] for x in results if len(x.bases) == 1)
         return self.EquivalentUnitsList(results)
 
     def is_unity(self):
@@ -1975,7 +1989,7 @@ class CompositeUnit(UnitBase):
                         break
 
             if unit in new_parts:
-                new_parts[unit] += power
+                new_parts[unit] = add_powers(new_parts[unit], power)
             else:
                 new_parts[unit] = power
             return scale
diff --git a/astropy/units/equivalencies.py b/astropy/units/equivalencies.py
index 9742eba..bfdffa4 100644
--- a/astropy/units/equivalencies.py
+++ b/astropy/units/equivalencies.py
@@ -25,7 +25,7 @@ def dimensionless_angles():
 
     It is special compared to other equivalency pairs in that it
     allows this independent of the power to which the angle is raised,
-    and indepedent of whether it is part of a more complicated unit.
+    and independent of whether it is part of a more complicated unit.
     """
     return [(si.radian, None)]
 
@@ -167,10 +167,7 @@ def spectral_density(wav, factor=None):
         return x * wav.to(si.AA, spectral()).value ** 3 / (hc * c_Aps)
 
     return [
-        (si.AA, fnu, converter, iconverter),
         (fla, fnu, converter, iconverter),
-        (si.AA, si.Hz, converter, iconverter),
-        (fla, si.Hz, converter, iconverter),
         (fnu, nufnu, converter_fnu_nufnu, iconverter_fnu_nufnu),
         (fla, lafla, converter_fla_lafla, iconverter_fla_lafla),
         (photlam, fla, converter_photlam_fla, iconverter_photlam_fla),
diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py
index e88dac6..4fabe7e 100644
--- a/astropy/units/quantity.py
+++ b/astropy/units/quantity.py
@@ -13,6 +13,8 @@ from __future__ import (absolute_import, unicode_literals, division,
 import numbers
 
 import numpy as np
+NUMPY_LT_1P7 = [int(x) for x in np.__version__.split('.')[:2]] < [1, 7]
+NUMPY_LT_1P8 = [int(x) for x in np.__version__.split('.')[:2]] < [1, 8]
 NUMPY_LT_1P9 = [int(x) for x in np.__version__.split('.')[:2]] < [1, 9]
 
 # AstroPy
@@ -192,34 +194,37 @@ class Quantity(np.ndarray):
             return np.array(value, dtype=dtype, copy=copy, order=order,
                             subok=True, ndmin=ndmin)
 
-        rescale_value = None
-
         # Maybe list/tuple of Quantity? short-circuit array for speed
         if(not isinstance(value, np.ndarray) and isiterable(value) and
            all(isinstance(v, Quantity) for v in value)):
             if unit is None:
                 unit = value[0].unit
             value = [q.to(unit).value for q in value]
+            value_unit = unit  # signal below that conversion has been done
             copy = False  # copy already made
 
         else:
-            # if the value has a `unit` attribute, treat it like a quantity by
-            # rescaling the value appropriately
-            if hasattr(value, 'unit'):
-                    try:
-                        value_unit = Unit(value.unit)
-                    except TypeError:
-                        if unit is None:
-                            unit = dimensionless_unscaled
-                    else:
-                        if unit is None:
-                            unit = value_unit
-                        else:
-                            rescale_value = value_unit.to(unit)
-
-            #if it has no unit, default to dimensionless_unscaled
-            elif unit is None:
-                unit = dimensionless_unscaled
+            # If the value has a `unit` attribute and if not None
+            # (for Columns with uninitialized unit), treat it like a quantity.
+            value_unit = getattr(value, 'unit', None)
+            if value_unit is None:
+                # Default to dimensionless for no (initialized) unit attribute.
+                if unit is None:
+                    unit = dimensionless_unscaled
+                value_unit = unit  # signal below that no conversion is needed
+            else:
+                try:
+                    value_unit = Unit(value_unit)
+                except Exception as exc:
+                    raise TypeError("The unit attribute {0} of the input could "
+                                    "not be parsed as an astropy Unit, raising "
+                                    "the following exception:\n{1}"
+                                    .format(repr(value.unit), exc))
+
+                if unit is None:
+                    unit = value_unit
+                elif unit is not value_unit:
+                    copy = False  # copy will be made in conversion at end
 
         value = np.array(value, dtype=dtype, copy=copy, order=order,
                          subok=False, ndmin=ndmin)
@@ -237,13 +242,14 @@ class Quantity(np.ndarray):
                               or value.dtype.kind == 'O'):
             value = value.astype(np.float)
 
-        if rescale_value is not None:
-            value *= rescale_value
-
         value = value.view(cls)
-        value._unit = unit
-
-        return value
+        value._unit = value_unit
+        if unit is value_unit:
+            return value
+        else:
+            # here we had non-Quantity input that had a "unit" attribute
+            # with a unit different from the desired one.  So, convert.
+            return value.to(unit)
 
     def __array_finalize__(self, obj):
         self._unit = getattr(obj, '_unit', None)
@@ -294,14 +300,23 @@ class Quantity(np.ndarray):
             # can just have the unit of the quantity
             # (this allows, e.g., `q > 0.` independent of unit)
             maybe_arbitrary_arg = args[scales.index(0.)]
-            if _can_have_arbitrary_unit(maybe_arbitrary_arg):
-                scales = [1., 1.]
-            else:
-                raise UnitsError("Can only apply '{0}' function to "
-                                 "dimensionless quantities when other "
-                                 "argument is not a quantity (unless the "
-                                 "latter is all zero/infinity/nan)"
-                                 .format(function.__name__))
+            try:
+                if _can_have_arbitrary_unit(maybe_arbitrary_arg):
+                    scales = [1., 1.]
+                else:
+                    raise UnitsError("Can only apply '{0}' function to "
+                                     "dimensionless quantities when other "
+                                     "argument is not a quantity (unless the "
+                                     "latter is all zero/infinity/nan)"
+                                     .format(function.__name__))
+            except TypeError:
+                # _can_have_arbitrary_unit failed: arg could not be compared
+                # with zero or checked to be finite.  Then, ufunc will fail too.
+                raise TypeError("Unsupported operand type(s) for ufunc {0}: "
+                                "'{1}' and '{2}'"
+                                .format(function.__name__,
+                                        args[0].__class__.__name__,
+                                        args[1].__class__.__name__))
 
         # In the case of np.power, the unit itself needs to be modified by an
         # amount that depends on one of the input values, so we need to treat
@@ -394,8 +409,13 @@ class Quantity(np.ndarray):
         return result
 
     def __array_wrap__(self, obj, context=None):
-        if context is not None:
+        if context is None:
+            # Methods like .squeeze() created a new `ndarray` and then call
+            # __array_wrap__ to turn the array into self's subclass.
+            return self._new_view(obj)
 
+        else:
+            # with context defined, we are continuing after a ufunc evaluation.
             if hasattr(obj, '_result_unit'):
                 result_unit = obj._result_unit
                 del obj._result_unit
@@ -886,9 +906,8 @@ class Quantity(np.ndarray):
                 raise TypeError('Only dimensionless scalar quantities can be '
                                 'converted to Python scalars')
 
-    # Display
-    # TODO: we may want to add a hook for dimensionless quantities?
-    def __str__(self):
+    @property
+    def _unitstr(self):
         if self.unit is None:
             unitstr = _UNIT_NOT_INITIALISED
         else:
@@ -897,21 +916,18 @@ class Quantity(np.ndarray):
         if unitstr:
             unitstr = ' ' + unitstr
 
-        return '{0}{1:s}'.format(self.value, unitstr)
+        return unitstr
+
+    # Display
+    # TODO: we may want to add a hook for dimensionless quantities?
+    def __str__(self):
+        return '{0}{1:s}'.format(self.value, self._unitstr)
 
     def __repr__(self):
         prefixstr = '<' + self.__class__.__name__ + ' '
         arrstr = np.array2string(self.view(np.ndarray), separator=',',
                                  prefix=prefixstr)
-        if self.unit is None:
-            unitstr = _UNIT_NOT_INITIALISED
-        else:
-            unitstr = self.unit.to_string()
-
-        if unitstr:
-            unitstr = ' ' + unitstr
-
-        return '{0}{1}{2:s}>'.format(prefixstr, arrstr, unitstr)
+        return '{0}{1}{2:s}>'.format(prefixstr, arrstr, self._unitstr)
 
     def _repr_latex_(self):
         """
@@ -959,10 +975,8 @@ class Quantity(np.ndarray):
         except ValueError:
             value = self.value
             full_format_spec = format_spec
-        return format("{0} {1:s}".format(value,
-                                         self.unit.to_string()
-                                         if self.unit is not None
-                                         else _UNIT_NOT_INITIALISED),
+
+        return format("{0}{1:s}".format(value, self._unitstr),
                       full_format_spec)
 
     def decompose(self, bases=[]):
@@ -1033,7 +1047,7 @@ class Quantity(np.ndarray):
         # item returns python built-ins, so use initializer, not _new_view
         return self.__class__(super(Quantity, self).item(*args), self.unit)
 
-    def list(self):
+    def tolist(self):
         raise NotImplementedError("cannot make a list of Quantities.  Get "
                                   "list of values with q.value.list()")
 
@@ -1128,139 +1142,147 @@ class Quantity(np.ndarray):
                                self._to_own_unit(v, check_precision=False),
                                *args, **kwargs)  # avoid numpy 1.6 problem
 
-    # Calculation
-
-    # ensure we do not return indices as quantities
-    # conj OK
-
     def argmax(self, axis=None, out=None):
-        return self.view(np.ndarray).argmax(axis=axis, out=out)
+        return self.view(np.ndarray).argmax(axis, out=out)
 
     def argmin(self, axis=None, out=None):
-        return self.view(np.ndarray).argmin(axis=axis, out=out)
+        return self.view(np.ndarray).argmin(axis, out=out)
 
-    def _prepare_out(self, out=None, unit=None):
-        if out is None:
-            return
-        if not isinstance(out, Quantity):
-            raise TypeError("out has to be assigned to a Quantity instance")
-        if unit is None:
-            out._unit = self._unit
-        else:
-            if out.__quantity_subclass__(unit)[0] is not out.__class__:
+    # Calculation -- override ndarray methods to take into account units.
+    # We use the corresponding numpy functions to evaluate the results, since
+    # the methods do not always allow calling with keyword arguments.
+    # For instance, np.array([0.,2.]).clip(a_min=0., a_max=1.) gives
+    # TypeError: 'a_max' is an invalid keyword argument for this function
+    def _wrap_function(self, function, *args, **kwargs):
+        """Wrap a numpy function, returning a Quantity with the proper unit
+
+        Parameters
+        ----------
+        function : callable
+            numpy function to wrap
+        args : positional arguments
+            any positional arguments to the function.
+        kwargs : keyword arguments
+            Keyword arguments to the function.
+
+        If present, the following arguments are treated specially:
+
+        unit : `~astropy.units.Unit` or `None`
+            unit of the output result.  If not given or `None` (default),
+            the unit of `self`.
+        out : `~astropy.units.Quantity`
+            A Quantity instance in which to store the output.
+
+        Notes
+        -----
+        Output should always be assigned via a keyword argument.
+
+        Returns
+        -------
+        out : `~astropy.units.Quantity`
+            Result of the function call, with the unit set properly.
+        """
+
+        unit = kwargs.pop('unit', None)
+        out = kwargs.get('out', None)
+        if out is not None:
+            if unit is None:
+                unit = self.unit
+
+            if not (isinstance(out, Quantity) and
+                    out.__quantity_subclass__(unit)[0] is type(out)):
+                ok_class =  (out.__quantity_subclass__(out, unit)[0]
+                             if isinstance(out, Quantity) else Quantity)
                 raise TypeError("out cannot be assigned to a {0} instance; "
                                 "use a {1} instance instead.".format(
-                                    out.__class__,
-                                    out.__quantity_subclass__(out, unit)[0]))
+                                    out.__class__, ok_class))
+
+        value = function(self.view(np.ndarray), *args, **kwargs)
+        if out is None:
+            return self._new_view(value, unit)
+        else:
             out._unit = unit
+            return out
 
     def clip(self, a_min, a_max, out=None):
-        self._prepare_out(out=out)
-        value = np.clip(self.value, self._to_own_unit(a_min),
-                        self._to_own_unit(a_max), out=out)
-        return self._new_view(value)
+        return self._wrap_function(np.clip, self._to_own_unit(a_min),
+                                   self._to_own_unit(a_max), out=out)
 
     def trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None):
-        self._prepare_out(out=out)
-        value = np.trace(self.value, offset=offset, axis1=axis1,
-                         axis2=axis2, dtype=None, out=out)
-        return self._new_view(value)
+        return self._wrap_function(np.trace, offset, axis1, axis2, dtype,
+                                   out=out)
 
     def var(self, axis=None, dtype=None, out=None, ddof=0):
-        result_unit = self.unit ** 2
-        self._prepare_out(out=out, unit=result_unit)
-        value = np.var(self.value, axis=axis, dtype=dtype, out=out, ddof=ddof),
-        return self._new_view(value, result_unit)
+        return self._wrap_function(np.var, axis, dtype,
+                                   out=out, ddof=ddof, unit=self.unit**2)
 
     def std(self, axis=None, dtype=None, out=None, ddof=0):
-        self._prepare_out(out=out)
-        value = np.std(self.value, axis=axis, dtype=dtype, out=out, ddof=ddof)
-        return self._new_view(value)
+        return self._wrap_function(np.std, axis, dtype, out=out, ddof=ddof)
 
     def mean(self, axis=None, dtype=None, out=None):
-        self._prepare_out(out=out)
-        value = np.mean(self.value, axis=axis, dtype=dtype, out=out)
-        return self._new_view(value)
+        return self._wrap_function(np.mean, axis, dtype, out=out)
 
     def ptp(self, axis=None, out=None):
-        self._prepare_out(out=out)
-        value = np.ptp(self.value, axis=axis, out=out)
-        return self._new_view(value)
+        return self._wrap_function(np.ptp, axis, out=out)
 
-    def max(self, axis=None, out=None, keepdims=False):
-        self._prepare_out(out=out)
-        try:
-            value = np.max(self.value, axis=axis, out=out, keepdims=keepdims)
-        except:  # numpy < 1.7
-            value = np.max(self.value, axis=axis, out=out)
-        return self._new_view(value)
+    def round(self, decimals=0, out=None):
+        return self._wrap_function(np.round, decimals, out=out)
 
-    def min(self, axis=None, out=None, keepdims=False):
-        self._prepare_out(out=out)
-        try:
-            value = np.min(self.value, axis=axis, out=out, keepdims=keepdims)
-        except:  # numpy < 1.7
-            value = np.min(self.value, axis=axis, out=out)
-        return self._new_view(value)
-
-    def dot(self, b, out=None):
-        result_unit = self.unit * getattr(b, 'unit', 1.)
-        self._prepare_out(out=out, unit=result_unit)
-        try:
-            value = np.dot(self, b, out=out)
-        except TypeError:  # numpy < 1.7
-            value = np.dot(self, b)
-        return self._new_view(value, result_unit)
+    if NUMPY_LT_1P7:
+        # 'keepdims' was not yet available.
+        def max(self, axis=None, out=None):
+            return self._wrap_function(np.max, axis, out=out)
 
-    def diff(self, n=1, axis=-1):
-        value = np.diff(self.value, n=n, axis=axis)
-        return self._new_view(value)
+        def min(self, axis=None, out=None):
+            return self._wrap_function(np.min, axis, out=out)
 
-    def ediff1d(self, to_end=None, to_begin=None):
-        value = np.ediff1d(self.value, to_end=to_end, to_begin=to_begin)
-        return self._new_view(value)
+        def sum(self, axis=None, dtype=None, out=None):
+            return self._wrap_function(np.sum, axis, dtype, out=out)
 
-    def nansum(self, axis=None):
-        value = np.nansum(self.value, axis=axis)
-        return self._new_view(value)
+        def prod(self, axis=None, dtype=None, out=None):
+            if not self.unit.is_unity():
+                raise ValueError("cannot use prod on scaled or "
+                                 "non-dimensionless Quantity arrays")
+            return self._wrap_function(np.prod, axis, dtype, out=out)
 
-    def sum(self, axis=None, dtype=None, out=None, keepdims=False):
-        self._prepare_out(out=out)
-        try:
-            value = np.sum(self.value, axis=axis, dtype=dtype,
-                           out=out, keepdims=keepdims)
-        except:  # numpy < 1.7
-            value = np.sum(self.value, axis=axis, dtype=dtype,
-                           out=out)
-        return self._new_view(value)
+        # 'out' was not yet available.
+        def dot(self, b):
+            result_unit = self.unit * getattr(b, 'unit', dimensionless_unscaled)
+            return self._wrap_function(np.dot, b, unit=result_unit)
 
-    def cumsum(self, axis=None, dtype=None, out=None):
-        self._prepare_out(out=out)
-        value = np.cumsum(self.value, axis=axis, dtype=dtype, out=out)
-        return self._new_view(value)
+    else:
+        def max(self, axis=None, out=None, keepdims=False):
+            return self._wrap_function(np.max, axis, out=out, keepdims=keepdims)
 
-    def prod(self, axis=None, dtype=None, out=None, keepdims=False):
-        if self.unit.is_unity():
-            self._prepare_out(out=out)
-            try:
-                value = np.prod(self.value, axis=axis, dtype=dtype,
-                                out=out, keepdims=keepdims)
-            except:  # numpy < 1.7
-                value = np.prod(self.value, axis=axis, dtype=dtype,
-                                out=out)
-            return self._new_view(value)
-        else:
-            raise ValueError("cannot use prod on scaled or "
-                             "non-dimensionless Quantity arrays")
+        def min(self, axis=None, out=None, keepdims=False):
+            return self._wrap_function(np.min, axis, out=out, keepdims=keepdims)
+
+        def sum(self, axis=None, dtype=None, out=None, keepdims=False):
+            return self._wrap_function(np.sum, axis, dtype, out=out,
+                                       keepdims=keepdims)
+
+        def prod(self, axis=None, dtype=None, out=None, keepdims=False):
+            if not self.unit.is_unity():
+                raise ValueError("cannot use prod on scaled or "
+                                 "non-dimensionless Quantity arrays")
+            return self._wrap_function(np.prod, axis, dtype, out=out,
+                                       keepdims=keepdims)
+
+        def dot(self, b, out=None):
+            result_unit = self.unit * getattr(b, 'unit', dimensionless_unscaled)
+            return self._wrap_function(np.dot, b, out=out, unit=result_unit)
+
+    def cumsum(self, axis=None, dtype=None, out=None):
+        return self._wrap_function(np.cumsum, axis, dtype, out=out)
 
     def cumprod(self, axis=None, dtype=None, out=None):
-        if self.unit.is_unity():
-            self._prepare_out(out=out)
-            value = np.cumprod(self.value, axis=axis, dtype=dtype, out=out)
-            return self._new_view(value)
-        else:
+        if not self.unit.is_unity():
             raise ValueError("cannot use cumprod on scaled or "
                              "non-dimensionless Quantity arrays")
+        return self._wrap_function(np.cumprod, axis, dtype, out=out)
+
+
+    # Calculation: override methods that do not make sense.
 
     def all(self, axis=None, out=None):
         raise NotImplementedError("cannot evaluate truth value of quantities. "
@@ -1269,3 +1291,19 @@ class Quantity(np.ndarray):
     def any(self, axis=None, out=None):
         raise NotImplementedError("cannot evaluate truth value of quantities. "
                                   "Evaluate array with q.value.any(...)")
+
+    # Calculation --numpy functions that can be overridden with methods
+
+    def diff(self, n=1, axis=-1):
+        return self._wrap_function(np.diff, n, axis)
+
+    def ediff1d(self, to_end=None, to_begin=None):
+        return self._wrap_function(np.ediff1d, to_end, to_begin)
+
+    if NUMPY_LT_1P8:
+        def nansum(self, axis=None):
+            return self._wrap_function(np.nansum, axis)
+    else:
+        def nansum(self, axis=None, out=None, keepdims=False):
+            return self._wrap_function(np.nansum, axis,
+                                       out=out, keepdims=keepdims)
diff --git a/astropy/units/tests/test_equivalencies.py b/astropy/units/tests/test_equivalencies.py
index bc0e79f..f75b078 100644
--- a/astropy/units/tests/test_equivalencies.py
+++ b/astropy/units/tests/test_equivalencies.py
@@ -13,6 +13,7 @@ from numpy.testing.utils import assert_allclose
 
 # LOCAL
 from ... import units as u
+from ... import constants
 from ...tests.helper import pytest
 
 
@@ -282,20 +283,6 @@ def test_spectral4(in_val, in_unit):
         assert_allclose(b, in_val)
 
 
-def test_spectraldensity():
-    a = u.AA.to(u.Jy, 1, u.spectral_density(u.eV, 2.2))
-    assert_allclose(a, 1059416252057.8357, rtol=1e-4)
-
-    b = u.Jy.to(u.AA, a, u.spectral_density(u.eV, 2.2))
-    assert_allclose(b, 1)
-
-    c = u.AA.to(u.Jy, 1, u.spectral_density(2.2 * u.eV))
-    assert_allclose(c, 1059416252057.8357, rtol=1e-4)
-
-    d = u.Jy.to(u.AA, c, u.spectral_density(2.2 * u.eV))
-    assert_allclose(d, 1)
-
-
 def test_spectraldensity2():
     flambda = u.erg / u.angstrom / u.cm ** 2 / u.s
     fnu = u.erg / u.Hz / u.cm ** 2 / u.s
@@ -464,6 +451,20 @@ def test_equivalency_context():
         with pytest.raises(u.UnitsError):
             phase.to(1, equivalencies=None)
 
+        # test the manager also works in the Quantity constructor.
+        q1 = u.Quantity(phase, u.dimensionless_unscaled)
+        assert_allclose(q1.value, u.cycle.to(u.radian))
+
+        # and also if we use a class that happens to have a unit attribute.
+        class MyQuantityLookalike(np.ndarray):
+            pass
+
+        mylookalike = np.array(1.).view(MyQuantityLookalike)
+        mylookalike.unit = 'cycle'
+        # test the manager also works in the Quantity constructor.
+        q2 = u.Quantity(mylookalike, u.dimensionless_unscaled)
+        assert_allclose(q2.value, u.cycle.to(u.radian))
+
     with u.set_enabled_equivalencies(u.spectral()):
         u.GHz.to(u.cm)
         eq_on = u.GHz.find_equivalent_units()
@@ -516,9 +517,32 @@ def test_temperature():
     assert_allclose(t_k.to(u.deg_C, u.temperature()).value, -273.15)
     assert_allclose(t_k.to(deg_F, u.temperature()).value, -459.67)
 
+
 def test_temperature_energy():
     from ... import constants
     x = 1000 * u.K
     y = (x * constants.k_B).to(u.keV)
-    assert_allclose(x.to(u.keV, u.temperature_energy()).value, y)           
-    assert_allclose(y.to(u.K, u.temperature_energy()).value, x)               
+    assert_allclose(x.to(u.keV, u.temperature_energy()).value, y)
+    assert_allclose(y.to(u.K, u.temperature_energy()).value, x)
+
+
+def test_compose_equivalencies():
+    x = u.Unit("arcsec").compose(units=(u.pc,), equivalencies=u.parallax())
+    assert x[0] == u.pc
+
+    x = u.Unit("2 arcsec").compose(units=(u.pc,), equivalencies=u.parallax())
+    assert x[0] == u.Unit(0.5 * u.pc)
+
+    x = u.degree.compose(equivalencies=u.dimensionless_angles())
+    assert u.Unit(u.degree.to(u.radian)) in x
+
+    x = (u.nm).compose(units=(u.m, u.s), equivalencies=u.doppler_optical(0.55*u.micron))
+    for y in x:
+        if y.bases == [u.m, u.s]:
+            assert y.powers == [1, -1]
+            assert_allclose(
+                y.scale,
+                u.nm.to(u.m / u.s, equivalencies=u.doppler_optical(0.55 * u.micron)))
+            break
+    else:
+        assert False, "Didn't find speed in compose results"
diff --git a/astropy/units/tests/test_quantity.py b/astropy/units/tests/test_quantity.py
index 3b46e16..ba72622 100644
--- a/astropy/units/tests/test_quantity.py
+++ b/astropy/units/tests/test_quantity.py
@@ -182,6 +182,40 @@ class TestQuantityCreation(object):
         q3 = u.Quantity(q1, u.m, ndmin=3)
         assert q3.ndim == 3 and q3.shape == (1, 1, 10)
 
+    def test_non_quantity_with_unit(self):
+        """Test that unit attributes in objects get recognized."""
+        class MyQuantityLookalike(np.ndarray):
+            pass
+
+        a = np.arange(3.)
+        mylookalike = a.copy().view(MyQuantityLookalike)
+        mylookalike.unit = 'm'
+        q1 = u.Quantity(mylookalike)
+        assert isinstance(q1, u.Quantity)
+        assert q1.unit is u.m
+        assert np.all(q1.value == a)
+
+        q2 = u.Quantity(mylookalike, u.mm)
+        assert q2.unit is u.mm
+        assert np.all(q2.value == 1000.*a)
+
+        q3 = u.Quantity(mylookalike, copy=False)
+        assert np.all(q3.value == mylookalike)
+        q3[2] = 0
+        assert q3[2] == 0.
+        assert mylookalike[2] == 0.
+
+        mylookalike = a.copy().view(MyQuantityLookalike)
+        mylookalike.unit = u.m
+        q4 = u.Quantity(mylookalike, u.mm, copy=False)
+        q4[2] = 0
+        assert q4[2] == 0.
+        assert mylookalike[2] == 2.
+
+        mylookalike.unit = 'nonsense'
+        with pytest.raises(TypeError):
+            u.Quantity(mylookalike)
+
 
 class TestQuantityOperations(object):
     q1 = u.Quantity(11.42, u.meter)
@@ -320,6 +354,17 @@ class TestQuantityOperations(object):
         with pytest.raises(u.UnitsError):
             new_q = q1 + q2
 
+    def test_non_number_type(self):
+        q1 = u.Quantity(11.412, unit=u.meter)
+        type_err_msg = ("Unsupported operand type(s) for ufunc add: "
+                        "'Quantity' and 'dict'")
+        with pytest.raises(TypeError) as exc:
+            q1 + {'a': 1}
+        assert exc.value.args[0] == type_err_msg
+
+        with pytest.raises(TypeError):
+            q1 + u.meter
+
     def test_dimensionless_operations(self):
         # test conversion to dimensionless
         dq = 3. * u.m / u.km
@@ -627,6 +672,10 @@ class TestQuantityDisplay(object):
         assert str(self.scalarintq * q3) == "1"
         assert str(self.arrq * q2) == "[ 1.   2.3  8.9]"
 
+    def test_dimensionless_quantity_format(self):
+        q1 = u.Quantity(3.14)
+        assert format(q1, '.2f') == '3.14'
+
     def test_scalar_quantity_str(self):
         assert str(self.scalarintq) == "1 m"
         assert str(self.scalarfloatq) == "1.3 m"
diff --git a/astropy/units/tests/test_quantity_array_methods.py b/astropy/units/tests/test_quantity_array_methods.py
index a40081d..37e3b8b 100644
--- a/astropy/units/tests/test_quantity_array_methods.py
+++ b/astropy/units/tests/test_quantity_array_methods.py
@@ -2,12 +2,12 @@
 # array methods returns quantities with the right units, or raises exceptions.
 
 import numpy as np
-from numpy.testing.utils import assert_allclose
 
 from ... import units as u
 from ...tests.helper import pytest
 
 NUMPY_LT_1P7 = [int(x) for x in np.__version__.split('.')[:2]] < [1, 7]
+NUMPY_LT_1P8 = [int(x) for x in np.__version__.split('.')[:2]] < [1, 8]
 
 
 class TestQuantityArrayCopy(object):
@@ -76,6 +76,54 @@ class TestQuantityArrayCopy(object):
         assert q[2,2] == -1. * u.km / u.s
 
 
+class TestQuantityReshapeFuncs(object):
+    """Test different ndarray methods that alter the array shape
+
+    tests: reshape, squeeze, ravel, flatten, transpose, swapaxes
+    """
+    def test_reshape(self):
+        q = np.arange(6.) * u.m
+        q_reshape = q.reshape(3, 2)
+        assert isinstance(q_reshape, u.Quantity)
+        assert q_reshape.unit == q.unit
+        assert np.all(q_reshape.value == q.value.reshape(3, 2))
+
+    def test_squeeze(self):
+        q = np.arange(6.).reshape(6, 1) * u.m
+        q_squeeze = q.squeeze()
+        assert isinstance(q_squeeze, u.Quantity)
+        assert q_squeeze.unit == q.unit
+        assert np.all(q_squeeze.value == q.value.squeeze())
+
+    def test_ravel(self):
+        q = np.arange(6.).reshape(3, 2) * u.m
+        q_ravel = q.ravel()
+        assert isinstance(q_ravel, u.Quantity)
+        assert q_ravel.unit == q.unit
+        assert np.all(q_ravel.value == q.value.ravel())
+
+    def test_flatten(self):
+        q = np.arange(6.).reshape(3, 2) * u.m
+        q_flatten = q.flatten()
+        assert isinstance(q_flatten, u.Quantity)
+        assert q_flatten.unit == q.unit
+        assert np.all(q_flatten.value == q.value.flatten())
+
+    def test_transpose(self):
+        q = np.arange(6.).reshape(3, 2) * u.m
+        q_transpose = q.transpose()
+        assert isinstance(q_transpose, u.Quantity)
+        assert q_transpose.unit == q.unit
+        assert np.all(q_transpose.value == q.value.transpose())
+
+    def test_swapaxes(self):
+        q = np.arange(6.).reshape(3, 1, 2) * u.m
+        q_swapaxes = q.swapaxes(0, 2)
+        assert isinstance(q_swapaxes, u.Quantity)
+        assert q_swapaxes.unit == q.unit
+        assert np.all(q_swapaxes.value == q.value.swapaxes(0, 2))
+
+
 class TestQuantityStatsFuncs(object):
     """
     Test statistical functions
@@ -88,7 +136,8 @@ class TestQuantityStatsFuncs(object):
     def test_mean_inplace(self):
         q1 = np.array([1., 2., 4., 5., 6.]) * u.m
         qi = 1.5 * u.s
-        np.mean(q1, out=qi)
+        qi2 = np.mean(q1, out=qi)
+        assert qi2 is qi
         assert qi == 3.6 * u.m
 
     def test_std(self):
@@ -97,8 +146,11 @@ class TestQuantityStatsFuncs(object):
 
     def test_std_inplace(self):
 
-        # can't use decorator since test causes a segfault in Numpy < 1.7, and
-        # py.test will run the test anyway to see if it works
+        # For Numpy >= 1.7, inplace causes the variance to be stored instead
+        # of the standard deviation.
+        # see https://github.com/numpy/numpy/issues/5240
+        # For Numpy < 1.7, the test segfaults.  Hence, we cannot use the xfail
+        # decorator since py.test will run the test anyway to see if it works.
         pytest.xfail()
 
         q1 = np.array([1., 2.]) * u.m
@@ -112,8 +164,8 @@ class TestQuantityStatsFuncs(object):
 
     def test_var_inplace(self):
 
-        # can't use decorator since test causes a segfault in Numpy < 1.7, and
-        # py.test will run the test anyway to see if it works
+        # For Numpy < 1.7, the test segfaults.  Hence, we cannot use the xfail
+        # decorator since py.test will run the test anyway to see if it works.
         if NUMPY_LT_1P7:
             pytest.xfail()
 
@@ -188,8 +240,19 @@ class TestQuantityStatsFuncs(object):
         assert qi == 5. * u.m
 
     def test_round(self):
-        q1 = np.array([1.2, 2.2, 3.2]) * u.kg
+        q1 = np.array([1.253, 2.253, 3.253]) * u.kg
         assert np.all(np.round(q1) == np.array([1, 2, 3]) * u.kg)
+        assert np.all(np.round(q1, decimals=2) ==
+                      np.round(q1.value, decimals=2) * u.kg)
+        assert np.all(q1.round(decimals=2) ==
+                      q1.value.round(decimals=2) * u.kg)
+
+    def test_round_inplace(self):
+        q1 = np.array([1.253, 2.253, 3.253]) * u.kg
+        qi = np.zeros(3) * u.s
+        a = q1.round(decimals=2, out=qi)
+        assert a is qi
+        assert np.all(q1.round(decimals=2) == qi)
 
     def test_sum(self):
 
@@ -236,6 +299,20 @@ class TestQuantityStatsFuncs(object):
         assert np.all(q2.nansum(0) == np.array([1., 5., 10.]) * u.s)
         assert np.all(np.nansum(q2, 0) == np.array([1., 5., 10.]) * u.s)
 
+    @pytest.mark.xfail("NUMPY_LT_1P8")
+    def test_nansum_inplace(self):
+
+        q1 = np.array([1., 2., np.nan]) * u.m
+        qi = 1.5 * u.s
+        qout = q1.nansum(out=qi)
+        assert qout is qi
+        assert qi == np.nansum(q1.value) * q1.unit
+
+        qi2 = 1.5 * u.s
+        qout2 = np.nansum(q1, out=qi2)
+        assert qout2 is qi2
+        assert qi2 == np.nansum(q1.value) * q1.unit
+
     def test_prod(self):
 
         q1 = np.array([1, 2, 6]) * u.m
@@ -464,7 +541,7 @@ class TestArrayConversion(object):
             q1.choose([0, 0, 1])
 
         with pytest.raises(NotImplementedError):
-            q1.list()
+            q1.tolist()
         with pytest.raises(NotImplementedError):
             q1.tostring()
         with pytest.raises(NotImplementedError):
diff --git a/astropy/units/tests/test_units.py b/astropy/units/tests/test_units.py
index eeeabbc..b7db63b 100644
--- a/astropy/units/tests/test_units.py
+++ b/astropy/units/tests/test_units.py
@@ -21,6 +21,7 @@ from ...utils.compat.fractions import Fraction
 
 from ... import units as u
 from ... import constants as c
+from .. import utils
 
 
 def test_getting_started():
@@ -283,7 +284,7 @@ def test_complex_compose():
 
 def test_equiv_compose():
     composed = u.m.compose(equivalencies=u.spectral())
-    assert u.Hz in composed
+    assert any([u.Hz] == x.bases for x in composed)
 
 
 def test_empty_compose():
@@ -350,8 +351,8 @@ def test_compose_si_to_cgs():
 
 
 def test_to_cgs():
-    assert u.Pa.to_system(u.cgs)[0]._bases[0] is u.Ba
-    assert u.Pa.to_system(u.cgs)[0]._scale == 10.0
+    assert u.Pa.to_system(u.cgs)[1]._bases[0] is u.Ba
+    assert u.Pa.to_system(u.cgs)[1]._scale == 10.0
 
 
 def test_decompose_to_cgs():
@@ -614,6 +615,10 @@ def test_fractional_powers():
     assert x.powers[0].numerator == 3
     assert x.powers[0].denominator == 7
 
+    x = u.cm ** Fraction(1, 2) * u.cm ** Fraction(2, 3)
+    assert type(x.powers[0]) == Fraction
+    assert x.powers[0] == Fraction(7, 6)
+
 
 def test_inherit_docstrings():
     assert u.UnrecognizedUnit.is_unity.__doc__ == u.UnitBase.is_unity.__doc__
@@ -629,3 +634,18 @@ def test_composite_compose():
     # Issue #2382
     composite_unit = u.s.compose(units=[u.Unit("s")])[0]
     u.s.compose(units=[composite_unit])
+
+
+def test_compare_with_none():
+    # Ensure that equality comparisons with `None` work, and don't
+    # raise exceptions.  We are deliberately not using `is None` here
+    # because that doesn't trigger the bug.  See #3108.
+    assert not (u.m == None)
+    assert u.m != None
+
+
+def test_validate_power_detect_fraction():
+    frac = utils.validate_power(1.1666666666666665)
+    assert type(frac) == Fraction
+    assert frac.numerator == 7
+    assert frac.denominator == 6
diff --git a/astropy/units/utils.py b/astropy/units/utils.py
index 613b074..a25f6d3 100644
--- a/astropy/units/utils.py
+++ b/astropy/units/utils.py
@@ -210,7 +210,23 @@ def validate_power(p, support_tuples=False):
                 scaled = p * float(i)
                 if((scaled + 4. * _float_finfo.eps) % 1.0 <
                    8. * _float_finfo.eps):
-                    p = Fraction(int(scaled), i)
+                    p = Fraction(int(round(scaled)), i)
                     break
 
     return p
+
+
+def add_powers(a, b):
+    """
+    Add two powers together, where either may be a floating point
+    number or a Fraction.  If either is Fraction, they are both
+    converted to Fractions so that rational, rather than
+    floating-point, arithmetic is used.
+    """
+    a_is_fraction = isinstance(a, Fraction)
+    b_is_fraction = isinstance(b, Fraction)
+    if a_is_fraction and not b_is_fraction:
+        b = Fraction(b)
+    elif not a_is_fraction and b_is_fraction:
+        a = Fraction(a)
+    return a + b
diff --git a/astropy/utils/data.py b/astropy/utils/data.py
index aede10f..8d529bb 100644
--- a/astropy/utils/data.py
+++ b/astropy/utils/data.py
@@ -230,13 +230,18 @@ def get_readable_fileobj(name_or_obj, encoding=None, cache=False,
             fileobj = fileobj_new
     elif signature[:3] == b'BZh':  # bzip2
         try:
+            import bz2
+        except ImportError:
+            raise ValueError(
+                ".bz2 format files are not supported since the Python "
+                "interpreter does not include the bz2 module")
+        try:
             # bz2.BZ2File does not support file objects, only filenames, so we
             # need to write the data to a temporary file
             tmp = NamedTemporaryFile("wb", delete=False)
             tmp.write(fileobj.read())
             tmp.close()
             delete_fds.append(tmp)
-            import bz2
             fileobj_new = bz2.BZ2File(tmp.name, mode='rb')
             fileobj_new.read(1)  # need to check that the file is really bzip2
         except IOError:  # invalid bzip2 file
@@ -262,18 +267,22 @@ def get_readable_fileobj(name_or_obj, encoding=None, cache=False,
         # A bz2.BZ2File can not be wrapped by a TextIOWrapper,
         # so we decompress it to a temporary file and then
         # return a handle to that.
-        import bz2
-        if isinstance(fileobj, bz2.BZ2File):
-            tmp = NamedTemporaryFile("wb", delete=False)
-            data = fileobj.read()
-            tmp.write(data)
-            tmp.close()
-            delete_fds.append(tmp)
-            if six.PY3:
-                fileobj = io.FileIO(tmp.name, 'r')
-            elif six.PY2:
-                fileobj = open(tmp.name, 'rb')
-            close_fds.append(fileobj)
+        try:
+            import bz2
+        except ImportError:
+            pass
+        else:
+            if isinstance(fileobj, bz2.BZ2File):
+                tmp = NamedTemporaryFile("wb", delete=False)
+                data = fileobj.read()
+                tmp.write(data)
+                tmp.close()
+                delete_fds.append(tmp)
+                if six.PY3:
+                    fileobj = io.FileIO(tmp.name, 'r')
+                elif six.PY2:
+                    fileobj = open(tmp.name, 'rb')
+                close_fds.append(fileobj)
 
         # On Python 2.x, we need to first wrap the regular `file`
         # instance in a `io.FileIO` object before it can be
diff --git a/astropy/utils/metadata.py b/astropy/utils/metadata.py
index b48331b..3f50ea6 100644
--- a/astropy/utils/metadata.py
+++ b/astropy/utils/metadata.py
@@ -76,7 +76,8 @@ def merge(left, right, merge_func=concat, metadata_conflicts='warn'):
 
         # There is a conflict that must be resolved
         if _both_isinstance(left[key], right[key], dict):
-            out[key] = merge(left[key], right[key], merge_func)
+            out[key] = merge(left[key], right[key], merge_func,
+                             metadata_conflicts=metadata_conflicts)
 
         else:
             try:
diff --git a/astropy/utils/misc.py b/astropy/utils/misc.py
index e2e061c..d35c7c7 100644
--- a/astropy/utils/misc.py
+++ b/astropy/utils/misc.py
@@ -375,7 +375,7 @@ def deprecated(since, message='', name='', alternative='', pending=False,
         needs to be overridden.
     """
 
-    method_types = (classmethod, staticmethod)
+    method_types = (classmethod, staticmethod, types.MethodType)
 
     def deprecate_doc(old_doc, message):
         """
@@ -477,21 +477,15 @@ def deprecated(since, message='', name='', alternative='', pending=False,
         # errors. Picklability is required for any class that is
         # documented by Sphinx.
 
-        def __getstate__(self):
-            return super(cls, self).__getstate__()
+        members = cls.__dict__.copy()
 
-        def __setstate__(self, state):
-            return super(cls, self).__setstate__(state)
-
-        d = {
+        members.update({
             '__doc__': deprecate_doc(cls.__doc__, message),
-            '__init__': deprecate_function(cls.__init__, message),
-            '__module__': cls.__module__,
-            '__getstate__': __getstate__,
-            '__setstate__': __setstate__
-        }
+            '__init__': deprecate_function(get_function(cls.__init__),
+                                           message),
+        })
 
-        return type(cls.__name__, (cls,), d)
+        return type(cls.__name__, cls.__bases__, members)
 
     def deprecate(obj, message=message, name=name, alternative=alternative,
                   pending=pending):
@@ -1030,9 +1024,15 @@ class InheritDocstrings(type):
         u'Wiggle the thingamajig'
     """
     def __init__(cls, name, bases, dct):
+        def is_public_member(key):
+            return (
+                (key.startswith('__') and key.endswith('__')
+                 and len(key) > 4) or
+                not key.startswith('_'))
+
         for key, val in six.iteritems(dct):
             if (inspect.isfunction(val) and
-                not key.startswith('_') and
+                is_public_member(key) and
                 val.__doc__ is None):
                 for base in cls.__mro__[1:]:
                     super_method = getattr(base, key, None)
diff --git a/astropy/utils/setup_package.py b/astropy/utils/setup_package.py
index 0d50153..a2005c6 100644
--- a/astropy/utils/setup_package.py
+++ b/astropy/utils/setup_package.py
@@ -1,4 +1,6 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
+from __future__ import absolute_import
+
 from distutils.core import Extension
 from os.path import dirname, join, relpath
 
diff --git a/astropy/utils/tests/test_data.py b/astropy/utils/tests/test_data.py
index ab62cd0..4fd6e87 100644
--- a/astropy/utils/tests/test_data.py
+++ b/astropy/utils/tests/test_data.py
@@ -22,6 +22,14 @@ TESTURL = 'http://www.astropy.org'
 # General file object function
 
 
+try:
+    import bz2
+except ImportError:
+    HAS_BZ2 = False
+else:
+    HAS_BZ2 = True
+
+
 @remote_data
 def test_download_nocache():
     from ..data import download_file
@@ -94,17 +102,29 @@ def test_find_by_hash():
 def test_local_data_obj(filename):
     from ..data import get_pkg_data_fileobj
 
-    with get_pkg_data_fileobj(os.path.join('data', filename), encoding='binary') as f:
-        f.readline()
-        assert f.read().rstrip() == b'CONTENT'
+    try:
+        with get_pkg_data_fileobj(os.path.join('data', filename), encoding='binary') as f:
+            f.readline()
+            assert f.read().rstrip() == b'CONTENT'
+    except ValueError:
+        if not HAS_BZ2 and 'bz2' in filename:
+            pass
+        else:
+            raise
 
 
 @pytest.mark.parametrize(('filename'), ['invalid.dat.gz', 'invalid.dat.bz2'])
 def test_local_data_obj_invalid(filename):
     from ..data import get_pkg_data_fileobj
 
-    with get_pkg_data_fileobj(os.path.join('data', filename), encoding='binary') as f:
-        assert f.read().rstrip().endswith(b'invalid')
+    try:
+        with get_pkg_data_fileobj(os.path.join('data', filename), encoding='binary') as f:
+            assert f.read().rstrip().endswith(b'invalid')
+    except ValueError:
+        if not HAS_BZ2 and 'bz2' in filename:
+            pass
+        else:
+            raise
 
 
 def test_local_data_name():
diff --git a/astropy/utils/tests/test_metadata.py b/astropy/utils/tests/test_metadata.py
index 6ca0abb..1a2098a 100644
--- a/astropy/utils/tests/test_metadata.py
+++ b/astropy/utils/tests/test_metadata.py
@@ -1,6 +1,6 @@
 import abc
 
-from ..metadata import MetaData
+from ..metadata import MetaData, MergeConflictError, merge
 from ..compat.odict import OrderedDict
 from ...tests.helper import pytest
 from ...io import fits
@@ -71,3 +71,18 @@ class ExampleData(object):
 class TestMetaExampleData(MetaBaseTest):
     test_class = ExampleData
     args = ()
+
+
+def test_metadata_merging_conflict_exception():
+    """Regression test for issue #3294.
+
+    Ensure that an exception is raised when a metadata conflict exists
+    and ``metadata_conflicts='error'`` has been set.
+    """
+    from ..metadata import merge, MergeConflictError
+    data1 = ExampleData()
+    data2 = ExampleData()
+    data1.meta['somekey'] = {'x': 1, 'y': 1}
+    data2.meta['somekey'] = {'x': 1, 'y': 999}
+    with pytest.raises(MergeConflictError):
+        merge(data1.meta, data2.meta, metadata_conflicts='error')
diff --git a/astropy/utils/tests/test_misc.py b/astropy/utils/tests/test_misc.py
index 2167d74..7e13751 100644
--- a/astropy/utils/tests/test_misc.py
+++ b/astropy/utils/tests/test_misc.py
@@ -14,6 +14,7 @@ import numpy as np
 from .. import data, misc
 from ..exceptions import AstropyDeprecationWarning
 from ...tests.helper import remote_data, catch_warnings
+from ...extern import six
 
 
 def test_pkg_finder():
@@ -142,6 +143,28 @@ def test_deprecated_class():
     pickle.dumps(TestA)
 
 
+def test_deprecated_class_with_super():
+    """
+    Regression test for an issue where classes that used `super()` in their
+    ``__init__`` did not actually call the correct class's ``__init__`` in the
+    MRO.
+    """
+
+    @misc.deprecated('100.0')
+    class TestB(object):
+        def __init__(self, a, b):
+            super(TestB, self).__init__()
+
+    with catch_warnings(AstropyDeprecationWarning) as w:
+        TestB(1, 2)
+
+    assert len(w) == 1
+    assert 'function' not in TestB.__doc__
+    assert 'deprecated' in TestB.__doc__
+    assert 'function' not in TestB.__init__.__doc__
+    assert 'deprecated' in TestB.__init__.__doc__
+
+
 def test_deprecated_static_and_classmethod():
     """
     Regression test for issue introduced by
@@ -206,3 +229,17 @@ def test_JsonCustomEncoder():
                       cls=misc.JsonCustomEncoder) == '"hello world \\u00c5"'
     assert json.dumps({1: 2},
                       cls=misc.JsonCustomEncoder) == '{"1": 2}'  # default
+
+
+def test_inherit_docstrings():
+    @six.add_metaclass(misc.InheritDocstrings)
+    class Base(object):
+        def __call__(self, *args):
+            "FOO"
+            pass
+
+    class Subclass(Base):
+        def __call__(self, *args):
+            pass
+
+    assert Subclass.__call__.__doc__ == "FOO"
diff --git a/astropy/utils/xml/setup_package.py b/astropy/utils/xml/setup_package.py
index d14d078..d9856f4 100644
--- a/astropy/utils/xml/setup_package.py
+++ b/astropy/utils/xml/setup_package.py
@@ -1,4 +1,6 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
+from __future__ import absolute_import
+
 from distutils.core import Extension
 from os.path import join
 import sys
diff --git a/astropy/version.py b/astropy/version.py
index dbe05d6..fec9154 100644
--- a/astropy/version.py
+++ b/astropy/version.py
@@ -1,4 +1,4 @@
-# Autogenerated by Astropy's setup.py on 2014-09-23 16:52:03.229211
+# Autogenerated by Astropy's setup.py on 2015-01-15 17:12:53.686773
 
 
 import locale
@@ -72,7 +72,7 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
     Returns
     -------
     devversion : str
-        Either a string with the revsion number (if `sha` is False), the
+        Either a string with the revision number (if `sha` is False), the
         SHA1 hash of the current commit (if `sha` is True), or an empty string
         if git version info could not be identified.
 
@@ -128,7 +128,7 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
 
     if not sha and returncode == 129:
         # git returns 129 if a command option failed to parse; in
-        # particualr this could happen in git versions older than 1.7.2
+        # particular this could happen in git versions older than 1.7.2
         # where the --count option is not supported
         # Also use --abbrev-commit and --abbrev=0 to display the minimum
         # number of characters needed per-commit (rather than the full hash)
@@ -145,15 +145,17 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
     else:
         return _decode_stdio(stdout).strip()
 
-_last_generated_version = '0.4.2'
+_last_generated_version = '0.4.3'
+_last_githash = u'1e72198f737d96f8076f314bbac0a7c536e2fae8'
 
 version = update_git_devstr(_last_generated_version)
-githash = get_git_devstr(sha=True, show_warning=False)
+githash = get_git_devstr(sha=True, show_warning=False,
+                         path=__file__) or _last_githash
 
 
 major = 0
 minor = 4
-bugfix = 2
+bugfix = 3
 
 release = True
 debug = False
diff --git a/astropy/vo/samp/integrated_client.py b/astropy/vo/samp/integrated_client.py
index 43f3b88..d273ba8 100644
--- a/astropy/vo/samp/integrated_client.py
+++ b/astropy/vo/samp/integrated_client.py
@@ -88,9 +88,29 @@ class SAMPIntegratedClient(object):
 
         self.hub = SAMPHubProxy()
 
-        self.client = SAMPClient(self.hub, name, description, metadata, addr,
-                                 port, https, key_file, cert_file, cert_reqs,
-                                 ca_certs, ssl_version, callable)
+        self.client_arguments = {
+            'name': name,
+            'description': description,
+            'metadata': metadata,
+            'addr': addr,
+            'port': port,
+            'https': https,
+            'key_file': key_file,
+            'cert_file': cert_file,
+            'cert_reqs': cert_reqs,
+            'ca_certs': ca_certs,
+            'ssl_version': ssl_version,
+            'callable': callable,
+        }
+        """
+        Collected arguments that should be passed on to the SAMPClient below.
+        The SAMPClient used to be instantiated in __init__; however, this
+        caused problems with disconnecting and reconnecting to the HUB.
+        The client_arguments is used to maintain backwards compatibility.
+        """
+
+        self.client = None
+        "The client will be instantiated upon connect()."
 
     # GENERAL
 
@@ -162,6 +182,16 @@ class SAMPIntegratedClient(object):
         """
         self.hub.connect(hub, hub_params, key_file, cert_file,
                          cert_reqs, ca_certs, ssl_version, pool_size)
+
+        # The client has to be instantiated here and not in __init__() because
+        # this allows disconnecting and reconnecting to the HUB. Nonetheless,
+        # the client_arguments are set in __init__() because the
+        # instantiation of the client used to happen there and this retains
+        # backwards compatibility.
+        self.client = SAMPClient(
+            self.hub,
+            **self.client_arguments
+        )
         self.client.start()
         self.client.register()
 
diff --git a/astropy/vo/samp/setup_package.py b/astropy/vo/samp/setup_package.py
index e693829..ae10d76 100644
--- a/astropy/vo/samp/setup_package.py
+++ b/astropy/vo/samp/setup_package.py
@@ -1,4 +1,5 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
+from __future__ import absolute_import
 
 import os
 
diff --git a/astropy/vo/samp/tests/test_client.py b/astropy/vo/samp/tests/test_client.py
index 4b56bb5..e4c7c0e 100644
--- a/astropy/vo/samp/tests/test_client.py
+++ b/astropy/vo/samp/tests/test_client.py
@@ -1,8 +1,11 @@
 # Licensed under a 3-clause BSD style license - see LICENSE.rst
 
+import pytest
+
 from ..hub_proxy import SAMPHubProxy
 from ..client import SAMPClient
 from ..integrated_client import SAMPIntegratedClient
+from ..hub import SAMPHubServer
 
 # By default, tests should not use the internet.
 from .. import conf
@@ -25,3 +28,23 @@ def test_SAMPClient():
 def test_SAMPIntegratedClient():
     """Test that SAMPIntegratedClient can be instantiated"""
     SAMPIntegratedClient()
+
+
+ at pytest.fixture
+def samp_hub(request):
+    """A fixture that can be used by client tests that require a HUB."""
+    my_hub = SAMPHubServer()
+    my_hub.start()
+    request.addfinalizer(my_hub.stop)
+
+
+def test_reconnect(samp_hub):
+    """Test that SAMPIntegratedClient can reconnect.
+    This is a regression test for bug [#2673]
+    https://github.com/astropy/astropy/issues/2673
+    """
+    my_client = SAMPIntegratedClient()
+    my_client.connect()
+    my_client.disconnect()
+    my_client.connect()
+
diff --git a/astropy/wcs/src/wcslib_wrap.c b/astropy/wcs/src/wcslib_wrap.c
index bb9ca39..9826c6b 100644
--- a/astropy/wcs/src/wcslib_wrap.c
+++ b/astropy/wcs/src/wcslib_wrap.c
@@ -1456,7 +1456,7 @@ PyWcsprm_s2p(
   /* unoffset_array(world, origin); */
   unoffset_array(pixcrd, origin);
   unoffset_array(imgcrd, origin);
-  if (status == 8) {
+  if (status == 9) {
     set_invalid_to_nan(
         ncoord, 1, (double*)PyArray_DATA(phi), (int*)PyArray_DATA(stat));
     set_invalid_to_nan(
diff --git a/astropy/wcs/tests/test_utils.py b/astropy/wcs/tests/test_utils.py
index 98801e3..45c96ca 100644
--- a/astropy/wcs/tests/test_utils.py
+++ b/astropy/wcs/tests/test_utils.py
@@ -58,7 +58,7 @@ def test_wcs_swapping():
 @pytest.mark.parametrize('ndim',(2,3))
 def test_add_stokes(ndim):
     wcs = WCS(naxis=ndim)
-    
+
     for ii in range(ndim+1):
         outwcs = utils.add_stokes_axis_to_wcs(wcs,ii)
         assert outwcs.wcs.naxis == ndim+1
@@ -133,7 +133,7 @@ def test_invalid_slice():
 def test_axis_names():
     mywcs = WCS(naxis=4)
     mywcs.wcs.ctype = ['RA---TAN','DEC---TAN','VOPT-LSR','STOKES']
-    
+
     assert mywcs.axis_type_names == ['RA','DEC','VOPT','STOKES']
 
     mywcs.wcs.cname = ['RA','DEC','VOPT-LSR','STOKES']
diff --git a/astropy/wcs/tests/test_wcs.py b/astropy/wcs/tests/test_wcs.py
index ed11fea..9ba6cef 100644
--- a/astropy/wcs/tests/test_wcs.py
+++ b/astropy/wcs/tests/test_wcs.py
@@ -6,8 +6,8 @@ from __future__ import absolute_import, division, print_function, unicode_litera
 
 from ...extern import six
 
+import io
 import os
-import sys
 import warnings
 
 import numpy as np
@@ -19,7 +19,7 @@ from ... import wcs
 from ...utils.data import (
     get_pkg_data_filenames, get_pkg_data_contents, get_pkg_data_filename)
 from ...utils.misc import NumpyRNGContext
-from ...utils.exceptions import AstropyDeprecationWarning
+from ...io import fits
 
 try:
     import scipy  # pylint: disable=W0611
@@ -565,6 +565,7 @@ def test_sip():
     assert_allclose(200, x1, 1e-3)
     assert_allclose(200, y1, 1e-3)
 
+
 def test_printwcs():
     """
     Just make sure that it runs
@@ -575,3 +576,55 @@ def test_printwcs():
     h = get_pkg_data_contents('data/3d_cd.hdr', encoding='binary')
     w = wcs.WCS(h)
     w.printwcs()
+
+
+def test_invalid_spherical():
+    header = six.text_type("""
+SIMPLE  =                    T / conforms to FITS standard
+BITPIX  =                    8 / array data type
+WCSAXES =                    2 / no comment
+CTYPE1  = 'RA---TAN' / TAN (gnomic) projection
+CTYPE2  = 'DEC--TAN' / TAN (gnomic) projection
+EQUINOX =               2000.0 / Equatorial coordinates definition (yr)
+LONPOLE =                180.0 / no comment
+LATPOLE =                  0.0 / no comment
+CRVAL1  =        16.0531567459 / RA  of reference point
+CRVAL2  =        23.1148929108 / DEC of reference point
+CRPIX1  =                 2129 / X reference pixel
+CRPIX2  =                 1417 / Y reference pixel
+CUNIT1  = 'deg     ' / X pixel scale units
+CUNIT2  = 'deg     ' / Y pixel scale units
+CD1_1   =    -0.00912247310646 / Transformation matrix
+CD1_2   =    -0.00250608809647 / no comment
+CD2_1   =     0.00250608809647 / no comment
+CD2_2   =    -0.00912247310646 / no comment
+IMAGEW  =                 4256 / Image width,  in pixels.
+IMAGEH  =                 2832 / Image height, in pixels.
+""")
+
+    f = io.StringIO(header)
+    header = fits.Header.fromtextfile(f)
+
+    w = wcs.WCS(header)
+    x, y = w.wcs_world2pix(211, -26, 0)
+    assert np.isnan(x) and np.isnan(y)
+
+
+def test_no_iteration():
+
+    # Regression test for #3066
+
+    w = wcs.WCS(naxis=2)
+
+    with pytest.raises(TypeError) as exc:
+        iter(w)
+    assert exc.value.args[0] == "'WCS' object is not iterable"
+
+    class NewWCS(wcs.WCS):
+        pass
+
+    w = NewWCS(naxis=2)
+
+    with pytest.raises(TypeError) as exc:
+        iter(w)
+    assert exc.value.args[0] == "'NewWCS' object is not iterable"
diff --git a/astropy/wcs/wcs.py b/astropy/wcs/wcs.py
index a99f889..842f9ac 100644
--- a/astropy/wcs/wcs.py
+++ b/astropy/wcs/wcs.py
@@ -1997,6 +1997,12 @@ naxis kwarg.
         # (wcs[i] -> wcs.sub([i+1])
         return self.slice(item)
 
+    def __iter__(self):
+        # Having __getitem__ makes Python think WCS is iterable. However,
+        # Python first checks whether __iter__ is present, so we can raise an
+        # exception here.
+        raise TypeError("'{0}' object is not iterable".format(self.__class__.__name__))
+
     @property
     def axis_type_names(self):
         """
diff --git a/astropy_helpers/.coveragerc b/astropy_helpers/.coveragerc
deleted file mode 100644
index a7bdfb4..0000000
--- a/astropy_helpers/.coveragerc
+++ /dev/null
@@ -1,21 +0,0 @@
-[run]
-source =
-    astropy_helpers
-    ah_bootstrap
-
-omit = astropy_helpers/tests*
-
-[report]
-exclude_lines =
-   # Have to re-enable the standard pragma
-   pragma: no cover
-
-   # Don't complain about packages we have installed
-   except ImportError
-
-   # Don't complain if tests don't hit assertions
-   raise AssertionError
-   raise NotImplementedError
-
-   # Don't complain about script hooks
-   def main\(.*\):
diff --git a/astropy_helpers/.travis.yml b/astropy_helpers/.travis.yml
deleted file mode 100644
index b2abf83..0000000
--- a/astropy_helpers/.travis.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-language: python
-
-python:
-    - 2.6
-    - 2.7
-    - 3.2
-    - 3.3
-    - 3.4
-
-env:
-    global:
-        - PIP_WHEEL_COMMAND="pip install --find-links http://wheels.astropy.org/ --use-wheel"
-
-before_install:
-
-    # Use utf8 encoding. Should be default, but this is insurance against
-    # future changes
-    - export PYTHONIOENCODING=UTF8
-
-    # Install the pip that supports wheel
-    - pip install setuptools --upgrade
-    - pip install pip --upgrade
-    - pip install wheel
-
-install:
-    - $PIP_WHEEL_COMMAND "pytest<2.6"
-    - $PIP_WHEEL_COMMAND "--upgrade" "py"
-    - $PIP_WHEEL_COMMAND "Jinja2<2.7"
-    - $PIP_WHEEL_COMMAND "Sphinx"
-    - $PIP_WHEEL_COMMAND "pytest-cov"
-    - $PIP_WHEEL_COMMAND "coveralls"
-    - $PIP_WHEEL_COMMAND "Cython"
-
-before_script:
-    # Some of the tests use git commands that require a user to be configured
-    - git config --global user.name "A U Thor"
-    - git config --global user.email "author at example.com"
-
-script:
-    - py.test
-
-after_success:
-    - coveralls
diff --git a/astropy_helpers/CHANGES.rst b/astropy_helpers/CHANGES.rst
deleted file mode 100644
index e624b98..0000000
--- a/astropy_helpers/CHANGES.rst
+++ /dev/null
@@ -1,61 +0,0 @@
-astropy-helpers Changelog
-=========================
-
-0.4.2 (2014-08-09)
-------------------
-
-- Fixed some CSS issues in generated API docs. [#69]
-
-- Fixed the warning message that could be displayed when generating a
-  version number with some older versions of git. [#77]
-
-- Fixed automodsumm to work with new versions of Sphinx (>= 1.2.2). [#80]
-
-
-0.4.1 (2014-08-06)
-------------------
-
-- Fixed git revision count on systems with git versions older than v1.7.2.
-  [#70]
-
-- Fixed display of warning text when running a git command fails (previously
-  the output of stderr was not being decoded properly). [#70]
-
-- The ``--offline`` flag to ``setup.py`` understood by ``ah_bootstrap.py``
-  now also prevents git from going online to fetch submodule updates. [#67]
-
-- The Sphinx extension for converting issue numbers to links in the changelog
-  now supports working on arbitrary pages via a new ``conf.py`` setting:
-  ``changelog_links_docpattern``.  By default it affects the ``changelog``
-  and ``whatsnew`` pages in one's Sphinx docs. [#61]
-
-- Fixed crash that could result from users with missing/misconfigured
-  locale settings. [#58]
-
-- The font used for code examples in the docs is now the
-  system-defined ``monospace`` font, rather than ``Minaco``, which is
-  not available on all platforms. [#50]
-
-
-0.4 (2014-07-15)
-----------------
-
-- Initial release of astropy-helpers.  See `APE4
-  <https://github.com/astropy/astropy-APEs/blob/master/APE4.rst>`_ for
-  details of the motivation and design of this package.
-
-- The ``astropy_helpers`` package replaces the following modules in the
-  ``astropy`` package:
-
-  - ``astropy.setup_helpers`` -> ``astropy_helpers.setup_helpers``
-
-  - ``astropy.version_helpers`` -> ``astropy_helpers.version_helpers``
-
-  - ``astropy.sphinx`` - > ``astropy_helpers.sphinx``
-
-  These modules should be considered deprecated in ``astropy``, and any new,
-  non-critical changes to those modules will be made in ``astropy_helpers``
-  instead.  Affiliated packages wishing to make use those modules (as in the
-  Astropy package-template) should use the versions from ``astropy_helpers``
-  instead, and include the ``ah_bootstrap.py`` script in their project, for
-  bootstrapping the ``astropy_helpers`` package in their setup.py script.
diff --git a/astropy_helpers/CONTRIBUTING.md b/astropy_helpers/CONTRIBUTING.md
deleted file mode 100644
index de6973c..0000000
--- a/astropy_helpers/CONTRIBUTING.md
+++ /dev/null
@@ -1,20 +0,0 @@
-Contributing to astropy-helpers
-===============================
-
-The guidelines for contributing to ``astropy-helpers`` are generally the same
-as the [contributing guidelines for the astropy core
-package](http://github.com/astropy/astropy/blob/master/CONTRIBUTING.md).
-Basically, report relevant issues in the ``astropy-helpers`` issue tracker, and
-we welcome pull requests that broadly follow the [Astropy coding
-guidelines](http://docs.astropy.org/en/latest/development/codeguide.html).
-
-The key subtlety lies in understanding the relationship between ``astropy`` and
-``astropy-helpers``.  This package contains the build, installation, and
-documentation tools used by astropy.  It also includes support for the
-``setup.py test`` command, though Astropy is still required for this to
-function (it does not currently include the full Astropy test runner).  So
-issues or improvements to that functionality should be addressed in this
-package. Any other aspect of the [astropy core
-package](http://github.com/astropy/astropy) (or any other package that uses
-``astropy-helpers``) should be addressed in the github repository for that
-package.
diff --git a/astropy_helpers/LICENSE.rst b/astropy_helpers/LICENSE.rst
deleted file mode 100644
index b618744..0000000
--- a/astropy_helpers/LICENSE.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 2014, Astropy Developers
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice, this
-  list of conditions and the following disclaimer in the documentation and/or
-  other materials provided with the distribution.
-* Neither the name of the Astropy Team nor the names of its contributors may be
-  used to endorse or promote products derived from this software without
-  specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/astropy_helpers/MANIFEST.in b/astropy_helpers/MANIFEST.in
deleted file mode 100644
index b12416c..0000000
--- a/astropy_helpers/MANIFEST.in
+++ /dev/null
@@ -1,10 +0,0 @@
-include README.rst
-include CHANGES.rst
-include LICENSE.rst
-
-include ez_setup.py
-include ah_bootstrap.py
-
-exclude *.pyc *.o
-prune build
-prune astropy_helpers/tests
diff --git a/astropy_helpers/README.rst b/astropy_helpers/README.rst
deleted file mode 100644
index b8657c1..0000000
--- a/astropy_helpers/README.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-astropy-helpers
-===============
-
-This project provides a Python package, ``astropy_helpers``, which includes
-many build, installation, and documentation-related tools used by the Astropy
-project, but packaged separately for use by other projects that wish to
-leverage this work.  The motivation behind this package and details of its
-implementation are in the accepted 
-`Astropy Proposal for Enhancement (APE) 4 <https://github.com/embray/astropy-APEs/blob/astropy-helpers/APE4.rst>`_.
-
-``astropy_helpers`` includes a special "bootstrap" module called
-``ah_bootstrap.py`` which is intended to be used by a project's setup.py in
-order to ensure that the ``astropy_helpers`` package is available for
-build/installation.  This is similar to the ``ez_setup.py`` module that is
-shipped with some projects to bootstrap `setuptools
-<https://bitbucket.org/pypa/setuptools>`_.
-
-As described in APE4, the version numbers for ``astropy_helpers`` follow the
-corresponding major/minor version of the `astropy core package
-<http://www.astropy.org/>`_, but with an independent sequence of micro (bugfix)
-version numbers. Hence, the initial release is 0.4, in parallel with Astropy
-v0.4, which will be the first version  of Astropy to use ``astropy-helpers``.
-
-For examples of how to implement ``astropy-helpers`` in a project,
-see the ``setup.py`` and ``setup.cfg`` files of the 
-`Affiliated package template <https://github.com/astropy/package-template>`_.
diff --git a/astropy_helpers/ah_bootstrap.py b/astropy_helpers/ah_bootstrap.py
deleted file mode 100644
index fdf64fb..0000000
--- a/astropy_helpers/ah_bootstrap.py
+++ /dev/null
@@ -1,748 +0,0 @@
-"""
-This bootstrap module contains code for ensuring that the astropy_helpers
-package will be importable by the time the setup.py script runs.  It also
-includes some workarounds to ensure that a recent-enough version of setuptools
-is being used for the installation.
-
-This module should be the first thing imported in the setup.py of distributions
-that make use of the utilities in astropy_helpers.  If the distribution ships
-with its own copy of astropy_helpers, this module will first attempt to import
-from the shipped copy.  However, it will also check PyPI to see if there are
-any bug-fix releases on top of the current version that may be useful to get
-past platform-specific bugs that have been fixed.  When running setup.py, use
-the ``--offline`` command-line option to disable the auto-upgrade checks.
-
-When this module is imported or otherwise executed it automatically calls a
-main function that attempts to read the project's setup.cfg file, which it
-checks for a configuration section called ``[ah_bootstrap]`` the presences of
-that section, and options therein, determine the next step taken:  If it
-contains an option called ``auto_use`` with a value of ``True``, it will
-automatically call the main function of this module called
-`use_astropy_helpers` (see that function's docstring for full details).
-Otherwise no further action is taken (however,
-``ah_bootstrap.use_astropy_helpers`` may be called manually from within the
-setup.py script).
-
-Additional options in the ``[ah_boostrap]`` section of setup.cfg have the same
-names as the arguments to `use_astropy_helpers`, and can be used to configure
-the bootstrap script when ``auto_use = True``.
-
-See https://github.com/astropy/astropy-helpers for more details, and for the
-latest version of this module.
-"""
-
-import contextlib
-import errno
-import imp
-import io
-import locale
-import os
-import re
-import subprocess as sp
-import sys
-
-try:
-    from ConfigParser import ConfigParser, RawConfigParser
-except ImportError:
-    from configparser import ConfigParser, RawConfigParser
-
-
-if sys.version_info[0] < 3:
-    _str_types = (str, unicode)
-    _text_type = unicode
-    PY3 = False
-else:
-    _str_types = (str, bytes)
-    _text_type = str
-    PY3 = True
-
-# Some pre-setuptools checks to ensure that either distribute or setuptools >=
-# 0.7 is used (over pre-distribute setuptools) if it is available on the path;
-# otherwise the latest setuptools will be downloaded and bootstrapped with
-# ``ez_setup.py``.  This used to be included in a separate file called
-# setuptools_bootstrap.py; but it was combined into ah_bootstrap.py
-try:
-    import pkg_resources
-    _setuptools_req = pkg_resources.Requirement.parse('setuptools>=0.7')
-    # This may raise a DistributionNotFound in which case no version of
-    # setuptools or distribute is properly installed
-    _setuptools = pkg_resources.get_distribution('setuptools')
-    if _setuptools not in _setuptools_req:
-        # Older version of setuptools; check if we have distribute; again if
-        # this results in DistributionNotFound we want to give up
-        _distribute = pkg_resources.get_distribution('distribute')
-        if _setuptools != _distribute:
-            # It's possible on some pathological systems to have an old version
-            # of setuptools and distribute on sys.path simultaneously; make
-            # sure distribute is the one that's used
-            sys.path.insert(1, _distribute.location)
-            _distribute.activate()
-            imp.reload(pkg_resources)
-except:
-    # There are several types of exceptions that can occur here; if all else
-    # fails bootstrap and use the bootstrapped version
-    from ez_setup import use_setuptools
-    use_setuptools()
-
-from distutils import log
-from distutils.debug import DEBUG
-
-# In case it didn't successfully import before the ez_setup checks
-import pkg_resources
-
-from setuptools import Distribution
-from setuptools.package_index import PackageIndex
-from setuptools.sandbox import run_setup
-
-# TODO: Maybe enable checking for a specific version of astropy_helpers?
-DIST_NAME = 'astropy-helpers'
-PACKAGE_NAME = 'astropy_helpers'
-
-# Defaults for other options
-DOWNLOAD_IF_NEEDED = True
-INDEX_URL = 'https://pypi.python.org/simple'
-USE_GIT = True
-AUTO_UPGRADE = True
-
-
-def use_astropy_helpers(path=None, download_if_needed=None, index_url=None,
-                        use_git=None, auto_upgrade=None):
-    """
-    Ensure that the `astropy_helpers` module is available and is importable.
-    This supports automatic submodule initialization if astropy_helpers is
-    included in a project as a git submodule, or will download it from PyPI if
-    necessary.
-
-    Parameters
-    ----------
-
-    path : str or None, optional
-        A filesystem path relative to the root of the project's source code
-        that should be added to `sys.path` so that `astropy_helpers` can be
-        imported from that path.
-
-        If the path is a git submodule it will automatically be initialzed
-        and/or updated.
-
-        The path may also be to a ``.tar.gz`` archive of the astropy_helpers
-        source distribution.  In this case the archive is automatically
-        unpacked and made temporarily available on `sys.path` as a ``.egg``
-        archive.
-
-        If `None` skip straight to downloading.
-
-    download_if_needed : bool, optional
-        If the provided filesystem path is not found an attempt will be made to
-        download astropy_helpers from PyPI.  It will then be made temporarily
-        available on `sys.path` as a ``.egg`` archive (using the
-        ``setup_requires`` feature of setuptools.  If the ``--offline`` option
-        is given at the command line the value of this argument is overridden
-        to `False`.
-
-    index_url : str, optional
-        If provided, use a different URL for the Python package index than the
-        main PyPI server.
-
-    use_git : bool, optional
-        If `False` no git commands will be used--this effectively disables
-        support for git submodules. If the ``--no-git`` option is given at the
-        command line the value of this argument is overridden to `False`.
-
-    auto_upgrade : bool, optional
-        By default, when installing a package from a non-development source
-        distribution ah_boostrap will try to automatically check for patch
-        releases to astropy-helpers on PyPI and use the patched version over
-        any bundled versions.  Setting this to `False` will disable that
-        functionality. If the ``--offline`` option is given at the command line
-        the value of this argument is overridden to `False`.
-    """
-
-    # True by default, unless the --offline option was provided on the command
-    # line
-    if '--offline' in sys.argv:
-        download_if_needed = False
-        auto_upgrade = False
-        offline = True
-        sys.argv.remove('--offline')
-    else:
-        offline = False
-
-    if '--no-git' in sys.argv:
-        use_git = False
-        sys.argv.remove('--no-git')
-
-    if path is None:
-        path = PACKAGE_NAME
-
-    if download_if_needed is None:
-        download_if_needed = DOWNLOAD_IF_NEEDED
-
-    if index_url is None:
-        index_url = INDEX_URL
-
-    if use_git is None:
-        use_git = USE_GIT
-
-    if auto_upgrade is None:
-        auto_upgrade = AUTO_UPGRADE
-
-    # Declared as False by default--later we check if astropy-helpers can be
-    # upgraded from PyPI, but only if not using a source distribution (as in
-    # the case of import from a git submodule)
-    is_submodule = False
-
-    if not isinstance(path, _str_types):
-        if path is not None:
-            raise TypeError('path must be a string or None')
-
-        if not download_if_needed:
-            log.debug('a path was not given and download from PyPI was not '
-                      'allowed so this is effectively a no-op')
-            return
-    elif not os.path.exists(path) or os.path.isdir(path):
-        # Even if the given path does not exist on the filesystem, if it *is* a
-        # submodule, `git submodule init` will create it
-        is_submodule = _check_submodule(path, use_git=use_git,
-                                        offline=offline)
-
-        if is_submodule or os.path.isdir(path):
-            log.info(
-                'Attempting to import astropy_helpers from {0} {1!r}'.format(
-                    'submodule' if is_submodule else 'directory', path))
-            dist = _directory_import(path)
-        else:
-            dist = None
-
-        if dist is None:
-            msg = (
-                'The requested path {0!r} for importing {1} does not '
-                'exist, or does not contain a copy of the {1} package.  '
-                'Attempting download instead.'.format(path, PACKAGE_NAME))
-            if download_if_needed:
-                log.warn(msg)
-            else:
-                raise _AHBootstrapSystemExit(msg)
-    elif os.path.isfile(path):
-        # Handle importing from a source archive; this also uses setup_requires
-        # but points easy_install directly to the source archive
-        try:
-            dist = _do_download(find_links=[path])
-        except Exception as e:
-            if download_if_needed:
-                log.warn('{0}\nWill attempt to download astropy_helpers from '
-                         'PyPI instead.'.format(str(e)))
-                dist = None
-            else:
-                raise _AHBootstrapSystemExit(e.args[0])
-    else:
-        msg = ('{0!r} is not a valid file or directory (it could be a '
-               'symlink?)'.format(path))
-        if download_if_needed:
-            log.warn(msg)
-            dist = None
-        else:
-            raise _AHBootstrapSystemExit(msg)
-
-    if dist is not None and auto_upgrade and not is_submodule:
-        # A version of astropy-helpers was found on the available path, but
-        # check to see if a bugfix release is available on PyPI
-        upgrade = _do_upgrade(dist, index_url)
-        if upgrade is not None:
-            dist = upgrade
-    elif dist is None:
-        # Last resort--go ahead and try to download the latest version from
-        # PyPI
-        try:
-            if download_if_needed:
-                log.warn(
-                    "Downloading astropy_helpers; run setup.py with the "
-                    "--offline option to force offline installation.")
-                dist = _do_download(index_url=index_url)
-            else:
-                raise _AHBootstrapSystemExit(
-                    "No source for the astropy_helpers package; "
-                    "astropy_helpers must be available as a prerequisite to "
-                    "installing this package.")
-        except Exception as e:
-            if DEBUG:
-                raise
-            else:
-                raise _AHBootstrapSystemExit(e.args[0])
-
-    if dist is not None:
-        # Otherwise we found a version of astropy-helpers so we're done
-        # Just activate the found distribibution on sys.path--if we did a
-        # download this usually happens automatically but do it again just to
-        # be sure
-        # Note: Adding the dist to the global working set also activates it by
-        # default
-        pkg_resources.working_set.add(dist)
-
-
-def _do_download(version='', find_links=None, index_url=None):
-    try:
-        if find_links:
-            allow_hosts = ''
-            index_url = None
-        else:
-            allow_hosts = None
-        # Annoyingly, setuptools will not handle other arguments to
-        # Distribution (such as options) before handling setup_requires, so it
-        # is not straightfoward to programmatically augment the arguments which
-        # are passed to easy_install
-        class _Distribution(Distribution):
-            def get_option_dict(self, command_name):
-                opts = Distribution.get_option_dict(self, command_name)
-                if command_name == 'easy_install':
-                    if find_links is not None:
-                        opts['find_links'] = ('setup script', find_links)
-                    if index_url is not None:
-                        opts['index_url'] = ('setup script', index_url)
-                    if allow_hosts is not None:
-                        opts['allow_hosts'] = ('setup script', allow_hosts)
-                return opts
-
-        if version:
-            req = '{0}=={1}'.format(DIST_NAME, version)
-        else:
-            req = DIST_NAME
-
-        attrs = {'setup_requires': [req]}
-        if DEBUG:
-            dist = _Distribution(attrs=attrs)
-        else:
-            with _silence():
-                dist = _Distribution(attrs=attrs)
-
-        # If the setup_requires succeeded it will have added the new dist to
-        # the main working_set
-        return pkg_resources.working_set.by_key.get(DIST_NAME)
-    except Exception as e:
-        if DEBUG:
-            raise
-
-        msg = 'Error retrieving astropy helpers from {0}:\n{1}'
-        if find_links:
-            source = find_links[0]
-        elif index_url:
-            source = index_url
-        else:
-            source = 'PyPI'
-
-        raise Exception(msg.format(source, repr(e)))
-
-
-def _do_upgrade(dist, index_url):
-    # Build up a requirement for a higher bugfix release but a lower minor
-    # release (so API compatibility is guaranteed)
-    # sketchy version parsing--maybe come up with something a bit more
-    # robust for this
-    major, minor = (int(part) for part in dist.parsed_version[:2])
-    next_minor = '.'.join([str(major), str(minor + 1), '0'])
-    req = pkg_resources.Requirement.parse(
-        '{0}>{1},<{2}'.format(DIST_NAME, dist.version, next_minor))
-
-    package_index = PackageIndex(index_url=index_url)
-
-    upgrade = package_index.obtain(req)
-
-    if upgrade is not None:
-        return _do_download(version=upgrade.version, index_url=index_url)
-
-
-def _directory_import(path):
-    """
-    Import astropy_helpers from the given path, which will be added to
-    sys.path.
-
-    Must return True if the import succeeded, and False otherwise.
-    """
-
-    # Return True on success, False on failure but download is allowed, and
-    # otherwise raise SystemExit
-    path = os.path.abspath(path)
-
-    # Use an empty WorkingSet rather than the man pkg_resources.working_set,
-    # since on older versions of setuptools this will invoke a VersionConflict
-    # when trying to install an upgrade
-    ws = pkg_resources.WorkingSet([])
-    ws.add_entry(path)
-    dist = ws.by_key.get(DIST_NAME)
-
-    if dist is None:
-        # We didn't find an egg-info/dist-info in the given path, but if a
-        # setup.py exists we can generate it
-        setup_py = os.path.join(path, 'setup.py')
-        if os.path.isfile(setup_py):
-            with _silence():
-                run_setup(os.path.join(path, 'setup.py'), ['egg_info'])
-
-            for dist in pkg_resources.find_distributions(path, True):
-                # There should be only one...
-                return dist
-
-    return dist
-
-
-def _check_submodule(path, use_git=True, offline=False):
-    """
-    Check if the given path is a git submodule.
-
-    See the docstrings for ``_check_submodule_using_git`` and
-    ``_check_submodule_no_git`` for futher details.
-    """
-
-    if use_git:
-        return _check_submodule_using_git(path, offline)
-    else:
-        return _check_submodule_no_git(path)
-
-
-def _check_submodule_using_git(path, offline):
-    """
-    Check if the given path is a git submodule.  If so, attempt to initialize
-    and/or update the submodule if needed.
-
-    This function makes calls to the ``git`` command in subprocesses.  The
-    ``_check_submodule_no_git`` option uses pure Python to check if the given
-    path looks like a git submodule, but it cannot perform updates.
-    """
-
-    if PY3 and not isinstance(path, _text_type):
-        fs_encoding = sys.getfilesystemencoding()
-        path = path.decode(fs_encoding)
-
-    try:
-        p = sp.Popen(['git', 'submodule', 'status', '--', path],
-                     stdout=sp.PIPE, stderr=sp.PIPE)
-        stdout, stderr = p.communicate()
-    except OSError as e:
-        if DEBUG:
-            raise
-
-        if e.errno == errno.ENOENT:
-            # The git command simply wasn't found; this is most likely the
-            # case on user systems that don't have git and are simply
-            # trying to install the package from PyPI or a source
-            # distribution.  Silently ignore this case and simply don't try
-            # to use submodules
-            return False
-        else:
-            raise _AHBoostrapSystemExit(
-                'An unexpected error occurred when running the '
-                '`git submodule status` command:\n{0}'.format(str(e)))
-
-
-    # Can fail of the default locale is not configured properly.  See
-    # https://github.com/astropy/astropy/issues/2749.  For the purposes under
-    # consideration 'latin1' is an acceptable fallback.
-    try:
-        stdio_encoding = locale.getdefaultlocale()[1] or 'latin1'
-    except ValueError:
-        # Due to an OSX oddity locale.getdefaultlocale() can also crash
-        # depending on the user's locale/language settings.  See:
-        # http://bugs.python.org/issue18378
-        stdio_encoding = 'latin1'
-
-    if p.returncode != 0 or stderr:
-        # Unfortunately the return code alone cannot be relied on, as
-        # earlier versions of git returned 0 even if the requested submodule
-        # does not exist
-        stderr = stderr.decode(stdio_encoding)
-
-        # This is a warning that occurs in perl (from running git submodule)
-        # which only occurs with a malformatted locale setting which can
-        # happen sometimes on OSX.  See again
-        # https://github.com/astropy/astropy/issues/2749
-        perl_warning = ('perl: warning: Falling back to the standard locale '
-                        '("C").')
-        if not stderr.strip().endswith(perl_warning):
-            # Some other uknown error condition occurred
-            log.warn('git submodule command failed '
-                     'unexpectedly:\n{0}'.format(stderr))
-            return False
-
-    stdout = stdout.decode(stdio_encoding)
-    # The stdout should only contain one line--the status of the
-    # requested submodule
-    m = _git_submodule_status_re.match(stdout)
-    if m:
-        # Yes, the path *is* a git submodule
-        _update_submodule(m.group('submodule'), m.group('status'), offline)
-        return True
-    else:
-        log.warn(
-            'Unexpected output from `git submodule status`:\n{0}\n'
-            'Will attempt import from {1!r} regardless.'.format(
-                stdout, path))
-        return False
-
-
-def _check_submodule_no_git(path):
-    """
-    Like ``_check_submodule_using_git``, but simply parses the .gitmodules file
-    to determine if the supplied path is a git submodule, and does not exec any
-    subprocesses.
-
-    This can only determine if a path is a submodule--it does not perform
-    updates, etc.  This function may need to be updated if the format of the
-    .gitmodules file is changed between git versions.
-    """
-
-    gitmodules_path = os.path.abspath('.gitmodules')
-
-    if not os.path.isfile(gitmodules_path):
-        return False
-
-    # This is a minimal reader for gitconfig-style files.  It handles a few of
-    # the quirks that make gitconfig files incompatible with ConfigParser-style
-    # files, but does not support the full gitconfig syntaix (just enough
-    # needed to read a .gitmodules file).
-    gitmodules_fileobj = io.StringIO()
-
-    # Must use io.open for cross-Python-compatible behavior wrt unicode
-    with io.open(gitmodules_path) as f:
-        for line in f:
-            # gitconfig files are more flexible with leading whitespace; just
-            # go ahead and remove it
-            line = line.lstrip()
-
-            # comments can start with either # or ;
-            if line and line[0] in (':', ';'):
-                continue
-
-            gitmodules_fileobj.write(line)
-
-    gitmodules_fileobj.seek(0)
-
-    cfg = RawConfigParser()
-
-    try:
-        cfg.readfp(gitmodules_fileobj)
-    except Exception as exc:
-        log.warn('Malformatted .gitmodules file: {0}\n'
-                 '{1} cannot be assumed to be a git submodule.'.format(
-                     exc, path))
-        return False
-
-    for section in cfg.sections():
-        if not cfg.has_option(section, 'path'):
-            continue
-
-        submodule_path = cfg.get(section, 'path').rstrip(os.sep)
-
-        if submodule_path == path.rstrip(os.sep):
-            return True
-
-    return False
-
-
-def _update_submodule(submodule, status, offline):
-    if status == ' ':
-        # The submodule is up to date; no action necessary
-        return
-    elif status == '-':
-        if offline:
-            raise _AHBootstrapSystemExit(
-                "Cannot initialize the {0} submodule in --offline mode; this "
-                "requires being able to clone the submodule from an online "
-                "repository.".format(submodule))
-        cmd = ['update', '--init']
-        action = 'Initializing'
-    elif status == '+':
-        cmd = ['update']
-        action = 'Updating'
-        if offline:
-            cmd.append('--no-fetch')
-    elif status == 'U':
-        raise _AHBoostrapSystemExit(
-            'Error: Submodule {0} contains unresolved merge conflicts.  '
-            'Please complete or abandon any changes in the submodule so that '
-            'it is in a usable state, then try again.'.format(submodule))
-    else:
-        log.warn('Unknown status {0!r} for git submodule {1!r}.  Will '
-                 'attempt to use the submodule as-is, but try to ensure '
-                 'that the submodule is in a clean state and contains no '
-                 'conflicts or errors.\n{2}'.format(status, submodule,
-                                                    _err_help_msg))
-        return
-
-    err_msg = None
-
-    cmd = ['git', 'submodule'] + cmd + ['--', submodule]
-    log.warn('{0} {1} submodule with: `{2}`'.format(
-        action, submodule, ' '.join(cmd)))
-
-    try:
-        p = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
-        stdout, stderr = p.communicate()
-    except OSError as e:
-        err_msg = str(e)
-    else:
-        if p.returncode != 0:
-            stderr_encoding = locale.getdefaultlocale()[1]
-            err_msg = stderr.decode(stderr_encoding)
-
-    if err_msg:
-        log.warn('An unexpected error occurred updating the git submodule '
-                 '{0!r}:\n{1}\n{2}'.format(submodule, err_msg, _err_help_msg))
-
-
-class _DummyFile(object):
-    """A noop writeable object."""
-
-    errors = ''  # Required for Python 3.x
-    encoding = 'utf-8'
-
-    def write(self, s):
-        pass
-
-    def flush(self):
-        pass
-
-
- at contextlib.contextmanager
-def _silence():
-    """A context manager that silences sys.stdout and sys.stderr."""
-
-    old_stdout = sys.stdout
-    old_stderr = sys.stderr
-    sys.stdout = _DummyFile()
-    sys.stderr = _DummyFile()
-    exception_occurred = False
-    try:
-        yield
-    except:
-        exception_occurred = True
-        # Go ahead and clean up so that exception handling can work normally
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-        raise
-
-    if not exception_occurred:
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-
-
-_err_help_msg = """
-If the problem persists consider installing astropy_helpers manually using pip
-(`pip install astropy_helpers`) or by manually downloading the source archive,
-extracting it, and installing by running `python setup.py install` from the
-root of the extracted source code.
-"""
-
-
-class _AHBootstrapSystemExit(SystemExit):
-    def __init__(self, *args):
-        if not args:
-            msg = 'An unknown problem occurred bootstrapping astropy_helpers.'
-        else:
-            msg = args[0]
-
-        msg += '\n' + _err_help_msg
-
-        super(_AHBootstrapSystemExit, self).__init__(msg, *args[1:])
-
-
-if sys.version_info[:2] < (2, 7):
-    # In Python 2.6 the distutils log does not log warnings, errors, etc. to
-    # stderr so we have to wrap it to ensure consistency at least in this
-    # module
-    import distutils
-
-    class log(object):
-        def __getattr__(self, attr):
-            return getattr(distutils.log, attr)
-
-        def warn(self, msg, *args):
-            self._log_to_stderr(distutils.log.WARN, msg, *args)
-
-        def error(self, msg):
-            self._log_to_stderr(distutils.log.ERROR, msg, *args)
-
-        def fatal(self, msg):
-            self._log_to_stderr(distutils.log.FATAL, msg, *args)
-
-        def log(self, level, msg, *args):
-            if level in (distutils.log.WARN, distutils.log.ERROR,
-                         distutils.log.FATAL):
-                self._log_to_stderr(level, msg, *args)
-            else:
-                distutils.log.log(level, msg, *args)
-
-        def _log_to_stderr(self, level, msg, *args):
-            # This is the only truly 'public' way to get the current threshold
-            # of the log
-            current_threshold = distutils.log.set_threshold(distutils.log.WARN)
-            distutils.log.set_threshold(current_threshold)
-            if level >= current_threshold:
-                if args:
-                    msg = msg % args
-                sys.stderr.write('%s\n' % msg)
-                sys.stderr.flush()
-
-    log = log()
-
-# Output of `git submodule status` is as follows:
-#
-# 1: Status indicator: '-' for submodule is uninitialized, '+' if submodule is
-# initialized but is not at the commit currently indicated in .gitmodules (and
-# thus needs to be updated), or 'U' if the submodule is in an unstable state
-# (i.e. has merge conflicts)
-#
-# 2. SHA-1 hash of the current commit of the submodule (we don't really need
-# this information but it's useful for checking that the output is correct)
-#
-# 3. The output of `git describe` for the submodule's current commit hash (this
-# includes for example what branches the commit is on) but only if the
-# submodule is initialized.  We ignore this information for now
-_git_submodule_status_re = re.compile(
-    '^(?P<status>[+-U ])(?P<commit>[0-9a-f]{40}) (?P<submodule>\S+)( .*)?$')
-
-
-# Implement the auto-use feature; this allows use_astropy_helpers() to be used
-# at import-time automatically so long as the correct options are specified in
-# setup.cfg
-_CFG_OPTIONS = [('auto_use', bool), ('path', str),
-                ('download_if_needed', bool), ('index_url', str),
-                ('use_git', bool), ('auto_upgrade', bool)]
-
-def _main():
-    if not os.path.exists('setup.cfg'):
-        return
-
-    cfg = ConfigParser()
-
-    try:
-        cfg.read('setup.cfg')
-    except Exception as e:
-        if DEBUG:
-            raise
-
-        log.error(
-            "Error reading setup.cfg: {0!r}\nastropy_helpers will not be "
-            "automatically bootstrapped and package installation may fail."
-            "\n{1}".format(e, _err_help_msg))
-        return
-
-    if not cfg.has_section('ah_bootstrap'):
-        return
-
-    kwargs = {}
-
-    for option, type_ in _CFG_OPTIONS:
-        if not cfg.has_option('ah_bootstrap', option):
-            continue
-
-        if type_ is bool:
-            value = cfg.getboolean('ah_bootstrap', option)
-        else:
-            value = cfg.get('ah_bootstrap', option)
-
-        kwargs[option] = value
-
-    if kwargs.pop('auto_use', False):
-        use_astropy_helpers(**kwargs)
-
-
-_main()
diff --git a/astropy_helpers/astropy_helpers.egg-info/PKG-INFO b/astropy_helpers/astropy_helpers.egg-info/PKG-INFO
deleted file mode 100644
index 11c0013..0000000
--- a/astropy_helpers/astropy_helpers.egg-info/PKG-INFO
+++ /dev/null
@@ -1,46 +0,0 @@
-Metadata-Version: 1.1
-Name: astropy-helpers
-Version: 0.4.2
-Summary: Utilities for building and installing Astropy, Astropy affiliated packages, and their respective documentation.
-Home-page: http://astropy.org
-Author: The Astropy Developers
-Author-email: astropy.team at gmail.com
-License: BSD
-Download-URL: http://pypi.python.org/packages/source/a/astropy-helpers/astropy-helpers-0.4.2.tar.gz
-Description: astropy-helpers
-        ===============
-        
-        This project provides a Python package, ``astropy_helpers``, which includes
-        many build, installation, and documentation-related tools used by the Astropy
-        project, but packaged separately for use by other projects that wish to
-        leverage this work.  The motivation behind this package and details of its
-        implementation are in the accepted 
-        `Astropy Proposal for Enhancement (APE) 4 <https://github.com/embray/astropy-APEs/blob/astropy-helpers/APE4.rst>`_.
-        
-        ``astropy_helpers`` includes a special "bootstrap" module called
-        ``ah_bootstrap.py`` which is intended to be used by a project's setup.py in
-        order to ensure that the ``astropy_helpers`` package is available for
-        build/installation.  This is similar to the ``ez_setup.py`` module that is
-        shipped with some projects to bootstrap `setuptools
-        <https://bitbucket.org/pypa/setuptools>`_.
-        
-        As described in APE4, the version numbers for ``astropy_helpers`` follow the
-        corresponding major/minor version of the `astropy core package
-        <http://www.astropy.org/>`_, but with an independent sequence of micro (bugfix)
-        version numbers. Hence, the initial release is 0.4, in parallel with Astropy
-        v0.4, which will be the first version  of Astropy to use ``astropy-helpers``.
-        
-        For examples of how to implement ``astropy-helpers`` in a project,
-        see the ``setup.py`` and ``setup.cfg`` files of the 
-        `Affiliated package template <https://github.com/astropy/package-template>`_.
-        
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3
-Classifier: Topic :: Software Development :: Build Tools
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: System :: Archiving :: Packaging
diff --git a/astropy_helpers/astropy_helpers.egg-info/SOURCES.txt b/astropy_helpers/astropy_helpers.egg-info/SOURCES.txt
deleted file mode 100644
index 4c749e9..0000000
--- a/astropy_helpers/astropy_helpers.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-CHANGES.rst
-LICENSE.rst
-MANIFEST.in
-README.rst
-ah_bootstrap.py
-ez_setup.py
-setup.cfg
-setup.py
-astropy_helpers/__init__.py
-astropy_helpers/git_helpers.py
-astropy_helpers/setup_helpers.py
-astropy_helpers/test_helpers.py
-astropy_helpers/utils.py
-astropy_helpers/version.py
-astropy_helpers/version_helpers.py
-astropy_helpers.egg-info/PKG-INFO
-astropy_helpers.egg-info/SOURCES.txt
-astropy_helpers.egg-info/dependency_links.txt
-astropy_helpers.egg-info/not-zip-safe
-astropy_helpers.egg-info/top_level.txt
-astropy_helpers/compat/__init__.py
-astropy_helpers/compat/subprocess.py
-astropy_helpers/compat/_subprocess_py2/__init__.py
-astropy_helpers/sphinx/__init__.py
-astropy_helpers/sphinx/conf.py
-astropy_helpers/sphinx/setup_package.py
-astropy_helpers/sphinx/ext/__init__.py
-astropy_helpers/sphinx/ext/astropyautosummary.py
-astropy_helpers/sphinx/ext/automodapi.py
-astropy_helpers/sphinx/ext/automodsumm.py
-astropy_helpers/sphinx/ext/changelog_links.py
-astropy_helpers/sphinx/ext/comment_eater.py
-astropy_helpers/sphinx/ext/compiler_unparse.py
-astropy_helpers/sphinx/ext/docscrape.py
-astropy_helpers/sphinx/ext/docscrape_sphinx.py
-astropy_helpers/sphinx/ext/doctest.py
-astropy_helpers/sphinx/ext/edit_on_github.py
-astropy_helpers/sphinx/ext/numpydoc.py
-astropy_helpers/sphinx/ext/phantom_import.py
-astropy_helpers/sphinx/ext/smart_resolver.py
-astropy_helpers/sphinx/ext/tocdepthfix.py
-astropy_helpers/sphinx/ext/traitsdoc.py
-astropy_helpers/sphinx/ext/utils.py
-astropy_helpers/sphinx/ext/viewcode.py
-astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
-astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
-astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
-astropy_helpers/sphinx/ext/tests/__init__.py
-astropy_helpers/sphinx/ext/tests/test_automodapi.py
-astropy_helpers/sphinx/ext/tests/test_automodsumm.py
-astropy_helpers/sphinx/ext/tests/test_docscrape.py
-astropy_helpers/sphinx/ext/tests/test_utils.py
-astropy_helpers/sphinx/local/python3links.inv
-astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
-astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
-astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
-astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
-astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
-astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
-astropy_helpers/src/__init__.py
-astropy_helpers/src/compiler.c
-astropy_helpers/src/setup_package.py
\ No newline at end of file
diff --git a/astropy_helpers/astropy_helpers.egg-info/dependency_links.txt b/astropy_helpers/astropy_helpers.egg-info/dependency_links.txt
deleted file mode 100644
index 8b13789..0000000
--- a/astropy_helpers/astropy_helpers.egg-info/dependency_links.txt
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/astropy_helpers/astropy_helpers.egg-info/not-zip-safe b/astropy_helpers/astropy_helpers.egg-info/not-zip-safe
deleted file mode 100644
index 8b13789..0000000
--- a/astropy_helpers/astropy_helpers.egg-info/not-zip-safe
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/astropy_helpers/astropy_helpers.egg-info/top_level.txt b/astropy_helpers/astropy_helpers.egg-info/top_level.txt
deleted file mode 100644
index 1b83b19..0000000
--- a/astropy_helpers/astropy_helpers.egg-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-astropy_helpers
diff --git a/astropy_helpers/astropy_helpers/__init__.py b/astropy_helpers/astropy_helpers/__init__.py
deleted file mode 100644
index 5a8b56b..0000000
--- a/astropy_helpers/astropy_helpers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
-    from .version import version as __version__
-except ImportError:
-    __version__ = ''
diff --git a/astropy_helpers/astropy_helpers/compat/__init__.py b/astropy_helpers/astropy_helpers/compat/__init__.py
deleted file mode 100644
index 818e760..0000000
--- a/astropy_helpers/astropy_helpers/compat/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-def _fix_user_options(options):
-    """
-    This is for Python 2.x and 3.x compatibility.  distutils expects Command
-    options to all be byte strings on Python 2 and Unicode strings on Python 3.
-    """
-
-    def to_str_or_none(x):
-        if x is None:
-            return None
-        return str(x)
-
-    return [tuple(to_str_or_none(x) for x in y) for y in options]
diff --git a/astropy_helpers/astropy_helpers/compat/_subprocess_py2/__init__.py b/astropy_helpers/astropy_helpers/compat/_subprocess_py2/__init__.py
deleted file mode 100644
index a14df41..0000000
--- a/astropy_helpers/astropy_helpers/compat/_subprocess_py2/__init__.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from __future__ import absolute_import
-
-from subprocess import *
-
-
-def check_output(*popenargs, **kwargs):
-    r"""Run command with arguments and return its output as a byte
-    string.
-
-    If the exit code was non-zero it raises a CalledProcessError.  The
-    CalledProcessError object will have the return code in the
-    returncode
-    attribute and output in the output attribute.
-
-    The arguments are the same as for the Popen constructor.  Example::
-
-    >>> check_output(["ls", "-l", "/dev/null"])
-    'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'
-
-    The stdout argument is not allowed as it is used internally.
-    To capture standard error in the result, use stderr=STDOUT.::
-
-    >>> check_output(["/bin/sh", "-c",
-    ...               "ls -l non_existent_file ; exit 0"],
-    ...              stderr=STDOUT)
-    'ls: non_existent_file: No such file or directory\n'
-    """
-    if 'stdout' in kwargs:
-        raise ValueError('stdout argument not allowed, it will be overridden.')
-    process = Popen(stdout=PIPE, *popenargs, **kwargs)
-    output, unused_err = process.communicate()
-    retcode = process.poll()
-    if retcode:
-        cmd = kwargs.get("args")
-        if cmd is None:
-            cmd = popenargs[0]
-        raise CalledProcessError(retcode, cmd)
-    return output
diff --git a/astropy_helpers/astropy_helpers/compat/subprocess.py b/astropy_helpers/astropy_helpers/compat/subprocess.py
deleted file mode 100644
index 93a388b..0000000
--- a/astropy_helpers/astropy_helpers/compat/subprocess.py
+++ /dev/null
@@ -1,19 +0,0 @@
-"""
-A replacement wrapper around the subprocess module that adds
-check_output (which was only added to Python in 2.7.
-
-Instead of importing subprocess, other modules should use this as follows::
-
-    from astropy.utils.compat import subprocess
-
-This module is safe to import from anywhere within astropy.
-"""
-from __future__ import absolute_import, print_function
-
-import subprocess
-
-# python2.7 and later provide a check_output method
-if not hasattr(subprocess, 'check_output'):
-    from ._subprocess_py2 import check_output
-
-from subprocess import *
diff --git a/astropy_helpers/astropy_helpers/git_helpers.py b/astropy_helpers/astropy_helpers/git_helpers.py
deleted file mode 100644
index 88aae9d..0000000
--- a/astropy_helpers/astropy_helpers/git_helpers.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-"""
-Utilities for retrieving revision information from a project's git repository.
-"""
-
-# Do not remove the following comment; it is used by
-# astropy_helpers.version_helpers to determine the beginning of the code in
-# this module
-
-# BEGIN
-
-import locale
-import os
-import subprocess
-import warnings
-
-
-def _decode_stdio(stream):
-    try:
-        stdio_encoding = locale.getdefaultlocale()[1] or 'utf-8'
-    except ValueError:
-        stdio_encoding = 'utf-8'
-
-    try:
-        text = stream.decode(stdio_encoding)
-    except UnicodeDecodeError:
-        # Final fallback
-        text = stream.decode('latin1')
-
-    return text
-
-
-def update_git_devstr(version, path=None):
-    """
-    Updates the git revision string if and only if the path is being imported
-    directly from a git working copy.  This ensures that the revision number in
-    the version string is accurate.
-    """
-
-    try:
-        # Quick way to determine if we're in git or not - returns '' if not
-        devstr = get_git_devstr(sha=True, show_warning=False, path=path)
-    except OSError:
-        return version
-
-    if not devstr:
-        # Probably not in git so just pass silently
-        return version
-
-    if 'dev' in version:  # update to the current git revision
-        version_base = version.split('.dev', 1)[0]
-        devstr = get_git_devstr(sha=False, show_warning=False, path=path)
-
-        return version_base + '.dev' + devstr
-    else:
-        #otherwise it's already the true/release version
-        return version
-
-
-def get_git_devstr(sha=False, show_warning=True, path=None):
-    """
-    Determines the number of revisions in this repository.
-
-    Parameters
-    ----------
-    sha : bool
-        If True, the full SHA1 hash will be returned. Otherwise, the total
-        count of commits in the repository will be used as a "revision
-        number".
-
-    show_warning : bool
-        If True, issue a warning if git returns an error code, otherwise errors
-        pass silently.
-
-    path : str or None
-        If a string, specifies the directory to look in to find the git
-        repository.  If `None`, the current working directory is used.
-        If given a filename it uses the directory containing that file.
-
-    Returns
-    -------
-    devversion : str
-        Either a string with the revsion number (if `sha` is False), the
-        SHA1 hash of the current commit (if `sha` is True), or an empty string
-        if git version info could not be identified.
-
-    """
-
-    if path is None:
-        path = os.getcwd()
-
-    if not os.path.isdir(path):
-        path = os.path.abspath(os.path.dirname(path))
-
-    if not os.path.exists(os.path.join(path, '.git')):
-        return ''
-
-    if sha:
-        # Faster for getting just the hash of HEAD
-        cmd = ['rev-parse', 'HEAD']
-    else:
-        cmd = ['rev-list', '--count', 'HEAD']
-
-    def run_git(cmd):
-        try:
-            p = subprocess.Popen(['git'] + cmd, cwd=path,
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE,
-                                 stdin=subprocess.PIPE)
-            stdout, stderr = p.communicate()
-        except OSError as e:
-            if show_warning:
-                warnings.warn('Error running git: ' + str(e))
-            return (None, '', '')
-
-        if p.returncode == 128:
-            if show_warning:
-                warnings.warn('No git repository present at {0!r}! Using '
-                              'default dev version.'.format(path))
-            return (p.returncode, '', '')
-        if p.returncode == 129:
-            if show_warning:
-                warnings.warn('Your git looks old (does it support {0}?); ' 
-                              'consider upgrading to v1.7.2 or '
-                              'later.'.format(cmd[0]))
-            return (p.returncode, stdout, stderr)
-        elif p.returncode != 0:
-            if show_warning:
-                warnings.warn('Git failed while determining revision '
-                              'count: {0}'.format(_decode_stdio(stderr)))
-            return (p.returncode, stdout, stderr)
-
-        return p.returncode, stdout, stderr
-
-    returncode, stdout, stderr = run_git(cmd)
-
-    if not sha and returncode == 129:
-        # git returns 129 if a command option failed to parse; in
-        # particualr this could happen in git versions older than 1.7.2
-        # where the --count option is not supported
-        # Also use --abbrev-commit and --abbrev=0 to display the minimum
-        # number of characters needed per-commit (rather than the full hash)
-        cmd = ['rev-list', '--abbrev-commit', '--abbrev=0', 'HEAD']
-        returncode, stdout, stderr = run_git(cmd)
-        # Fall back on the old method of getting all revisions and counting
-        # the lines
-        if returncode == 0:
-            return str(stdout.count(b'\n'))
-        else:
-            return ''
-    elif sha:
-        return _decode_stdio(stdout)[:40]
-    else:
-        return _decode_stdio(stdout).strip()
diff --git a/astropy_helpers/astropy_helpers/setup_helpers.py b/astropy_helpers/astropy_helpers/setup_helpers.py
deleted file mode 100644
index d682e95..0000000
--- a/astropy_helpers/astropy_helpers/setup_helpers.py
+++ /dev/null
@@ -1,1526 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This module contains a number of utilities for use during
-setup/build/packaging that are useful to astropy as a whole.
-"""
-
-from __future__ import absolute_import, print_function
-
-import collections
-import errno
-import imp
-import inspect
-import os
-import pkgutil
-import re
-import shlex
-import shutil
-import subprocess
-import sys
-import textwrap
-
-from distutils import log, ccompiler, sysconfig
-from distutils.cmd import DistutilsOptionError
-from distutils.dist import Distribution
-from distutils.errors import DistutilsError, DistutilsFileError
-from distutils.core import Extension
-from distutils.core import Command
-from distutils.command.sdist import sdist as DistutilsSdist
-from setuptools.command.build_ext import build_ext as SetuptoolsBuildExt
-from setuptools.command.build_py import build_py as SetuptoolsBuildPy
-from setuptools.command.install import install as SetuptoolsInstall
-from setuptools.command.install_lib import install_lib as SetuptoolsInstallLib
-
-from setuptools.command.register import register as SetuptoolsRegister
-from setuptools import find_packages
-
-from .test_helpers import AstropyTest
-from .utils import silence, invalidate_caches, walk_skip_hidden
-
-_module_state = {
-    'adjusted_compiler': False,
-    'registered_commands': None,
-    'have_cython': False,
-    'have_sphinx': False
-}
-
-try:
-    import Cython
-    _module_state['have_cython'] = True
-except ImportError:
-    pass
-
-try:
-    import sphinx
-    from sphinx.setup_command import BuildDoc as SphinxBuildDoc
-    _module_state['have_sphinx'] = True
-except ValueError as e:
-    # This can occur deep in the bowels of Sphinx's imports by way of docutils
-    # and an occurence of this bug: http://bugs.python.org/issue18378
-    # In this case sphinx is effectively unusable
-    if 'unknown locale' in e.args[0]:
-        log.warn(
-            "Possible misconfiguration of one of the environment variables "
-            "LC_ALL, LC_CTYPES, LANG, or LANGUAGE.  For an example of how to "
-            "configure your system's language environment on OSX see "
-            "http://blog.remibergsma.com/2012/07/10/"
-            "setting-locales-correctly-on-mac-osx-terminal-application/")
-except ImportError:
-    pass
-except SyntaxError:
-    # occurs if markupsafe is recent version, which doesn't support Python 3.2
-    pass
-
-
-PY3 = sys.version_info[0] >= 3
-
-
-# This adds a new keyword to the setup() function
-Distribution.skip_2to3 = []
-
-
-def adjust_compiler(package):
-    """
-    This function detects broken compilers and switches to another.  If
-    the environment variable CC is explicitly set, or a compiler is
-    specified on the commandline, no override is performed -- the purpose
-    here is to only override a default compiler.
-
-    The specific compilers with problems are:
-
-        * The default compiler in XCode-4.2, llvm-gcc-4.2,
-          segfaults when compiling wcslib.
-
-    The set of broken compilers can be updated by changing the
-    compiler_mapping variable.  It is a list of 2-tuples where the
-    first in the pair is a regular expression matching the version
-    of the broken compiler, and the second is the compiler to change
-    to.
-    """
-
-    compiler_mapping = [
-        (b'i686-apple-darwin[0-9]*-llvm-gcc-4.2', 'clang')
-        ]
-
-    if _module_state['adjusted_compiler']:
-        return
-
-    # Whatever the result of this function is, it only needs to be run once
-    _module_state['adjusted_compiler'] = True
-
-    if 'CC' in os.environ:
-
-        # Check that CC is not set to llvm-gcc-4.2
-        c_compiler = os.environ['CC']
-
-        try:
-            version = get_compiler_version(c_compiler)
-        except OSError:
-            msg = textwrap.dedent(
-                    """
-                    The C compiler set by the CC environment variable:
-
-                        {compiler:s}
-
-                    cannot be found or executed.
-                    """.format(compiler=c_compiler))
-            log.warn(msg)
-            sys.exit(1)
-
-        for broken, fixed in compiler_mapping:
-            if re.match(broken, version):
-                msg = textwrap.dedent(
-                    """Compiler specified by CC environment variable
-                    ({compiler:s}:{version:s}) will fail to compile {pkg:s}.
-                    Please set CC={fixed:s} and try again.
-                    You can do this, for example, by running:
-
-                        CC={fixed:s} python setup.py <command>
-
-                    where <command> is the command you ran.
-                    """.format(compiler=c_compiler, version=version,
-                               pkg=package, fixed=fixed))
-                log.warn(msg)
-                sys.exit(1)
-
-        # If C compiler is set via CC, and isn't broken, we are good to go. We
-        # should definitely not try accessing the compiler specified by
-        # ``sysconfig.get_config_var('CC')`` lower down, because this may fail
-        # if the compiler used to compile Python is missing (and maybe this is
-        # why the user is setting CC). For example, the official Python 2.7.3
-        # MacOS X binary was compled with gcc-4.2, which is no longer available
-        # in XCode 4.
-        return
-
-    if get_distutils_build_option('compiler'):
-        return
-
-    compiler_type = ccompiler.get_default_compiler()
-
-    if compiler_type == 'unix':
-
-        # We have to get the compiler this way, as this is the one that is
-        # used if os.environ['CC'] is not set. It is actually read in from
-        # the Python Makefile. Note that this is not necessarily the same
-        # compiler as returned by ccompiler.new_compiler()
-        c_compiler = sysconfig.get_config_var('CC')
-
-        try:
-            version = get_compiler_version(c_compiler)
-        except OSError:
-            msg = textwrap.dedent(
-                    """
-                    The C compiler used to compile Python {compiler:s}, and
-                    which is normally used to compile C extensions, is not
-                    available. You can explicitly specify which compiler to
-                    use by setting the CC environment variable, for example:
-
-                        CC=gcc python setup.py <command>
-
-                    or if you are using MacOS X, you can try:
-
-                        CC=clang python setup.py <command>
-                    """.format(compiler=c_compiler))
-            log.warn(msg)
-            sys.exit(1)
-
-
-        for broken, fixed in compiler_mapping:
-            if re.match(broken, version):
-                os.environ['CC'] = fixed
-                break
-
-
-def get_compiler_version(compiler):
-
-    process = subprocess.Popen(
-        shlex.split(compiler) + ['--version'], stdout=subprocess.PIPE)
-
-    output = process.communicate()[0].strip()
-    try:
-        version = output.split()[0]
-    except IndexError:
-        return 'unknown'
-
-    return version
-
-
-def get_dummy_distribution():
-    """Returns a distutils Distribution object used to instrument the setup
-    environment before calling the actual setup() function.
-    """
-
-    if _module_state['registered_commands'] is None:
-        raise RuntimeError(
-            'astropy_helpers.setup_helpers.register_commands() must be '
-            'called before using '
-            'astropy_helpers.setup_helpers.get_dummy_distribution()')
-
-    # Pre-parse the Distutils command-line options and config files to if
-    # the option is set.
-    dist = Distribution({'script_name': os.path.basename(sys.argv[0]),
-                         'script_args': sys.argv[1:]})
-    dist.cmdclass.update(_module_state['registered_commands'])
-
-    with silence():
-        try:
-            dist.parse_config_files()
-            dist.parse_command_line()
-        except (DistutilsError, AttributeError, SystemExit):
-            # Let distutils handle DistutilsErrors itself AttributeErrors can
-            # get raise for ./setup.py --help SystemExit can be raised if a
-            # display option was used, for example
-            pass
-
-    return dist
-
-
-def get_distutils_option(option, commands):
-    """ Returns the value of the given distutils option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    commands : list of str
-        The list of commands on which this option is available
-
-    Returns
-    -------
-    val : str or None
-        the value of the given distutils option. If the option is not set,
-        returns None.
-    """
-
-    dist = get_dummy_distribution()
-
-    for cmd in commands:
-        cmd_opts = dist.command_options.get(cmd)
-        if cmd_opts is not None and option in cmd_opts:
-            return cmd_opts[option][1]
-    else:
-        return None
-
-
-def get_distutils_build_option(option):
-    """ Returns the value of the given distutils build option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build option. If the option
-        is not set, returns None.
-    """
-    return get_distutils_option(option, ['build', 'build_ext', 'build_clib'])
-
-
-def get_distutils_install_option(option):
-    """ Returns the value of the given distutils install option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build option. If the option
-        is not set, returns None.
-    """
-    return get_distutils_option(option, ['install'])
-
-
-def get_distutils_build_or_install_option(option):
-    """ Returns the value of the given distutils build or install option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build or install option. If the
-        option is not set, returns None.
-    """
-    return get_distutils_option(option, ['build', 'build_ext', 'build_clib',
-                                         'install'])
-
-
-def get_compiler_option():
-    """ Determines the compiler that will be used to build extension modules.
-
-    Returns
-    -------
-    compiler : str
-        The compiler option specificied for the build, build_ext, or build_clib
-        command; or the default compiler for the platform if none was
-        specified.
-
-    """
-
-    compiler = get_distutils_build_option('compiler')
-    if compiler is None:
-        return ccompiler.get_default_compiler()
-
-    return compiler
-
-
-def get_debug_option(packagename):
-    """ Determines if the build is in debug mode.
-
-    Returns
-    -------
-    debug : bool
-        True if the current build was started with the debug option, False
-        otherwise.
-
-    """
-
-    try:
-        current_debug = get_pkg_version_module(packagename,
-                                               fromlist=['debug'])[0]
-    except (ImportError, AttributeError):
-        current_debug = None
-
-    # Only modify the debug flag if one of the build commands was explicitly
-    # run (i.e. not as a sub-command of something else)
-    dist = get_dummy_distribution()
-    if any(cmd in dist.commands for cmd in ['build', 'build_ext']):
-        debug = bool(get_distutils_build_option('debug'))
-    else:
-        debug = bool(current_debug)
-
-    if current_debug is not None and current_debug != debug:
-        build_ext_cmd = dist.get_command_class('build_ext')
-        build_ext_cmd.force_rebuild = True
-
-    return debug
-
-
-# TODO: Move this into astropy_helpers.version_helpers once the dependency of
-# version_helpers on *this* module has been resolved (IOW, once these modules
-# have been refactored to reduce their interdependency)
-def get_pkg_version_module(packagename, fromlist=None):
-    """Returns the package's .version module generated by
-    `astropy_helpers.version_helpers.generate_version_py`.  Raises an
-    ImportError if the version module is not found.
-
-    If ``fromlist`` is an iterable, return a tuple of the members of the
-    version module corresponding to the member names given in ``fromlist``.
-    Raises an `AttributeError` if any of these module members are not found.
-    """
-
-    if not fromlist:
-        # Due to a historical quirk of Python's import implementation,
-        # __import__ will not return submodules of a package if 'fromlist' is
-        # empty.
-        # TODO: For Python 3.1 and up it may be preferable to use importlib
-        # instead of the __import__ builtin
-        return __import__(packagename + '.version', fromlist=[''])
-    else:
-        mod = __import__(packagename + '.version', fromlist=fromlist)
-        return tuple(getattr(mod, member) for member in fromlist)
-
-
-def register_commands(package, version, release):
-    if _module_state['registered_commands'] is not None:
-        return _module_state['registered_commands']
-
-    _module_state['registered_commands'] = registered_commands = {
-        'test': generate_test_command(package),
-
-        # Use distutils' sdist because it respects package_data.
-        # setuptools/distributes sdist requires duplication of information in
-        # MANIFEST.in
-        'sdist': DistutilsSdist,
-
-        # The exact form of the build_ext command depends on whether or not
-        # we're building a release version
-        'build_ext': generate_build_ext_command(package, release),
-
-        # We have a custom build_py to generate the default configuration file
-        'build_py': AstropyBuildPy,
-
-        # Since install can (in some circumstances) be run without
-        # first building, we also need to override install and
-        # install_lib.  See #2223
-        'install': AstropyInstall,
-        'install_lib': AstropyInstallLib,
-
-        'register': AstropyRegister
-    }
-
-
-    if _module_state['have_sphinx']:
-        registered_commands['build_sphinx'] = AstropyBuildSphinx
-    else:
-        registered_commands['build_sphinx'] = FakeBuildSphinx
-
-    # Need to override the __name__ here so that the commandline options are
-    # presented as being related to the "build" command, for example; normally
-    # this wouldn't be necessary since commands also have a command_name
-    # attribute, but there is a bug in distutils' help display code that it
-    # uses __name__ instead of command_name. Yay distutils!
-    for name, cls in registered_commands.items():
-        cls.__name__ = name
-
-    # Add a few custom options; more of these can be added by specific packages
-    # later
-    for option in [
-            ('use-system-libraries',
-             "Use system libraries whenever possible", True)]:
-        add_command_option('build', *option)
-        add_command_option('install', *option)
-
-    return registered_commands
-
-
-def generate_test_command(package_name):
-    """
-    Creates a custom 'test' command for the given package which sets the
-    command's ``package_name`` class attribute to the name of the package being
-    tested.
-    """
-
-    return type(package_name.title() + 'Test', (AstropyTest,),
-                {'package_name': package_name})
-
-
-def generate_build_ext_command(packagename, release):
-    """
-    Creates a custom 'build_ext' command that allows for manipulating some of
-    the C extension options at build time.  We use a function to build the
-    class since the base class for build_ext may be different depending on
-    certain build-time parameters (for example, we may use Cython's build_ext
-    instead of the default version in distutils).
-
-    Uses the default distutils.command.build_ext by default.
-    """
-
-    uses_cython = should_build_with_cython(packagename, release)
-
-    if uses_cython:
-        from Cython.Distutils import build_ext as basecls
-    else:
-        basecls = SetuptoolsBuildExt
-
-    attrs = dict(basecls.__dict__)
-    orig_run = getattr(basecls, 'run', None)
-    orig_finalize = getattr(basecls, 'finalize_options', None)
-
-    def finalize_options(self):
-        # Add a copy of the _compiler.so module as well, but only if there are
-        # in fact C modules to compile (otherwise there's no reason to include
-        # a record of the compiler used)
-        if self.extensions:
-            src_path = os.path.relpath(
-                os.path.join(os.path.dirname(__file__), 'src'))
-            shutil.copy2(os.path.join(src_path, 'compiler.c'),
-                         os.path.join(self.package_name, '_compiler.c'))
-            ext = Extension(self.package_name + '._compiler',
-                            [os.path.join(self.package_name, '_compiler.c')])
-            self.extensions.insert(0, ext)
-
-        if orig_finalize is not None:
-            orig_finalize(self)
-
-        # Generate
-        if self.uses_cython:
-            try:
-                from Cython import __version__ as cython_version
-            except ImportError:
-                # This shouldn't happen if we made it this far
-                cython_version = None
-
-            if (cython_version is not None and
-                    cython_version != self.uses_cython):
-                self.force_rebuild = True
-                # Update the used cython version
-                self.uses_cython = cython_version
-
-        # Regardless of the value of the '--force' option, force a rebuild if
-        # the debug flag changed from the last build
-        if self.force_rebuild:
-            self.force = True
-
-    def run(self):
-        # For extensions that require 'numpy' in their include dirs, replace
-        # 'numpy' with the actual paths
-        np_include = get_numpy_include_path()
-        for extension in self.extensions:
-            if 'numpy' in extension.include_dirs:
-                idx = extension.include_dirs.index('numpy')
-                extension.include_dirs.insert(idx, np_include)
-                extension.include_dirs.remove('numpy')
-
-            # Replace .pyx with C-equivalents, unless c files are missing
-            for jdx, src in enumerate(extension.sources):
-                if src.endswith('.pyx'):
-                    pyxfn = src
-                    cfn = src[:-4] + '.c'
-                elif src.endswith('.c'):
-                    pyxfn = src[:-2] + '.pyx'
-                    cfn = src
-
-                if not os.path.isfile(pyxfn):
-                    continue
-
-                if self.uses_cython:
-                    extension.sources[jdx] = pyxfn
-                else:
-                    if os.path.isfile(cfn):
-                        extension.sources[jdx] = cfn
-                    else:
-                        msg = (
-                            'Could not find C file {0} for Cython file {1} '
-                            'when building extension {2}. Cython must be '
-                            'installed to build from a git checkout.'.format(
-                                cfn, pyxfn, extension.name))
-                        raise IOError(errno.ENOENT, msg, cfn)
-
-        if orig_run is not None:
-            # This should always be the case for a correctly implemented
-            # distutils command.
-            orig_run(self)
-
-        # Update cython_version.py if building with Cython
-        try:
-            cython_version = get_pkg_version_module(
-                    packagename, fromlist=['cython_version'])[0]
-        except (AttributeError, ImportError):
-            cython_version = 'unknown'
-        if self.uses_cython and self.uses_cython != cython_version:
-            package_dir = os.path.relpath(packagename)
-            cython_py = os.path.join(package_dir, 'cython_version.py')
-            with open(cython_py, 'w') as f:
-                f.write('# Generated file; do not modify\n')
-                f.write('cython_version = {0!r}\n'.format(self.uses_cython))
-
-            if os.path.isdir(self.build_lib):
-                # The build/lib directory may not exist if the build_py command
-                # was not previously run, which may sometimes be the case
-                self.copy_file(cython_py,
-                               os.path.join(self.build_lib, cython_py),
-                               preserve_mode=False)
-
-            invalidate_caches()
-
-    attrs['run'] = run
-    attrs['finalize_options'] = finalize_options
-    attrs['force_rebuild'] = False
-    attrs['uses_cython'] = uses_cython
-    attrs['package_name'] = packagename
-    attrs['user_options'] = basecls.user_options[:]
-    attrs['boolean_options'] = basecls.boolean_options[:]
-
-    return type('build_ext', (basecls, object), attrs)
-
-
-def _get_platlib_dir(cmd):
-    plat_specifier = '.{0}-{1}'.format(cmd.plat_name, sys.version[0:3])
-    return os.path.join(cmd.build_base, 'lib' + plat_specifier)
-
-
-class AstropyInstall(SetuptoolsInstall):
-    user_options = SetuptoolsInstall.user_options[:]
-    boolean_options = SetuptoolsInstall.boolean_options[:]
-
-    def finalize_options(self):
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-        self.build_lib = platlib_dir
-        SetuptoolsInstall.finalize_options(self)
-
-
-class AstropyInstallLib(SetuptoolsInstallLib):
-    user_options = SetuptoolsInstallLib.user_options[:]
-    boolean_options = SetuptoolsInstallLib.boolean_options[:]
-
-    def finalize_options(self):
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-        self.build_dir = platlib_dir
-        SetuptoolsInstallLib.finalize_options(self)
-
-
-class AstropyBuildPy(SetuptoolsBuildPy):
-    user_options = SetuptoolsBuildPy.user_options[:]
-    boolean_options = SetuptoolsBuildPy.boolean_options[:]
-
-    def finalize_options(self):
-        # Update build_lib settings from the build command to always put
-        # build files in platform-specific subdirectories of build/, even
-        # for projects with only pure-Python source (this is desirable
-        # specifically for support of multiple Python version).
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-
-        build_cmd.build_purelib = platlib_dir
-        build_cmd.build_lib = platlib_dir
-        self.build_lib = platlib_dir
-
-        SetuptoolsBuildPy.finalize_options(self)
-
-    def run_2to3(self, files, doctests=False):
-        # Filter the files to exclude things that shouldn't be 2to3'd
-        skip_2to3 = self.distribution.skip_2to3
-        filtered_files = []
-        for file in files:
-            for package in skip_2to3:
-                if file[len(self.build_lib) + 1:].startswith(package):
-                    break
-            else:
-                filtered_files.append(file)
-
-        SetuptoolsBuildPy.run_2to3(self, filtered_files, doctests)
-
-    def run(self):
-        # first run the normal build_py
-        SetuptoolsBuildPy.run(self)
-
-
-def add_command_option(command, name, doc, is_bool=False):
-    """
-    Add a custom option to a setup command.
-
-    Issues a warning if the option already exists on that command.
-
-    Parameters
-    ----------
-    command : str
-        The name of the command as given on the command line
-
-    name : str
-        The name of the build option
-
-    doc : str
-        A short description of the option, for the `--help` message
-
-    is_bool : bool, optional
-        When `True`, the option is a boolean option and doesn't
-        require an associated value.
-    """
-
-    dist = get_dummy_distribution()
-    cmdcls = dist.get_command_class(command)
-
-    if (hasattr(cmdcls, '_astropy_helpers_options') and
-            name in cmdcls._astropy_helpers_options):
-        return
-
-    attr = name.replace('-', '_')
-
-    if hasattr(cmdcls, attr):
-        raise RuntimeError(
-            '{0!r} already has a {1!r} class attribute, barring {2!r} from '
-            'being usable as a custom option name.'.format(cmdcls, attr, name))
-
-    for idx, cmd in enumerate(cmdcls.user_options):
-        if cmd[0] == name:
-            log.warn('Overriding existing {0!r} option '
-                     '{1!r}'.format(command, name))
-            del cmdcls.user_options[idx]
-            if name in cmdcls.boolean_options:
-                cmdcls.boolean_options.remove(name)
-            break
-
-    cmdcls.user_options.append((name, None, doc))
-
-    if is_bool:
-        cmdcls.boolean_options.append(name)
-
-    # Distutils' command parsing requires that a command object have an
-    # attribute with the same name as the option (with '-' replaced with '_')
-    # in order for that option to be recognized as valid
-    setattr(cmdcls, attr, None)
-
-    # This caches the options added through add_command_option so that if it is
-    # run multiple times in the same interpreter repeated adds are ignored
-    # (this way we can still raise a RuntimeError if a custom option overrides
-    # a built-in option)
-    if not hasattr(cmdcls, '_astropy_helpers_options'):
-        cmdcls._astropy_helpers_options = set([name])
-    else:
-        cmdcls._astropy_helpers_options.add(name)
-
-
-class AstropyRegister(SetuptoolsRegister):
-    """Extends the built in 'register' command to support a ``--hidden`` option
-    to make the registered version hidden on PyPI by default.
-
-    The result of this is that when a version is registered as "hidden" it can
-    still be downloaded from PyPI, but it does not show up in the list of
-    actively supported versions under http://pypi.python.org/pypi/astropy, and
-    is not set as the most recent version.
-
-    Although this can always be set through the web interface it may be more
-    convenient to be able to specify via the 'register' command.  Hidden may
-    also be considered a safer default when running the 'register' command,
-    though this command uses distutils' normal behavior if the ``--hidden``
-    option is omitted.
-    """
-
-    user_options = SetuptoolsRegister.user_options + [
-        ('hidden', None, 'mark this release as hidden on PyPI by default')
-    ]
-    boolean_options = SetuptoolsRegister.boolean_options + ['hidden']
-
-    def initialize_options(self):
-        SetuptoolsRegister.initialize_options(self)
-        self.hidden = False
-
-    def build_post_data(self, action):
-        data = SetuptoolsRegister.build_post_data(self, action)
-        if action == 'submit' and self.hidden:
-            data['_pypi_hidden'] = '1'
-        return data
-
-    def _set_config(self):
-        # The original register command is buggy--if you use .pypirc with a
-        # server-login section *at all* the repository you specify with the -r
-        # option will be overwritten with either the repository in .pypirc or
-        # with the default,
-        # If you do not have a .pypirc using the -r option will just crash.
-        # Way to go distutils
-
-        # If we don't set self.repository back to a default value _set_config
-        # can crash if there was a user-supplied value for this option; don't
-        # worry, we'll get the real value back afterwards
-        self.repository = 'pypi'
-        SetuptoolsRegister._set_config(self)
-        options = self.distribution.get_option_dict('register')
-        if 'repository' in options:
-            source, value = options['repository']
-            # Really anything that came from setup.cfg or the command line
-            # should override whatever was in .pypirc
-            self.repository = value
-
-
-if _module_state['have_sphinx']:
-    class AstropyBuildSphinx(SphinxBuildDoc):
-        """ A version of the ``build_sphinx`` command that uses the
-        version of Astropy that is built by the setup ``build`` command,
-        rather than whatever is installed on the system - to build docs
-        against the installed version, run ``make html`` in the
-        ``astropy/docs`` directory.
-
-        This also automatically creates the docs/_static directories -
-        this is needed because github won't create the _static dir
-        because it has no tracked files.
-        """
-
-        description = 'Build Sphinx documentation for Astropy environment'
-        user_options = SphinxBuildDoc.user_options[:]
-        user_options.append(('warnings-returncode', 'w',
-                             'Parses the sphinx output and sets the return '
-                             'code to 1 if there are any warnings. Note that '
-                             'this will cause the sphinx log to only update '
-                             'when it completes, rather than continuously as '
-                             'is normally the case.'))
-        user_options.append(('clean-docs', 'l',
-                             'Completely clean previous builds, including '
-                             'automodapi-generated files before building new '
-                             'ones'))
-        user_options.append(('no-intersphinx', 'n',
-                             'Skip intersphinx, even if conf.py says to use '
-                             'it'))
-        user_options.append(('open-docs-in-browser', 'o',
-                             'Open the docs in a browser (using the '
-                             'webbrowser module) if the build finishes '
-                             'successfully.'))
-
-        boolean_options = SphinxBuildDoc.boolean_options[:]
-        boolean_options.append('warnings-returncode')
-        boolean_options.append('clean-docs')
-        boolean_options.append('no-intersphinx')
-        boolean_options.append('open-docs-in-browser')
-
-        _self_iden_rex = re.compile(r"self\.([^\d\W][\w]+)", re.UNICODE)
-
-        def initialize_options(self):
-            SphinxBuildDoc.initialize_options(self)
-            self.clean_docs = False
-            self.no_intersphinx = False
-            self.open_docs_in_browser = False
-            self.warnings_returncode = False
-
-        def finalize_options(self):
-            #Clear out previous sphinx builds, if requested
-            if self.clean_docs:
-                dirstorm = [os.path.join(self.source_dir, 'api')]
-                if self.build_dir is None:
-                    dirstorm.append('docs/_build')
-                else:
-                    dirstorm.append(self.build_dir)
-
-                for d in dirstorm:
-                    if os.path.isdir(d):
-                        log.info('Cleaning directory ' + d)
-                        shutil.rmtree(d)
-                    else:
-                        log.info('Not cleaning directory ' + d + ' because '
-                                 'not present or not a directory')
-
-            SphinxBuildDoc.finalize_options(self)
-
-        def run(self):
-            # TODO: Break this method up into a few more subroutines and
-            # document them better
-            import webbrowser
-
-            if PY3:
-                from urllib.request import pathname2url
-            else:
-                from urllib import pathname2url
-
-            # This is used at the very end of `run` to decide if sys.exit should
-            # be called. If it's None, it won't be.
-            retcode = None
-
-            # If possible, create the _static dir
-            if self.build_dir is not None:
-                # the _static dir should be in the same place as the _build dir
-                # for Astropy
-                basedir, subdir = os.path.split(self.build_dir)
-                if subdir == '':  # the path has a trailing /...
-                    basedir, subdir = os.path.split(basedir)
-                staticdir = os.path.join(basedir, '_static')
-                if os.path.isfile(staticdir):
-                    raise DistutilsOptionError(
-                        'Attempted to build_sphinx in a location where' +
-                        staticdir + 'is a file.  Must be a directory.')
-                self.mkpath(staticdir)
-
-            #Now make sure Astropy is built and determine where it was built
-            build_cmd = self.reinitialize_command('build')
-            build_cmd.inplace = 0
-            self.run_command('build')
-            build_cmd = self.get_finalized_command('build')
-            build_cmd_path = os.path.abspath(build_cmd.build_lib)
-
-            ah_importer = pkgutil.get_importer('astropy_helpers')
-            ah_path = os.path.abspath(ah_importer.path)
-
-            #Now generate the source for and spawn a new process that runs the
-            #command.  This is needed to get the correct imports for the built
-            #version
-            runlines, runlineno = inspect.getsourcelines(SphinxBuildDoc.run)
-            subproccode = textwrap.dedent("""
-                from sphinx.setup_command import *
-
-                os.chdir({srcdir!r})
-                sys.path.insert(0, {build_cmd_path!r})
-                sys.path.insert(0, {ah_path!r})
-
-            """).format(build_cmd_path=build_cmd_path, ah_path=ah_path,
-                        srcdir=self.source_dir)
-            #runlines[1:] removes 'def run(self)' on the first line
-            subproccode += textwrap.dedent(''.join(runlines[1:]))
-
-            # All "self.foo" in the subprocess code needs to be replaced by the
-            # values taken from the current self in *this* process
-            subproccode = AstropyBuildSphinx._self_iden_rex.split(subproccode)
-            for i in range(1, len(subproccode), 2):
-                iden = subproccode[i]
-                val = getattr(self, iden)
-                if iden.endswith('_dir'):
-                    #Directories should be absolute, because the `chdir` call
-                    #in the new process moves to a different directory
-                    subproccode[i] = repr(os.path.abspath(val))
-                else:
-                    subproccode[i] = repr(val)
-            subproccode = ''.join(subproccode)
-
-            if self.no_intersphinx:
-                #the confoverrides variable in sphinx.setup_command.BuildDoc can
-                #be used to override the conf.py ... but this could well break
-                #if future versions of sphinx change the internals of BuildDoc,
-                #so remain vigilant!
-                subproccode = subproccode.replace('confoverrides = {}',
-                    'confoverrides = {\'intersphinx_mapping\':{}}')
-
-            log.debug('Starting subprocess of {0} with python code:\n{1}\n'
-                      '[CODE END])'.format(sys.executable, subproccode))
-
-            # To return the number of warnings, we need to capture stdout. This
-            # prevents a continuous updating at the terminal, but there's no
-            # apparent way around this.
-            if self.warnings_returncode:
-                proc = subprocess.Popen([sys.executable],
-                                        stdin=subprocess.PIPE,
-                                        stdout=subprocess.PIPE,
-                                        stderr=subprocess.STDOUT)
-                stdo, stde = proc.communicate(subproccode)
-
-                print(stdo)
-
-                stdolines = stdo.split('\n')
-
-                if stdolines[-2] == 'build succeeded.':
-                    retcode = 0
-                else:
-                    retcode = 1
-
-                if retcode != 0:
-                    if os.environ.get('TRAVIS', None) == 'true':
-                        #this means we are in the travis build, so customize
-                        #the message appropriately.
-                        msg = ('The build_sphinx travis build FAILED '
-                               'because sphinx issued documentation '
-                               'warnings (scroll up to see the warnings).')
-                    else:  # standard failure message
-                        msg = ('build_sphinx returning a non-zero exit '
-                               'code because sphinx issued documentation '
-                               'warnings.')
-                    log.warn(msg)
-
-            else:
-                proc = subprocess.Popen([sys.executable], stdin=subprocess.PIPE)
-                proc.communicate(subproccode.encode('utf-8'))
-
-            if proc.returncode == 0:
-                if self.open_docs_in_browser:
-                    if self.builder == 'html':
-                        absdir = os.path.abspath(self.builder_target_dir)
-                        index_path = os.path.join(absdir, 'index.html')
-                        fileurl = 'file://' + pathname2url(index_path)
-                        webbrowser.open(fileurl)
-                    else:
-                        log.warn('open-docs-in-browser option was given, but '
-                                 'the builder is not html! Ignogring.')
-            else:
-                log.warn('Sphinx Documentation subprocess failed with return '
-                         'code ' + str(proc.returncode))
-
-            if retcode is not None:
-                # this is potentially dangerous in that there might be something
-                # after the call to `setup` in `setup.py`, and exiting here will
-                # prevent that from running.  But there's no other apparent way
-                # to signal what the return code should be.
-                sys.exit(retcode)
-
-
-def get_distutils_display_options():
-    """ Returns a set of all the distutils display options in their long and
-    short forms.  These are the setup.py arguments such as --name or --version
-    which print the project's metadata and then exit.
-
-    Returns
-    -------
-    opts : set
-        The long and short form display option arguments, including the - or --
-    """
-
-    short_display_opts = set('-' + o[1] for o in Distribution.display_options
-                             if o[1])
-    long_display_opts = set('--' + o[0] for o in Distribution.display_options)
-
-    # Include -h and --help which are not explicitly listed in
-    # Distribution.display_options (as they are handled by optparse)
-    short_display_opts.add('-h')
-    long_display_opts.add('--help')
-
-    # This isn't the greatest approach to hardcode these commands.
-    # However, there doesn't seem to be a good way to determine
-    # whether build *will be* run as part of the command at this
-    # phase.
-    display_commands = set([
-        'clean', 'register', 'setopt', 'saveopts', 'egg_info',
-        'alias'])
-
-    return short_display_opts.union(long_display_opts.union(display_commands))
-
-
-def is_distutils_display_option():
-    """ Returns True if sys.argv contains any of the distutils display options
-    such as --version or --name.
-    """
-
-    display_options = get_distutils_display_options()
-    return bool(set(sys.argv[1:]).intersection(display_options))
-
-
-def update_package_files(srcdir, extensions, package_data, packagenames,
-                         package_dirs):
-    """
-    This function is deprecated and maintained for backward compatibility
-    with affiliated packages.  Affiliated packages should update their
-    setup.py to use `get_package_info` instead.
-    """
-
-    info = get_package_info(srcdir)
-    extensions.extend(info['ext_modules'])
-    package_data.update(info['package_data'])
-    packagenames = list(set(packagenames + info['packages']))
-    package_dirs.update(info['package_dir'])
-
-
-def get_package_info(srcdir='.', exclude=()):
-    """
-    Collates all of the information for building all subpackages
-    subpackages and returns a dictionary of keyword arguments that can
-    be passed directly to `distutils.setup`.
-
-    The purpose of this function is to allow subpackages to update the
-    arguments to the package's ``setup()`` function in its setup.py
-    script, rather than having to specify all extensions/package data
-    directly in the ``setup.py``.  See Astropy's own
-    ``setup.py`` for example usage and the Astropy development docs
-    for more details.
-
-    This function obtains that information by iterating through all
-    packages in ``srcdir`` and locating a ``setup_package.py`` module.
-    This module can contain the following functions:
-    ``get_extensions()``, ``get_package_data()``,
-    ``get_build_options()``, ``get_external_libraries()``,
-    and ``requires_2to3()``.
-
-    Each of those functions take no arguments.
-
-    - ``get_extensions`` returns a list of
-      `distutils.extension.Extension` objects.
-
-    - ``get_package_data()`` returns a dict formatted as required by
-      the ``package_data`` argument to ``setup()``.
-
-    - ``get_build_options()`` returns a list of tuples describing the
-      extra build options to add.
-
-    - ``get_external_libraries()`` returns
-      a list of libraries that can optionally be built using external
-      dependencies.
-
-    - ``requires_2to3()`` should return `True` when the source code
-      requires `2to3` processing to run on Python 3.x.  If
-      ``requires_2to3()`` is missing, it is assumed to return `True`.
-
-    """
-    ext_modules = []
-    packages = []
-    package_data = {}
-    package_dir = {}
-    skip_2to3 = []
-
-    # Use the find_packages tool to locate all packages and modules
-    packages = filter_packages(find_packages(srcdir, exclude=exclude))
-
-    # For each of the setup_package.py modules, extract any
-    # information that is needed to install them.  The build options
-    # are extracted first, so that their values will be available in
-    # subsequent calls to `get_extensions`, etc.
-    for setuppkg in iter_setup_packages(srcdir, packages):
-        if hasattr(setuppkg, 'get_build_options'):
-            options = setuppkg.get_build_options()
-            for option in options:
-                add_command_option('build', *option)
-        if hasattr(setuppkg, 'get_external_libraries'):
-            libraries = setuppkg.get_external_libraries()
-            for library in libraries:
-                add_external_library(library)
-        if hasattr(setuppkg, 'requires_2to3'):
-            requires_2to3 = setuppkg.requires_2to3()
-        else:
-            requires_2to3 = True
-        if not requires_2to3:
-            skip_2to3.append(
-                os.path.dirname(setuppkg.__file__))
-
-    for setuppkg in iter_setup_packages(srcdir, packages):
-        # get_extensions must include any Cython extensions by their .pyx
-        # filename.
-        if hasattr(setuppkg, 'get_extensions'):
-            ext_modules.extend(setuppkg.get_extensions())
-        if hasattr(setuppkg, 'get_package_data'):
-            package_data.update(setuppkg.get_package_data())
-
-    # Locate any .pyx files not already specified, and add their extensions in.
-    # The default include dirs include numpy to facilitate numerical work.
-    ext_modules.extend(get_cython_extensions(srcdir, packages, ext_modules,
-                                             ['numpy']))
-
-    # Now remove extensions that have the special name 'skip_cython', as they
-    # exist Only to indicate that the cython extensions shouldn't be built
-    for i, ext in reversed(list(enumerate(ext_modules))):
-        if ext.name == 'skip_cython':
-            del ext_modules[i]
-
-    # On Microsoft compilers, we need to pass the '/MANIFEST'
-    # commandline argument.  This was the default on MSVC 9.0, but is
-    # now required on MSVC 10.0, but it doesn't seeem to hurt to add
-    # it unconditionally.
-    if get_compiler_option() == 'msvc':
-        for ext in ext_modules:
-            ext.extra_link_args.append('/MANIFEST')
-
-    return {
-        'ext_modules': ext_modules,
-        'packages': packages,
-        'package_dir': package_dir,
-        'package_data': package_data,
-        'skip_2to3': skip_2to3
-        }
-
-
-def iter_setup_packages(srcdir, packages):
-    """ A generator that finds and imports all of the ``setup_package.py``
-    modules in the source packages.
-
-    Returns
-    -------
-    modgen : generator
-        A generator that yields (modname, mod), where `mod` is the module and
-        `modname` is the module name for the ``setup_package.py`` modules.
-
-    """
-
-    for packagename in packages:
-        package_parts = packagename.split('.')
-        package_path = os.path.join(srcdir, *package_parts)
-        setup_package = os.path.relpath(
-            os.path.join(package_path, 'setup_package.py'))
-
-        if os.path.isfile(setup_package):
-            module = import_file(setup_package)
-            yield module
-
-
-def iter_pyx_files(package_dir, package_name):
-    """
-    A generator that yields Cython source files (ending in '.pyx') in the
-    source packages.
-
-    Returns
-    -------
-    pyxgen : generator
-        A generator that yields (extmod, fullfn) where `extmod` is the
-        full name of the module that the .pyx file would live in based
-        on the source directory structure, and `fullfn` is the path to
-        the .pyx file.
-    """
-    for dirpath, dirnames, filenames in walk_skip_hidden(package_dir):
-        for fn in filenames:
-            if fn.endswith('.pyx'):
-                fullfn = os.path.relpath(os.path.join(dirpath, fn))
-                # Package must match file name
-                extmod = '.'.join([package_name, fn[:-4]])
-                yield (extmod, fullfn)
-
-        break  # Don't recurse into subdirectories
-
-
-def should_build_with_cython(package, release=None):
-    """Returns the previously used Cython version (or 'unknown' if not
-    previously built) if Cython should be used to build extension modules from
-    pyx files.  If the ``release`` parameter is not specified an attempt is
-    made to determine the release flag from `astropy.version`.
-    """
-
-    try:
-        version_module = __import__(package + '.cython_version',
-                                    fromlist=['release', 'cython_version'])
-    except ImportError:
-        version_module = None
-
-    if release is None and version_module is not None:
-        try:
-            release = version_module.release
-        except AttributeError:
-            pass
-
-    try:
-        cython_version = version_module.cython_version
-    except AttributeError:
-        cython_version = 'unknown'
-
-    # Only build with Cython if, of course, Cython is installed, we're in a
-    # development version (i.e. not release) or the Cython-generated source
-    # files haven't been created yet (cython_version == 'unknown'). The latter
-    # case can happen even when release is True if checking out a release tag
-    # from the repository
-    if (_module_state['have_cython'] and
-            (not release or cython_version == 'unknown')):
-        return cython_version
-    else:
-        return False
-
-
-def get_cython_extensions(srcdir, packages, prevextensions=tuple(),
-                          extincludedirs=None):
-    """
-    Looks for Cython files and generates Extensions if needed.
-
-    Parameters
-    ----------
-    srcdir : str
-        Path to the root of the source directory to search.
-    prevextensions : list of `~distutils.core.Extension` objects
-        The extensions that are already defined.  Any .pyx files already here
-        will be ignored.
-    extincludedirs : list of str or None
-        Directories to include as the `include_dirs` argument to the generated
-        `~distutils.core.Extension` objects.
-
-    Returns
-    -------
-    exts : list of `~distutils.core.Extension` objects
-        The new extensions that are needed to compile all .pyx files (does not
-        include any already in `prevextensions`).
-    """
-
-    # Vanilla setuptools and old versions of distribute include Cython files
-    # as .c files in the sources, not .pyx, so we cannot simply look for
-    # existing .pyx sources in the previous sources, but we should also check
-    # for .c files with the same remaining filename. So we look for .pyx and
-    # .c files, and we strip the extension.
-    prevsourcepaths = []
-    ext_modules = []
-
-    for ext in prevextensions:
-        for s in ext.sources:
-            if s.endswith(('.pyx', '.c')):
-                sourcepath = os.path.realpath(os.path.splitext(s)[0])
-                prevsourcepaths.append(sourcepath)
-
-    for package_name in packages:
-        package_parts = package_name.split('.')
-        package_path = os.path.join(srcdir, *package_parts)
-
-        for extmod, pyxfn in iter_pyx_files(package_path, package_name):
-            sourcepath = os.path.realpath(os.path.splitext(pyxfn)[0])
-            if sourcepath not in prevsourcepaths:
-                ext_modules.append(Extension(extmod, [pyxfn],
-                                             include_dirs=extincludedirs))
-
-    return ext_modules
-
-
-def write_if_different(filename, data):
-    """ Write `data` to `filename`, if the content of the file is different.
-
-    Parameters
-    ----------
-    filename : str
-        The file name to be written to.
-    data : bytes
-        The data to be written to `filename`.
-    """
-    assert isinstance(data, bytes)
-
-    if os.path.exists(filename):
-        with open(filename, 'rb') as fd:
-            original_data = fd.read()
-    else:
-        original_data = None
-
-    if original_data != data:
-        with open(filename, 'wb') as fd:
-            fd.write(data)
-
-
-def get_numpy_include_path():
-    """
-    Gets the path to the numpy headers.
-    """
-    # We need to go through this nonsense in case setuptools
-    # downloaded and installed Numpy for us as part of the build or
-    # install, since Numpy may still think it's in "setup mode", when
-    # in fact we're ready to use it to build astropy now.
-
-    if sys.version_info[0] >= 3:
-        import builtins
-        if hasattr(builtins, '__NUMPY_SETUP__'):
-            del builtins.__NUMPY_SETUP__
-        import imp
-        import numpy
-        imp.reload(numpy)
-    else:
-        import __builtin__
-        if hasattr(__builtin__, '__NUMPY_SETUP__'):
-            del __builtin__.__NUMPY_SETUP__
-        import numpy
-        reload(numpy)
-
-    try:
-        numpy_include = numpy.get_include()
-    except AttributeError:
-        numpy_include = numpy.get_numpy_include()
-    return numpy_include
-
-
-def import_file(filename):
-    """
-    Imports a module from a single file as if it doesn't belong to a
-    particular package.
-    """
-    # Specifying a traditional dot-separated fully qualified name here
-    # results in a number of "Parent module 'astropy' not found while
-    # handling absolute import" warnings.  Using the same name, the
-    # namespaces of the modules get merged together.  So, this
-    # generates an underscore-separated name which is more likely to
-    # be unique, and it doesn't really matter because the name isn't
-    # used directly here anyway.
-    with open(filename, 'U') as fd:
-        name = '_'.join(
-            os.path.relpath(os.path.splitext(filename)[0]).split(os.sep)[1:])
-        return imp.load_module(name, fd, filename, ('.py', 'U', 1))
-
-
-class DistutilsExtensionArgs(collections.defaultdict):
-    """
-    A special dictionary whose default values are the empty list.
-
-    This is useful for building up a set of arguments for
-    `distutils.Extension` without worrying whether the entry is
-    already present.
-    """
-    def __init__(self, *args, **kwargs):
-        def default_factory():
-            return []
-
-        super(DistutilsExtensionArgs, self).__init__(
-            default_factory, *args, **kwargs)
-
-    def update(self, other):
-        for key, val in other.items():
-            self[key].extend(val)
-
-
-def pkg_config(packages, default_libraries, executable='pkg-config'):
-    """
-    Uses pkg-config to update a set of distutils Extension arguments
-    to include the flags necessary to link against the given packages.
-
-    If the pkg-config lookup fails, default_libraries is applied to
-    libraries.
-
-    Parameters
-    ----------
-    packages : list of str
-        A list of pkg-config packages to look up.
-
-    default_libraries : list of str
-        A list of library names to use if the pkg-config lookup fails.
-
-    Returns
-    -------
-    config : dict
-        A dictionary containing keyword arguments to
-        `distutils.Extension`.  These entries include:
-
-        - ``include_dirs``: A list of include directories
-        - ``library_dirs``: A list of library directories
-        - ``libraries``: A list of libraries
-        - ``define_macros``: A list of macro defines
-        - ``undef_macros``: A list of macros to undefine
-        - ``extra_compile_args``: A list of extra arguments to pass to
-          the compiler
-    """
-
-    flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries',
-                '-D': 'define_macros', '-U': 'undef_macros'}
-    command = "{0} --libs --cflags {1}".format(executable, ' '.join(packages)),
-
-    result = DistutilsExtensionArgs()
-
-    try:
-        pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
-        output = pipe.communicate()[0].strip()
-    except subprocess.CalledProcessError as e:
-        lines = [
-            "{0} failed.  This may cause the build to fail below.".format(executable),
-            "  command: {0}".format(e.cmd),
-            "  returncode: {0}".format(e.returncode),
-            "  output: {0}".format(e.output)
-            ]
-        log.warn('\n'.join(lines))
-        result['libraries'].extend(default_libraries)
-    else:
-        if pipe.returncode != 0:
-            lines = [
-                "pkg-config could not lookup up package(s) {0}.".format(
-                    ", ".join(packages)),
-                "This may cause the build to fail below."
-                ]
-            log.warn('\n'.join(lines))
-            result['libraries'].extend(default_libraries)
-        else:
-            for token in output.split():
-                # It's not clear what encoding the output of
-                # pkg-config will come to us in.  It will probably be
-                # some combination of pure ASCII (for the compiler
-                # flags) and the filesystem encoding (for any argument
-                # that includes directories or filenames), but this is
-                # just conjecture, as the pkg-config documentation
-                # doesn't seem to address it.
-                arg = token[:2].decode('ascii')
-                value = token[2:].decode(sys.getfilesystemencoding())
-                if arg in flag_map:
-                    if arg == '-D':
-                        value = tuple(value.split('=', 1))
-                    result[flag_map[arg]].append(value)
-                else:
-                    result['extra_compile_args'].append(value)
-
-    return result
-
-
-def add_external_library(library):
-    """
-    Add a build option for selecting the internal or system copy of a library.
-
-    Parameters
-    ----------
-    library : str
-        The name of the library.  If the library is `foo`, the build
-        option will be called `--use-system-foo`.
-    """
-
-    for command in ['build', 'build_ext', 'install']:
-        add_command_option(command, str('use-system-' + library),
-                           'Use the system {0} library'.format(library),
-                           is_bool=True)
-
-
-def use_system_library(library):
-    """
-    Returns `True` if the build configuration indicates that the given
-    library should use the system copy of the library rather than the
-    internal one.
-
-    For the given library `foo`, this will be `True` if
-    `--use-system-foo` or `--use-system-libraries` was provided at the
-    commandline or in `setup.cfg`.
-
-    Parameters
-    ----------
-    library : str
-        The name of the library
-
-    Returns
-    -------
-    use_system : bool
-        `True` if the build should use the system copy of the library.
-    """
-    return (
-        get_distutils_build_or_install_option('use_system_{0}'.format(library))
-        or get_distutils_build_or_install_option('use_system_libraries'))
-
-
-def filter_packages(packagenames):
-    """
-    Removes some packages from the package list that shouldn't be
-    installed on the current version of Python.
-    """
-
-    if PY3:
-        exclude = '_py2'
-    else:
-        exclude = '_py3'
-
-    return [x for x in packagenames if not x.endswith(exclude)]
-
-
-class FakeBuildSphinx(Command):
-    """
-    A dummy build_sphinx command that is called if Sphinx is not
-    installed and displays a relevant error message
-    """
-
-    #user options inherited from sphinx.setup_command.BuildDoc
-    user_options = [
-         ('fresh-env', 'E', '' ),
-         ('all-files', 'a', ''),
-         ('source-dir=', 's', ''),
-         ('build-dir=', None, ''),
-         ('config-dir=', 'c', ''),
-         ('builder=', 'b', ''),
-         ('project=', None, ''),
-         ('version=', None, ''),
-         ('release=', None, ''),
-         ('today=', None, ''),
-         ('link-index', 'i', ''),
-     ]
-
-    #user options appended in astropy.setup_helpers.AstropyBuildSphinx
-    user_options.append(('warnings-returncode', 'w',''))
-    user_options.append(('clean-docs', 'l', ''))
-    user_options.append(('no-intersphinx', 'n', ''))
-    user_options.append(('open-docs-in-browser', 'o',''))
-
-
-
-    def initialize_options(self):
-        try:
-            raise RuntimeError("Sphinx must be installed for build_sphinx")
-        except:
-            log.error('error : Sphinx must be installed for build_sphinx')
-            sys.exit(1)
diff --git a/astropy_helpers/astropy_helpers/sphinx/__init__.py b/astropy_helpers/astropy_helpers/sphinx/__init__.py
deleted file mode 100644
index e446ac0..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""
-This package contains utilities and extensions for the Astropy sphinx
-documentation.  In particular, the `astropy.sphinx.conf` should be imported by
-the sphinx ``conf.py`` file for affiliated packages that wish to make use of
-the Astropy documentation format.
-"""
diff --git a/astropy_helpers/astropy_helpers/sphinx/conf.py b/astropy_helpers/astropy_helpers/sphinx/conf.py
deleted file mode 100644
index e32dd87..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/conf.py
+++ /dev/null
@@ -1,310 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-#
-# Astropy shared Sphinx settings.  These settings are shared between
-# astropy itself and affiliated packages.
-#
-# Note that not all possible configuration values are present in this file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import warnings
-
-from os import path
-
-
-# -- General configuration ----------------------------------------------------
-
-# The version check in Sphinx itself can only compare the major and
-# minor parts of the version number, not the micro.  To do a more
-# specific version check, call check_sphinx_version("x.y.z.") from
-# your project's conf.py
-needs_sphinx = '1.2'
-
-
-def check_sphinx_version(expected_version):
-    import sphinx
-    from distutils import version
-
-    sphinx_version = version.LooseVersion(sphinx.__version__)
-    expected_version = version.LooseVersion(expected_version)
-    if sphinx_version < expected_version:
-        raise RuntimeError(
-            "At least Sphinx version {0} is required to build this "
-            "documentation.  Found {1}.".format(
-                expected_version, sphinx_version))
-
-
-# Configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {
-    'python': ('http://docs.python.org/', None),
-    'python3': ('http://docs.python.org/3/', path.abspath(path.join(path.dirname(__file__), 'local/python3links.inv'))),
-    'numpy': ('http://docs.scipy.org/doc/numpy/', None),
-    'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
-    'matplotlib': ('http://matplotlib.sourceforge.net/', None),
-    'astropy': ('http://docs.astropy.org/en/stable/', None),
-    'h5py': ('http://docs.h5py.org/en/latest/', None)
-    }
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# Add any paths that contain templates here, relative to this directory.
-# templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents. Set to the "smart" one.
-default_role = 'obj'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# This is added to the end of RST files - a good place to put substitutions to
-# be used globally.
-rst_epilog = """
-.. _Astropy: http://astropy.org
-"""
-
-
-# -- Project information ------------------------------------------------------
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-#pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Settings for extensions and extension options ----------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
-    'sphinx.ext.autodoc',
-    'sphinx.ext.intersphinx',
-    'sphinx.ext.todo',
-    'sphinx.ext.coverage',
-    'sphinx.ext.pngmath',
-    'sphinx.ext.inheritance_diagram',
-    'astropy_helpers.sphinx.ext.numpydoc',
-    'astropy_helpers.sphinx.ext.astropyautosummary',
-    'astropy_helpers.sphinx.ext.automodsumm',
-    'astropy_helpers.sphinx.ext.automodapi',
-    'astropy_helpers.sphinx.ext.tocdepthfix',
-    'astropy_helpers.sphinx.ext.doctest',
-    'astropy_helpers.sphinx.ext.changelog_links',
-    'astropy_helpers.sphinx.ext.viewcode',  # Use patched version of viewcode
-    'astropy_helpers.sphinx.ext.smart_resolver'
-    ]
-
-# Above, we use a patched version of viewcode rather than 'sphinx.ext.viewcode'
-# This can be changed to the sphinx version once the following issue is fixed
-# in sphinx:
-# https://bitbucket.org/birkenfeld/sphinx/issue/623/
-# extension-viewcode-fails-with-function
-
-try:
-    import matplotlib.sphinxext.plot_directive
-    extensions += [matplotlib.sphinxext.plot_directive.__name__]
-# AttributeError is checked here in case matplotlib is installed but
-# Sphinx isn't.  Note that this module is imported by the config file
-# generator, even if we're not building the docs.
-except (ImportError, AttributeError):
-    warnings.warn(
-        "matplotlib's plot_directive could not be imported. " +
-        "Inline plots will not be included in the output")
-
-# Don't show summaries of the members in each class along with the
-# class' docstring
-numpydoc_show_class_members = False
-
-autosummary_generate = True
-
-automodapi_toctreedirnm = 'api'
-
-# Class documentation should contain *both* the class docstring and
-# the __init__ docstring
-autoclass_content = "both"
-
-
-# -- Options for HTML output -------------------------------------------------
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = [path.abspath(path.join(path.dirname(__file__), 'themes'))]
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'bootstrap-astropy'
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {
-    '**': ['localtoc.html'],
-    'search': [],
-    'genindex': [],
-    'py-modindex': [],
-}
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-
-# included in the bootstrap-astropy theme
-html_favicon = path.join(html_theme_path[0], html_theme, 'static',
-                         'astropy_logo.ico')
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-html_last_updated_fmt = '%d %b %Y'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# -- Options for LaTeX output ------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-latex_use_parts = True
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Additional stuff for the LaTeX preamble.
-latex_preamble = r"""
-% Use a more modern-looking monospace font
-\usepackage{inconsolata}
-
-% The enumitem package provides unlimited nesting of lists and enums.
-% Sphinx may use this in the future, in which case this can be removed.
-% See https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested
-\usepackage{enumitem}
-\setlistdepth{15}
-
-% In the parameters section, place a newline after the Parameters
-% header.  (This is stolen directly from Numpy's conf.py, since it
-% affects Numpy-style docstrings).
-\usepackage{expdlist}
-\let\latexdescription=\description
-\def\description{\latexdescription{}{} \breaklabel}
-
-% Support the superscript Unicode numbers used by the "unicode" units
-% formatter
-\DeclareUnicodeCharacter{2070}{\ensuremath{^0}}
-\DeclareUnicodeCharacter{00B9}{\ensuremath{^1}}
-\DeclareUnicodeCharacter{00B2}{\ensuremath{^2}}
-\DeclareUnicodeCharacter{00B3}{\ensuremath{^3}}
-\DeclareUnicodeCharacter{2074}{\ensuremath{^4}}
-\DeclareUnicodeCharacter{2075}{\ensuremath{^5}}
-\DeclareUnicodeCharacter{2076}{\ensuremath{^6}}
-\DeclareUnicodeCharacter{2077}{\ensuremath{^7}}
-\DeclareUnicodeCharacter{2078}{\ensuremath{^8}}
-\DeclareUnicodeCharacter{2079}{\ensuremath{^9}}
-\DeclareUnicodeCharacter{207B}{\ensuremath{^-}}
-\DeclareUnicodeCharacter{00B0}{\ensuremath{^{\circ}}}
-\DeclareUnicodeCharacter{2032}{\ensuremath{^{\prime}}}
-\DeclareUnicodeCharacter{2033}{\ensuremath{^{\prime\prime}}}
-
-% Make the "warning" and "notes" sections use a sans-serif font to
-% make them stand out more.
-\renewenvironment{notice}[2]{
-  \def\py at noticetype{#1}
-  \csname py at noticestart@#1\endcsname
-  \textsf{\textbf{#2}}
-}{\csname py at noticeend@\py at noticetype\endcsname}
-"""
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# -- Options for the linkcheck builder ----------------------------------------
-
-# A timeout value, in seconds, for the linkcheck builder
-linkcheck_timeout = 60
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/__init__.py b/astropy_helpers/astropy_helpers/sphinx/ext/__init__.py
deleted file mode 100644
index 0fce2cf..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-from .numpydoc import setup
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/astropyautosummary.py b/astropy_helpers/astropy_helpers/sphinx/ext/astropyautosummary.py
deleted file mode 100644
index 70e4051..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/astropyautosummary.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension builds off of `sphinx.ext.autosummary` to
-clean up some issues it presents in the Astropy docs.
-
-The main issue this fixes is the summary tables getting cut off before the
-end of the sentence in some cases.
-
-"""
-import re
-
-from sphinx.ext.autosummary import Autosummary
-
-# used in AstropyAutosummary.get_items
-_itemsummrex = re.compile(r'^([A-Z].*?\.(?:\s|$))')
-
-
-class AstropyAutosummary(Autosummary):
-    def get_items(self, names):
-        """Try to import the given names, and return a list of
-        ``[(name, signature, summary_string, real_name), ...]``.
-        """
-        from sphinx.ext.autosummary import (get_import_prefixes_from_env,
-            import_by_name, get_documenter, mangle_signature)
-
-        env = self.state.document.settings.env
-
-        prefixes = get_import_prefixes_from_env(env)
-
-        items = []
-
-        max_item_chars = 50
-
-        for name in names:
-            display_name = name
-            if name.startswith('~'):
-                name = name[1:]
-                display_name = name.split('.')[-1]
-
-            try:
-                import_by_name_values = import_by_name(name, prefixes=prefixes)
-            except ImportError:
-                self.warn('[astropyautosummary] failed to import %s' % name)
-                items.append((name, '', '', name))
-                continue
-
-            # to accommodate Sphinx v1.2.2 and v1.2.3
-            if len(import_by_name_values) == 3:
-                real_name, obj, parent = import_by_name_values
-            elif len(import_by_name_values) == 4:
-                real_name, obj, parent, module_name = import_by_name_values
-
-            # NB. using real_name here is important, since Documenters
-            #     handle module prefixes slightly differently
-            documenter = get_documenter(obj, parent)(self, real_name)
-            if not documenter.parse_name():
-                self.warn('[astropyautosummary] failed to parse name %s' % real_name)
-                items.append((display_name, '', '', real_name))
-                continue
-            if not documenter.import_object():
-                self.warn('[astropyautosummary] failed to import object %s' % real_name)
-                items.append((display_name, '', '', real_name))
-                continue
-
-            # -- Grab the signature
-
-            sig = documenter.format_signature()
-            if not sig:
-                sig = ''
-            else:
-                max_chars = max(10, max_item_chars - len(display_name))
-                sig = mangle_signature(sig, max_chars=max_chars)
-                sig = sig.replace('*', r'\*')
-
-            # -- Grab the summary
-
-            doc = list(documenter.process_doc(documenter.get_doc()))
-
-            while doc and not doc[0].strip():
-                doc.pop(0)
-            m = _itemsummrex.search(" ".join(doc).strip())
-            if m:
-                summary = m.group(1).strip()
-            elif doc:
-                summary = doc[0].strip()
-            else:
-                summary = ''
-
-            items.append((display_name, sig, summary, real_name))
-
-        return items
-
-
-def setup(app):
-    # need autosummary, of course
-    app.setup_extension('sphinx.ext.autosummary')
-    # this replaces the default autosummary with the astropy one
-    app.add_directive('autosummary', AstropyAutosummary)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/automodapi.py b/astropy_helpers/astropy_helpers/sphinx/ext/automodapi.py
deleted file mode 100644
index d9320e9..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/automodapi.py
+++ /dev/null
@@ -1,350 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension adds a tools to simplify generating the API
-documentation for Astropy packages and affiliated packages.
-
-.. _automodapi:
-
-========================
-automodapi directive
-========================
-This directive takes a single argument that must be a module or package. It
-will produce a block of documentation that includes the docstring for the
-package, an :ref:`automodsumm` directive, and an :ref:`automod-diagram` if
-there are any classes in the module. If only the main docstring of the
-module/package is desired in the documentation, use `automodule`_ instead of
-`automodapi`_.
-
-It accepts the following options:
-
-    * ``:no-inheritance-diagram:``
-        If present, the inheritance diagram will not be shown even if
-        the module/package has classes.
-
-    * ``:skip: str``
-        This option results in the
-        specified object being skipped, that is the object will *not* be
-        included in the generated documentation. This option may appear
-        any number of times to skip multiple objects.
-
-    * ``:no-main-docstr:``
-        If present, the docstring for the module/package will not be generated.
-        The function and class tables will still be used, however.
-
-    * ``:headings: str``
-        Specifies the characters (in one string) used as the heading
-        levels used for the generated section. This must have at least 2
-        characters (any after 2 will be ignored). This also *must* match
-        the rest of the documentation on this page for sphinx to be
-        happy. Defaults to "-^", which matches the convention used for
-        Python's documentation, assuming the automodapi call is inside a
-        top-level section (which usually uses '=').
-
-    * ``:no-heading:``
-        If specified do not create a top level heading for the section.
-        That is, do not create a title heading with text like "packagename
-        Package".  The actual docstring for the package/module will still be
-        shown, though, unless ``:no-main-docstr:`` is given.
-
-    * ``:allowed-package-names: str``
-        Specifies the packages that functions/classes documented here are
-        allowed to be from, as comma-separated list of package names. If not
-        given, only objects that are actually in a subpackage of the package
-        currently being documented are included.
-
-This extension also adds two sphinx configuration options:
-
-* ``automodapi_toctreedirnm``
-    This must be a string that specifies the name of the directory the
-    automodsumm generated documentation ends up in. This directory path should
-    be relative to the documentation root (e.g., same place as ``index.rst``).
-    Defaults to ``'api'``.
-
-* ``automodapi_writereprocessed``
-    Should be a bool, and if `True`, will cause `automodapi`_ to write files
-    with any `automodapi`_ sections replaced with the content Sphinx
-    processes after `automodapi`_ has run.  The output files are not
-    actually used by sphinx, so this option is only for figuring out the
-    cause of sphinx warnings or other debugging.  Defaults to `False`.
-
-.. _automodule: http://sphinx-doc.org/latest/ext/autodoc.html?highlight=automodule#directive-automodule
-"""
-
-# Implementation note:
-# The 'automodapi' directive is not actually implemented as a docutils
-# directive. Instead, this extension searches for the 'automodapi' text in
-# all sphinx documents, and replaces it where necessary from a template built
-# into this extension. This is necessary because automodsumm (and autosummary)
-# use the "builder-inited" event, which comes before the directives are
-# actually built.
-
-import inspect
-import os
-import re
-import sys
-
-from .utils import find_mod_objs
-
-
-automod_templ_modheader = """
-{modname} {pkgormod}
-{modhds}{pkgormodhds}
-
-{automoduleline}
-"""
-
-automod_templ_classes = """
-Classes
-{clshds}
-
-.. automodsumm:: {modname}
-    :classes-only:
-    {clsfuncoptions}
-"""
-
-automod_templ_funcs = """
-Functions
-{funchds}
-
-.. automodsumm:: {modname}
-    :functions-only:
-    {clsfuncoptions}
-"""
-
-automod_templ_inh = """
-Class Inheritance Diagram
-{clsinhsechds}
-
-.. automod-diagram:: {modname}
-    :private-bases:
-    :parts: 1
-    {allowedpkgnms}
-"""
-
-_automodapirex = re.compile(r'^(?:\s*\.\.\s+automodapi::\s*)([A-Za-z0-9_.]+)'
-                            r'\s*$((?:\n\s+:[a-zA-Z_\-]+:.*$)*)',
-                            flags=re.MULTILINE)
-# the last group of the above regex is intended to go into finall with the below
-_automodapiargsrex = re.compile(r':([a-zA-Z_\-]+):(.*)$', flags=re.MULTILINE)
-
-
-def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
-                       warnings=True):
-    """
-    Replaces `sourcestr`'s entries of ".. automdapi::" with the
-    automodapi template form based on provided options.
-
-    This is used with the sphinx event 'source-read' to replace
-    `automodapi`_ entries before sphinx actually processes them, as
-    automodsumm needs the code to be present to generate stub
-    documentation.
-
-    Parameters
-    ----------
-    sourcestr : str
-        The string with sphinx source to be checked for automodapi
-        replacement.
-    app : `sphinx.application.Application`
-        The sphinx application.
-    dotoctree : bool
-        If `True`, a ":toctree:" option will be added in the "..
-        automodsumm::" sections of the template, pointing to the
-        appropriate "generated" directory based on the Astropy convention
-        (e.g. in ``docs/api``)
-    docname : str
-        The name of the file for this `sourcestr` (if known - if not, it
-        can be `None`). If not provided and `dotoctree` is `True`, the
-        generated files may end up in the wrong place.
-    warnings : bool
-        If `False`, all warnings that would normally be issued are
-        silenced.
-
-    Returns
-    -------
-    newstr :str
-        The string with automodapi entries replaced with the correct
-        sphinx markup.
-    """
-
-    spl = _automodapirex.split(sourcestr)
-    if len(spl) > 1:  # automodsumm is in this document
-
-        if dotoctree:
-            toctreestr = ':toctree: '
-            dirnm = app.config.automodapi_toctreedirnm
-            if not dirnm.endswith(os.sep):
-                dirnm += os.sep
-            if docname is not None:
-                toctreestr += '../' * docname.count('/') + dirnm
-            else:
-                toctreestr += dirnm
-        else:
-            toctreestr = ''
-
-        newstrs = [spl[0]]
-        for grp in range(len(spl) // 3):
-            modnm = spl[grp * 3 + 1]
-
-            # find where this is in the document for warnings
-            if docname is None:
-                location = None
-            else:
-                location = (docname, spl[0].count('\n'))
-
-            # initialize default options
-            toskip = []
-            inhdiag = maindocstr = top_head = True
-            hds = '-^'
-            allowedpkgnms = []
-
-            # look for actual options
-            unknownops = []
-            for opname, args in _automodapiargsrex.findall(spl[grp * 3 + 2]):
-                if opname == 'skip':
-                    toskip.append(args.strip())
-                elif opname == 'no-inheritance-diagram':
-                    inhdiag = False
-                elif opname == 'no-main-docstr':
-                    maindocstr = False
-                elif opname == 'headings':
-                    hds = args
-                elif opname == 'no-heading':
-                    top_head = False
-                elif opname == 'allowed-package-names':
-                    allowedpkgnms.append(args.strip())
-                else:
-                    unknownops.append(opname)
-
-            #join all the allowedpkgnms
-            if len(allowedpkgnms) == 0:
-                allowedpkgnms = ''
-                onlylocals = True
-            else:
-                allowedpkgnms = ':allowed-package-names: ' + ','.join(allowedpkgnms)
-                onlylocals = allowedpkgnms
-
-            # get the two heading chars
-            if len(hds) < 2:
-                msg = 'Not enough headings (got {0}, need 2), using default -^'
-                if warnings:
-                    app.warn(msg.format(len(hds)), location)
-                hds = '-^'
-            h1, h2 = hds.lstrip()[:2]
-
-            # tell sphinx that the remaining args are invalid.
-            if len(unknownops) > 0 and app is not None:
-                opsstrs = ','.join(unknownops)
-                msg = 'Found additional options ' + opsstrs + ' in automodapi.'
-                if warnings:
-                    app.warn(msg, location)
-
-            ispkg, hascls, hasfuncs = _mod_info(modnm, toskip, onlylocals=onlylocals)
-
-            # add automodule directive only if no-main-docstr isn't present
-            if maindocstr:
-                automodline = '.. automodule:: {modname}'.format(modname=modnm)
-            else:
-                automodline = ''
-            if top_head:
-                newstrs.append(automod_templ_modheader.format(modname=modnm,
-                    modhds=h1 * len(modnm),
-                    pkgormod='Package' if ispkg else 'Module',
-                    pkgormodhds=h1 * (8 if ispkg else 7),
-                    automoduleline=automodline))
-            else:
-                newstrs.append(automod_templ_modheader.format(
-                    modname='',
-                    modhds='',
-                    pkgormod='',
-                    pkgormodhds='',
-                    automoduleline=automodline))
-
-            #construct the options for the class/function sections
-            #start out indented at 4 spaces, but need to keep the indentation.
-            clsfuncoptions = []
-            if toctreestr:
-                clsfuncoptions.append(toctreestr)
-            if toskip:
-                clsfuncoptions.append(':skip: ' + ','.join(toskip))
-            if allowedpkgnms:
-                clsfuncoptions.append(allowedpkgnms)
-            clsfuncoptionstr = '\n    '.join(clsfuncoptions)
-
-            if hasfuncs:
-                newstrs.append(automod_templ_funcs.format(
-                    modname=modnm,
-                    funchds=h2 * 9,
-                    clsfuncoptions=clsfuncoptionstr))
-
-            if hascls:
-                newstrs.append(automod_templ_classes.format(
-                    modname=modnm,
-                    clshds=h2 * 7,
-                    clsfuncoptions=clsfuncoptionstr))
-
-            if inhdiag and hascls:
-                # add inheritance diagram if any classes are in the module
-                newstrs.append(automod_templ_inh.format(
-                    modname=modnm,
-                    clsinhsechds=h2 * 25,
-                    allowedpkgnms=allowedpkgnms))
-
-            newstrs.append(spl[grp * 3 + 3])
-
-        newsourcestr = ''.join(newstrs)
-
-        if app.config.automodapi_writereprocessed:
-            # sometimes they are unicode, sometimes not, depending on how
-            # sphinx has processed things
-            if isinstance(newsourcestr, unicode):
-                ustr = newsourcestr
-            else:
-                ustr = newsourcestr.decode(app.config.source_encoding)
-
-            if docname is None:
-                with open(os.path.join(app.srcdir, 'unknown.automodapi'), 'a') as f:
-                    f.write('\n**NEW DOC**\n\n')
-                    f.write(ustr.encode('utf8'))
-            else:
-                with open(os.path.join(app.srcdir, docname + '.automodapi'), 'w') as f:
-                    f.write(ustr.encode('utf8'))
-
-        return newsourcestr
-    else:
-        return sourcestr
-
-
-def _mod_info(modname, toskip=[], onlylocals=True):
-    """
-    Determines if a module is a module or a package and whether or not
-    it has classes or functions.
-    """
-
-    hascls = hasfunc = False
-
-    for localnm, fqnm, obj in zip(*find_mod_objs(modname, onlylocals=onlylocals)):
-        if localnm not in toskip:
-            hascls = hascls or inspect.isclass(obj)
-            hasfunc = hasfunc or inspect.isroutine(obj)
-            if hascls and hasfunc:
-                break
-
-    # find_mod_objs has already imported modname
-    pkg = sys.modules[modname]
-    ispkg = '__init__.' in os.path.split(pkg.__name__)[1]
-
-    return ispkg, hascls, hasfunc
-
-
-def process_automodapi(app, docname, source):
-    source[0] = automodapi_replace(source[0], app, True, docname)
-
-
-def setup(app):
-    # need automodsumm for automodapi
-    app.setup_extension('astropy_helpers.sphinx.ext.automodsumm')
-
-    app.connect('source-read', process_automodapi)
-
-    app.add_config_value('automodapi_toctreedirnm', 'api', True)
-    app.add_config_value('automodapi_writereprocessed', False, True)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/automodsumm.py b/astropy_helpers/astropy_helpers/sphinx/ext/automodsumm.py
deleted file mode 100644
index 353680b..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/automodsumm.py
+++ /dev/null
@@ -1,581 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension adds two directives for summarizing the public
-members of a module or package.
-
-These directives are primarily for use with the `automodapi`_ extension,
-but can be used independently.
-
-.. _automodsumm:
-
-=======================
-automodsumm directive
-=======================
-
-This directive will produce an "autosummary"-style table for public
-attributes of a specified module. See the `sphinx.ext.autosummary`_ extension
-for details on this process. The main difference from the `autosummary`_
-directive is that `autosummary`_ requires manually inputting all attributes
-that appear in the table, while this captures the entries automatically.
-
-This directive requires a single argument that must be a module or
-package.
-
-It also accepts any options supported by the `autosummary`_ directive-
-see `sphinx.ext.autosummary`_ for details. It also accepts two additional
-options:
-
-    * ``:classes-only:``
-        If present, the autosummary table will only contain entries for
-        classes. This cannot be used at the same time with
-        ``:functions-only:`` .
-
-    * ``:functions-only:``
-        If present, the autosummary table will only contain entries for
-        functions. This cannot be used at the same time with
-        ``:classes-only:`` .
-
-    * ``:skip: obj1, [obj2, obj3, ...]``
-        If present, specifies that the listed objects should be skipped
-        and not have their documentation generated, nor be includded in
-        the summary table.
-
-    * ``:allowed-package-names: pkgormod1, [pkgormod2, pkgormod3, ...]``
-        Specifies the packages that functions/classes documented here are
-        allowed to be from, as comma-separated list of package names. If not
-        given, only objects that are actually in a subpackage of the package
-        currently being documented are included.
-
-This extension also adds one sphinx configuration option:
-
-* ``automodsumm_writereprocessed``
-    Should be a bool, and if True, will cause `automodsumm`_ to write files
-    with any ``automodsumm`` sections replaced with the content Sphinx
-    processes after ``automodsumm`` has run.  The output files are not
-    actually used by sphinx, so this option is only for figuring out the
-    cause of sphinx warnings or other debugging.  Defaults to `False`.
-
-.. _sphinx.ext.autosummary: http://sphinx-doc.org/latest/ext/autosummary.html
-.. _autosummary: http://sphinx-doc.org/latest/ext/autosummary.html#directive-autosummary
-
-.. _automod-diagram:
-
-===========================
-automod-diagram directive
-===========================
-
-This directive will produce an inheritance diagram like that of the
-`sphinx.ext.inheritance_diagram`_ extension.
-
-This directive requires a single argument that must be a module or
-package. It accepts no options.
-
-.. note::
-    Like 'inheritance-diagram', 'automod-diagram' requires
-    `graphviz <http://www.graphviz.org/>`_ to generate the inheritance diagram.
-
-.. _sphinx.ext.inheritance_diagram: http://sphinx-doc.org/latest/ext/inheritance.html
-"""
-
-import inspect
-import os
-import re
-
-from sphinx.ext.autosummary import Autosummary
-from sphinx.ext.inheritance_diagram import InheritanceDiagram
-from docutils.parsers.rst.directives import flag
-
-from .utils import find_mod_objs
-from .astropyautosummary import AstropyAutosummary
-
-
-def _str_list_converter(argument):
-    """
-    A directive option conversion function that converts the option into a list
-    of strings. Used for 'skip' option.
-    """
-    if argument is None:
-        return []
-    else:
-        return [s.strip() for s in argument.split(',')]
-
-
-class Automodsumm(AstropyAutosummary):
-    required_arguments = 1
-    optional_arguments = 0
-    final_argument_whitespace = False
-    has_content = False
-    option_spec = dict(Autosummary.option_spec)
-    option_spec['functions-only'] = flag
-    option_spec['classes-only'] = flag
-    option_spec['skip'] = _str_list_converter
-    option_spec['allowed-package-names'] = _str_list_converter
-
-    def run(self):
-        env = self.state.document.settings.env
-        modname = self.arguments[0]
-
-        self.warnings = []
-        nodelist = []
-
-        try:
-            localnames, fqns, objs = find_mod_objs(modname)
-        except ImportError:
-            self.warnings = []
-            self.warn("Couldn't import module " + modname)
-            return self.warnings
-
-        try:
-            # set self.content to trick the Autosummary internals.
-            # Be sure to respect functions-only and classes-only.
-            funconly = 'functions-only' in self.options
-            clsonly = 'classes-only' in self.options
-
-            skipnames = []
-            if 'skip' in self.options:
-                option_skipnames = set(self.options['skip'])
-                for lnm in localnames:
-                    if lnm in option_skipnames:
-                        option_skipnames.remove(lnm)
-                        skipnames.append(lnm)
-                if len(option_skipnames) > 0:
-                    self.warn('Tried to skip objects {objs} in module {mod}, '
-                              'but they were not present.  Ignoring.'.format(
-                              objs=option_skipnames, mod=modname))
-
-            if funconly and not clsonly:
-                cont = []
-                for nm, obj in zip(localnames, objs):
-                    if nm not in skipnames and inspect.isroutine(obj):
-                        cont.append(nm)
-            elif clsonly:
-                cont = []
-                for nm, obj in zip(localnames, objs):
-                    if nm not in skipnames and inspect.isclass(obj):
-                        cont.append(nm)
-            else:
-                if clsonly and funconly:
-                    self.warning('functions-only and classes-only both '
-                                 'defined. Skipping.')
-                cont = [nm for nm in localnames if nm not in skipnames]
-
-            self.content = cont
-
-            #for some reason, even though ``currentmodule`` is substituted in, sphinx
-            #doesn't necessarily recognize this fact.  So we just force it
-            #internally, and that seems to fix things
-            env.temp_data['py:module'] = modname
-
-            #can't use super because Sphinx/docutils has trouble
-            #return super(Autosummary,self).run()
-            nodelist.extend(Autosummary.run(self))
-            return self.warnings + nodelist
-        finally:  # has_content = False for the Automodsumm
-            self.content = []
-
-
-#<-------------------automod-diagram stuff------------------------------------>
-class Automoddiagram(InheritanceDiagram):
-
-    option_spec = dict(InheritanceDiagram.option_spec)
-    option_spec['allowed-package-names'] = _str_list_converter
-
-    def run(self):
-        try:
-            ols = self.options.get('allowed-package-names', [])
-            ols = True if len(ols) == 0 else ols  # if none are given, assume only local
-
-            nms, objs = find_mod_objs(self.arguments[0], onlylocals=ols)[1:]
-        except ImportError:
-            self.warnings = []
-            self.warn("Couldn't import module " + self.arguments[0])
-            return self.warnings
-
-        clsnms = []
-        for n, o in zip(nms, objs):
-
-            if inspect.isclass(o):
-                clsnms.append(n)
-
-        oldargs = self.arguments
-        try:
-            if len(clsnms) > 0:
-                self.arguments = [u' '.join(clsnms)]
-            return InheritanceDiagram.run(self)
-        finally:
-            self.arguments = oldargs
-
-
-#<---------------------automodsumm generation stuff--------------------------->
-def process_automodsumm_generation(app):
-    env = app.builder.env
-    ext = app.config.source_suffix
-
-    filestosearch = [x + ext for x in env.found_docs
-                     if os.path.isfile(env.doc2path(x))]\
-
-    liness = []
-    for sfn in filestosearch:
-        lines = automodsumm_to_autosummary_lines(sfn, app)
-        liness.append(lines)
-        if app.config.automodsumm_writereprocessed:
-            if lines:  # empty list means no automodsumm entry is in the file
-                outfn = os.path.join(app.srcdir, sfn) + '.automodsumm'
-                with open(outfn, 'w') as f:
-                    for l in lines:
-                        f.write(l)
-                        f.write('\n')
-
-    for sfn, lines in zip(filestosearch, liness):
-        if len(lines) > 0:
-            generate_automodsumm_docs(lines, sfn, builder=app.builder,
-                                      warn=app.warn, info=app.info,
-                                      suffix=app.config.source_suffix,
-                                      base_path=app.srcdir)
-
-#_automodsummrex = re.compile(r'^(\s*)\.\. automodsumm::\s*([A-Za-z0-9_.]+)\s*'
-#                             r'\n\1(\s*)(\S|$)', re.MULTILINE)
-_lineendrex = r'(?:\n|$)'
-_hdrex = r'^\n?(\s*)\.\. automodsumm::\s*(\S+)\s*' + _lineendrex
-_oprex1 = r'(?:\1(\s+)\S.*' + _lineendrex + ')'
-_oprex2 = r'(?:\1\4\S.*' + _lineendrex + ')'
-_automodsummrex = re.compile(_hdrex + '(' + _oprex1 + '?' + _oprex2 + '*)',
-                             re.MULTILINE)
-
-
-def automodsumm_to_autosummary_lines(fn, app):
-    """
-    Generates lines from a file with an "automodsumm" entry suitable for
-    feeding into "autosummary".
-
-    Searches the provided file for `automodsumm` directives and returns
-    a list of lines specifying the `autosummary` commands for the modules
-    requested. This does *not* return the whole file contents - just an
-    autosummary section in place of any :automodsumm: entries. Note that
-    any options given for `automodsumm` are also included in the
-    generated `autosummary` section.
-
-    Parameters
-    ----------
-    fn : str
-        The name of the file to search for `automodsumm` entries.
-    app : sphinx.application.Application
-        The sphinx Application object
-
-    Return
-    ------
-    lines : list of str
-        Lines for all `automodsumm` entries with the entries replaced by
-        `autosummary` and the module's members added.
-
-
-    """
-    fullfn = os.path.join(app.builder.env.srcdir, fn)
-
-    with open(fullfn) as fr:
-        if 'astropy_helpers.sphinx.ext.automodapi' in app._extensions:
-            from astropy_helpers.sphinx.ext.automodapi import automodapi_replace
-            # Must do the automodapi on the source to get the automodsumm
-            # that might be in there
-            filestr = automodapi_replace(fr.read(), app, True, fn, False)
-        else:
-            filestr = fr.read()
-
-    spl = _automodsummrex.split(filestr)
-    #0th entry is the stuff before the first automodsumm line
-    indent1s = spl[1::5]
-    mods = spl[2::5]
-    opssecs = spl[3::5]
-    indent2s = spl[4::5]
-    remainders = spl[5::5]
-
-    # only grab automodsumm sections and convert them to autosummary with the
-    # entries for all the public objects
-    newlines = []
-
-    #loop over all automodsumms in this document
-    for i, (i1, i2, modnm, ops, rem) in enumerate(zip(indent1s, indent2s, mods,
-                                                    opssecs, remainders)):
-        allindent = i1 + ('' if i2 is None else i2)
-
-        #filter out functions-only and classes-only options if present
-        oplines = ops.split('\n')
-        toskip = []
-        allowedpkgnms = []
-        funcsonly = clssonly = False
-        for i, ln in reversed(list(enumerate(oplines))):
-            if ':functions-only:' in ln:
-                funcsonly = True
-                del oplines[i]
-            if ':classes-only:' in ln:
-                clssonly = True
-                del oplines[i]
-            if ':skip:' in ln:
-                toskip.extend(_str_list_converter(ln.replace(':skip:', '')))
-                del oplines[i]
-            if ':allowed-package-names:' in ln:
-                allowedpkgnms.extend(_str_list_converter(ln.replace(':allowed-package-names:', '')))
-                del oplines[i]
-        if funcsonly and clssonly:
-            msg = ('Defined both functions-only and classes-only options. '
-                   'Skipping this directive.')
-            lnnum = sum([spl[j].count('\n') for j in range(i * 5 + 1)])
-            app.warn('[automodsumm]' + msg, (fn, lnnum))
-            continue
-
-        # Use the currentmodule directive so we can just put the local names
-        # in the autosummary table.  Note that this doesn't always seem to
-        # actually "take" in Sphinx's eyes, so in `Automodsumm.run`, we have to
-        # force it internally, as well.
-        newlines.extend([i1 + '.. currentmodule:: ' + modnm,
-                         '',
-                         '.. autosummary::'])
-        newlines.extend(oplines)
-
-        ols = True if len(allowedpkgnms) == 0 else allowedpkgnms
-        for nm, fqn, obj in zip(*find_mod_objs(modnm, onlylocals=ols)):
-            if nm in toskip:
-                continue
-            if funcsonly and not inspect.isroutine(obj):
-                continue
-            if clssonly and not inspect.isclass(obj):
-                continue
-            newlines.append(allindent + nm)
-
-    return newlines
-
-
-def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
-                              info=None, base_path=None, builder=None,
-                              template_dir=None):
-    """
-    This function is adapted from
-    `sphinx.ext.autosummary.generate.generate_autosummmary_docs` to
-    generate source for the automodsumm directives that should be
-    autosummarized. Unlike generate_autosummary_docs, this function is
-    called one file at a time.
-    """
-
-    from sphinx.jinja2glue import BuiltinTemplateLoader
-    from sphinx.ext.autosummary import import_by_name, get_documenter
-    from sphinx.ext.autosummary.generate import (find_autosummary_in_lines,
-                                                 _simple_info, _simple_warn)
-    from sphinx.util.osutil import ensuredir
-    from sphinx.util.inspect import safe_getattr
-    from jinja2 import FileSystemLoader, TemplateNotFound
-    from jinja2.sandbox import SandboxedEnvironment
-
-    if info is None:
-        info = _simple_info
-    if warn is None:
-        warn = _simple_warn
-
-    #info('[automodsumm] generating automodsumm for: ' + srcfn)
-
-    # Create our own templating environment - here we use Astropy's
-    # templates rather than the default autosummary templates, in order to
-    # allow docstrings to be shown for methods.
-    template_dirs = [os.path.join(os.path.dirname(__file__), 'templates'),
-                     os.path.join(base_path, '_templates')]
-    if builder is not None:
-        # allow the user to override the templates
-        template_loader = BuiltinTemplateLoader()
-        template_loader.init(builder, dirs=template_dirs)
-    else:
-        if template_dir:
-            template_dirs.insert(0, template_dir)
-        template_loader = FileSystemLoader(template_dirs)
-    template_env = SandboxedEnvironment(loader=template_loader)
-
-    # read
-    #items = find_autosummary_in_files(sources)
-    items = find_autosummary_in_lines(lines, filename=srcfn)
-    if len(items) > 0:
-        msg = '[automodsumm] {1}: found {0} automodsumm entries to generate'
-        info(msg.format(len(items), srcfn))
-
-#    gennms = [item[0] for item in items]
-#    if len(gennms) > 20:
-#        gennms = gennms[:10] + ['...'] + gennms[-10:]
-#    info('[automodsumm] generating autosummary for: ' + ', '.join(gennms))
-
-    # remove possible duplicates
-    items = dict([(item, True) for item in items]).keys()
-
-    # keep track of new files
-    new_files = []
-
-    # write
-    for name, path, template_name in sorted(items):
-        if path is None:
-            # The corresponding autosummary:: directive did not have
-            # a :toctree: option
-            continue
-
-        path = os.path.abspath(path)
-        ensuredir(path)
-
-        try:
-            import_by_name_values = import_by_name(name)
-        except ImportError as e:
-            warn('[automodsumm] failed to import %r: %s' % (name, e))
-            continue
-
-        # if block to accommodate Sphinx's v1.2.2 and v1.2.3 respectively
-        if len(import_by_name_values) == 3:
-            name, obj, parent = import_by_name_values
-        elif len(import_by_name_values) == 4:
-            name, obj, parent, module_name = import_by_name_values
-        
-        fn = os.path.join(path, name + suffix)
-
-        # skip it if it exists
-        if os.path.isfile(fn):
-            continue
-
-        new_files.append(fn)
-
-        f = open(fn, 'w')
-
-        try:
-            doc = get_documenter(obj, parent)
-
-            if template_name is not None:
-                template = template_env.get_template(template_name)
-            else:
-                tmplstr = 'autosummary/%s.rst'
-                try:
-                    template = template_env.get_template(tmplstr % doc.objtype)
-                except TemplateNotFound:
-                    template = template_env.get_template(tmplstr % 'base')
-
-            def get_members_mod(obj, typ, include_public=[]):
-                """
-                typ = None -> all
-                """
-                items = []
-                for name in dir(obj):
-                    try:
-                        documenter = get_documenter(safe_getattr(obj, name),
-                                                    obj)
-                    except AttributeError:
-                        continue
-                    if typ is None or documenter.objtype == typ:
-                        items.append(name)
-                public = [x for x in items
-                          if x in include_public or not x.startswith('_')]
-                return public, items
-
-            def get_members_class(obj, typ, include_public=[],
-                                  include_base=False):
-                """
-                typ = None -> all
-                include_base -> include attrs that are from a base class
-                """
-                items = []
-
-                # using dir gets all of the attributes, including the elements
-                # from the base class, otherwise use __slots__ or __dict__
-                if include_base:
-                    names = dir(obj)
-                else:
-                    if hasattr(obj, '__slots__'):
-                        names = tuple(getattr(obj, '__slots__'))
-                    else:
-                        names = getattr(obj, '__dict__').keys()
-
-                for name in names:
-                    try:
-                        documenter = get_documenter(safe_getattr(obj, name),
-                                                    obj)
-                    except AttributeError:
-                        continue
-                    if typ is None or documenter.objtype == typ:
-                        items.append(name)
-                public = [x for x in items
-                          if x in include_public or not x.startswith('_')]
-                return public, items
-
-            ns = {}
-
-            if doc.objtype == 'module':
-                ns['members'] = get_members_mod(obj, None)
-                ns['functions'], ns['all_functions'] = \
-                                   get_members_mod(obj, 'function')
-                ns['classes'], ns['all_classes'] = \
-                                 get_members_mod(obj, 'class')
-                ns['exceptions'], ns['all_exceptions'] = \
-                                   get_members_mod(obj, 'exception')
-            elif doc.objtype == 'class':
-                api_class_methods = ['__init__', '__call__']
-                ns['members'] = get_members_class(obj, None)
-                ns['methods'], ns['all_methods'] = \
-                                 get_members_class(obj, 'method', api_class_methods)
-                ns['attributes'], ns['all_attributes'] = \
-                                 get_members_class(obj, 'attribute')
-                ns['methods'].sort()
-                ns['attributes'].sort()
-
-            parts = name.split('.')
-            if doc.objtype in ('method', 'attribute'):
-                mod_name = '.'.join(parts[:-2])
-                cls_name = parts[-2]
-                obj_name = '.'.join(parts[-2:])
-                ns['class'] = cls_name
-            else:
-                mod_name, obj_name = '.'.join(parts[:-1]), parts[-1]
-
-            ns['fullname'] = name
-            ns['module'] = mod_name
-            ns['objname'] = obj_name
-            ns['name'] = parts[-1]
-
-            ns['objtype'] = doc.objtype
-            ns['underline'] = len(name) * '='
-
-            # We now check whether a file for reference footnotes exists for
-            # the module being documented. We first check if the
-            # current module is a file or a directory, as this will give a
-            # different path for the reference file. For example, if
-            # documenting astropy.wcs then the reference file is at
-            # ../wcs/references.txt, while if we are documenting
-            # astropy.config.logging_helper (which is at
-            # astropy/config/logging_helper.py) then the reference file is set
-            # to ../config/references.txt
-            if '.' in mod_name:
-                mod_name_dir = mod_name.replace('.', '/').split('/', 1)[1]
-            else:
-                mod_name_dir = mod_name
-            if not os.path.isdir(os.path.join(base_path, mod_name_dir)) \
-               and os.path.isdir(os.path.join(base_path, mod_name_dir.rsplit('/', 1)[0])):
-                mod_name_dir = mod_name_dir.rsplit('/', 1)[0]
-
-            # We then have to check whether it exists, and if so, we pass it
-            # to the template.
-            if os.path.exists(os.path.join(base_path, mod_name_dir, 'references.txt')):
-                # An important subtlety here is that the path we pass in has
-                # to be relative to the file being generated, so we have to
-                # figure out the right number of '..'s
-                ndirsback = path.replace(base_path, '').count('/')
-                ref_file_rel_segments = ['..'] * ndirsback
-                ref_file_rel_segments.append(mod_name_dir)
-                ref_file_rel_segments.append('references.txt')
-                ns['referencefile'] = os.path.join(*ref_file_rel_segments)
-
-            rendered = template.render(**ns)
-            f.write(rendered)
-        finally:
-            f.close()
-
-
-def setup(app):
-    # need our autosummary
-    app.setup_extension('astropy_helpers.sphinx.ext.astropyautosummary')
-    # need inheritance-diagram for automod-diagram
-    app.setup_extension('sphinx.ext.inheritance_diagram')
-
-    app.add_directive('automod-diagram', Automoddiagram)
-    app.add_directive('automodsumm', Automodsumm)
-    app.connect('builder-inited', process_automodsumm_generation)
-
-    app.add_config_value('automodsumm_writereprocessed', False, True)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py b/astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py
deleted file mode 100644
index f77a31d..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension makes the issue numbers in the changelog into links to
-GitHub issues.
-"""
-
-from __future__ import print_function
-
-import re
-
-from docutils.nodes import Text, reference
-
-BLOCK_PATTERN = re.compile('\[#.+\]', flags=re.DOTALL)
-ISSUE_PATTERN = re.compile('#[0-9]+')
-
-
-def process_changelog_links(app, doctree, docname):
-    for rex in app.changelog_links_rexes:
-        if rex.match(docname):
-            break
-    else:
-        # if the doc doesn't match any of the changelog regexes, don't process
-        return
-
-    app.info('[changelog_links] Adding changelog links to "{0}"'.format(docname))
-
-    for item in doctree.traverse():
-
-        if not isinstance(item, Text):
-            continue
-
-        # We build a new list of items to replace the current item. If
-        # a link is found, we need to use a 'reference' item.
-        children = []
-
-        # First cycle through blocks of issues (delimited by []) then
-        # iterate inside each one to find the individual issues.
-        prev_block_end = 0
-        for block in BLOCK_PATTERN.finditer(item):
-            block_start, block_end = block.start(), block.end()
-            children.append(Text(item[prev_block_end:block_start]))
-            block = item[block_start:block_end]
-            prev_end = 0
-            for m in ISSUE_PATTERN.finditer(block):
-                start, end = m.start(), m.end()
-                children.append(Text(block[prev_end:start]))
-                issue_number = block[start:end]
-                refuri = app.config.github_issues_url + issue_number[1:]
-                children.append(reference(text=issue_number,
-                                          name=issue_number,
-                                          refuri=refuri))
-                prev_end = end
-
-            prev_block_end = block_end
-
-            # If no issues were found, this adds the whole item,
-            # otherwise it adds the remaining text.
-            children.append(Text(block[prev_end:block_end]))
-
-        # If no blocks were found, this adds the whole item, otherwise
-        # it adds the remaining text.
-        children.append(Text(item[prev_block_end:]))
-
-        # Replace item by the new list of items we have generated,
-        # which may contain links.
-        item.parent.replace(item, children)
-
-
-def setup_patterns_rexes(app):
-    app.changelog_links_rexes = [re.compile(pat) for pat in
-                                 app.config.changelog_links_docpattern]
-
-
-def setup(app):
-    app.connect('doctree-resolved', process_changelog_links)
-    app.connect('builder-inited', setup_patterns_rexes)
-    app.add_config_value('github_issues_url', None, True)
-    app.add_config_value('changelog_links_docpattern', ['.*changelog.*', 'whatsnew/.*'], True)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/comment_eater.py b/astropy_helpers/astropy_helpers/sphinx/ext/comment_eater.py
deleted file mode 100644
index 8cddd33..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/comment_eater.py
+++ /dev/null
@@ -1,169 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import sys
-if sys.version_info[0] >= 3:
-    from io import StringIO
-else:
-    from io import StringIO
-
-import compiler
-import inspect
-import textwrap
-import tokenize
-
-from .compiler_unparse import unparse
-
-
-class Comment(object):
-    """ A comment block.
-    """
-    is_comment = True
-    def __init__(self, start_lineno, end_lineno, text):
-        # int : The first line number in the block. 1-indexed.
-        self.start_lineno = start_lineno
-        # int : The last line number. Inclusive!
-        self.end_lineno = end_lineno
-        # str : The text block including '#' character but not any leading spaces.
-        self.text = text
-
-    def add(self, string, start, end, line):
-        """ Add a new comment line.
-        """
-        self.start_lineno = min(self.start_lineno, start[0])
-        self.end_lineno = max(self.end_lineno, end[0])
-        self.text += string
-
-    def __repr__(self):
-        return '%s(%r, %r, %r)' % (self.__class__.__name__, self.start_lineno,
-            self.end_lineno, self.text)
-
-
-class NonComment(object):
-    """ A non-comment block of code.
-    """
-    is_comment = False
-    def __init__(self, start_lineno, end_lineno):
-        self.start_lineno = start_lineno
-        self.end_lineno = end_lineno
-
-    def add(self, string, start, end, line):
-        """ Add lines to the block.
-        """
-        if string.strip():
-            # Only add if not entirely whitespace.
-            self.start_lineno = min(self.start_lineno, start[0])
-            self.end_lineno = max(self.end_lineno, end[0])
-
-    def __repr__(self):
-        return '%s(%r, %r)' % (self.__class__.__name__, self.start_lineno,
-            self.end_lineno)
-
-
-class CommentBlocker(object):
-    """ Pull out contiguous comment blocks.
-    """
-    def __init__(self):
-        # Start with a dummy.
-        self.current_block = NonComment(0, 0)
-
-        # All of the blocks seen so far.
-        self.blocks = []
-
-        # The index mapping lines of code to their associated comment blocks.
-        self.index = {}
-
-    def process_file(self, file):
-        """ Process a file object.
-        """
-        if sys.version_info[0] >= 3:
-            nxt = file.__next__
-        else:
-            nxt = file.next
-        for token in tokenize.generate_tokens(nxt):
-            self.process_token(*token)
-        self.make_index()
-
-    def process_token(self, kind, string, start, end, line):
-        """ Process a single token.
-        """
-        if self.current_block.is_comment:
-            if kind == tokenize.COMMENT:
-                self.current_block.add(string, start, end, line)
-            else:
-                self.new_noncomment(start[0], end[0])
-        else:
-            if kind == tokenize.COMMENT:
-                self.new_comment(string, start, end, line)
-            else:
-                self.current_block.add(string, start, end, line)
-
-    def new_noncomment(self, start_lineno, end_lineno):
-        """ We are transitioning from a noncomment to a comment.
-        """
-        block = NonComment(start_lineno, end_lineno)
-        self.blocks.append(block)
-        self.current_block = block
-
-    def new_comment(self, string, start, end, line):
-        """ Possibly add a new comment.
-
-        Only adds a new comment if this comment is the only thing on the line.
-        Otherwise, it extends the noncomment block.
-        """
-        prefix = line[:start[1]]
-        if prefix.strip():
-            # Oops! Trailing comment, not a comment block.
-            self.current_block.add(string, start, end, line)
-        else:
-            # A comment block.
-            block = Comment(start[0], end[0], string)
-            self.blocks.append(block)
-            self.current_block = block
-
-    def make_index(self):
-        """ Make the index mapping lines of actual code to their associated
-        prefix comments.
-        """
-        for prev, block in zip(self.blocks[:-1], self.blocks[1:]):
-            if not block.is_comment:
-                self.index[block.start_lineno] = prev
-
-    def search_for_comment(self, lineno, default=None):
-        """ Find the comment block just before the given line number.
-
-        Returns None (or the specified default) if there is no such block.
-        """
-        if not self.index:
-            self.make_index()
-        block = self.index.get(lineno, None)
-        text = getattr(block, 'text', default)
-        return text
-
-
-def strip_comment_marker(text):
-    """ Strip # markers at the front of a block of comment text.
-    """
-    lines = []
-    for line in text.splitlines():
-        lines.append(line.lstrip('#'))
-    text = textwrap.dedent('\n'.join(lines))
-    return text
-
-
-def get_class_traits(klass):
-    """ Yield all of the documentation for trait definitions on a class object.
-    """
-    # FIXME: gracefully handle errors here or in the caller?
-    source = inspect.getsource(klass)
-    cb = CommentBlocker()
-    cb.process_file(StringIO(source))
-    mod_ast = compiler.parse(source)
-    class_ast = mod_ast.node.nodes[0]
-    for node in class_ast.code.nodes:
-        # FIXME: handle other kinds of assignments?
-        if isinstance(node, compiler.ast.Assign):
-            name = node.nodes[0].name
-            rhs = unparse(node.expr).strip()
-            doc = strip_comment_marker(cb.search_for_comment(node.lineno, default=''))
-            yield name, rhs, doc
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/compiler_unparse.py b/astropy_helpers/astropy_helpers/sphinx/ext/compiler_unparse.py
deleted file mode 100644
index 8933a83..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/compiler_unparse.py
+++ /dev/null
@@ -1,865 +0,0 @@
-""" Turn compiler.ast structures back into executable python code.
-
-    The unparse method takes a compiler.ast tree and transforms it back into
-    valid python code.  It is incomplete and currently only works for
-    import statements, function calls, function definitions, assignments, and
-    basic expressions.
-
-    Inspired by python-2.5-svn/Demo/parser/unparse.py
-
-    fixme: We may want to move to using _ast trees because the compiler for
-           them is about 6 times faster than compiler.compile.
-"""
-from __future__ import division, absolute_import, print_function
-
-import sys
-from compiler.ast import Const, Name, Tuple, Div, Mul, Sub, Add
-
-if sys.version_info[0] >= 3:
-    from io import StringIO
-else:
-    from StringIO import StringIO
-
-def unparse(ast, single_line_functions=False):
-    s = StringIO()
-    UnparseCompilerAst(ast, s, single_line_functions)
-    return s.getvalue().lstrip()
-
-op_precedence = { 'compiler.ast.Power':3, 'compiler.ast.Mul':2, 'compiler.ast.Div':2,
-                  'compiler.ast.Add':1, 'compiler.ast.Sub':1 }
-
-class UnparseCompilerAst:
-    """ Methods in this class recursively traverse an AST and
-        output source code for the abstract syntax; original formatting
-        is disregarged.
-    """
-
-    #########################################################################
-    # object interface.
-    #########################################################################
-
-    def __init__(self, tree, file = sys.stdout, single_line_functions=False):
-        """ Unparser(tree, file=sys.stdout) -> None.
-
-            Print the source for tree to file.
-        """
-        self.f = file
-        self._single_func = single_line_functions
-        self._do_indent = True
-        self._indent = 0
-        self._dispatch(tree)
-        self._write("\n")
-        self.f.flush()
-
-    #########################################################################
-    # Unparser private interface.
-    #########################################################################
-
-    ### format, output, and dispatch methods ################################
-
-    def _fill(self, text = ""):
-        "Indent a piece of text, according to the current indentation level"
-        if self._do_indent:
-            self._write("\n"+"    "*self._indent + text)
-        else:
-            self._write(text)
-
-    def _write(self, text):
-        "Append a piece of text to the current line."
-        self.f.write(text)
-
-    def _enter(self):
-        "Print ':', and increase the indentation."
-        self._write(": ")
-        self._indent += 1
-
-    def _leave(self):
-        "Decrease the indentation level."
-        self._indent -= 1
-
-    def _dispatch(self, tree):
-        "_dispatcher function, _dispatching tree type T to method _T."
-        if isinstance(tree, list):
-            for t in tree:
-                self._dispatch(t)
-            return
-        meth = getattr(self, "_"+tree.__class__.__name__)
-        if tree.__class__.__name__ == 'NoneType' and not self._do_indent:
-            return
-        meth(tree)
-
-
-    #########################################################################
-    # compiler.ast unparsing methods.
-    #
-    # There should be one method per concrete grammar type. They are
-    # organized in alphabetical order.
-    #########################################################################
-
-    def _Add(self, t):
-        self.__binary_op(t, '+')
-
-    def _And(self, t):
-        self._write(" (")
-        for i, node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i != len(t.nodes)-1:
-                self._write(") and (")
-        self._write(")")
-
-    def _AssAttr(self, t):
-        """ Handle assigning an attribute of an object
-        """
-        self._dispatch(t.expr)
-        self._write('.'+t.attrname)
-
-    def _Assign(self, t):
-        """ Expression Assignment such as "a = 1".
-
-            This only handles assignment in expressions.  Keyword assignment
-            is handled separately.
-        """
-        self._fill()
-        for target in t.nodes:
-            self._dispatch(target)
-            self._write(" = ")
-        self._dispatch(t.expr)
-        if not self._do_indent:
-            self._write('; ')
-
-    def _AssName(self, t):
-        """ Name on left hand side of expression.
-
-            Treat just like a name on the right side of an expression.
-        """
-        self._Name(t)
-
-    def _AssTuple(self, t):
-        """ Tuple on left hand side of an expression.
-        """
-
-        # _write each elements, separated by a comma.
-        for element in t.nodes[:-1]:
-            self._dispatch(element)
-            self._write(", ")
-
-        # Handle the last one without writing comma
-        last_element = t.nodes[-1]
-        self._dispatch(last_element)
-
-    def _AugAssign(self, t):
-        """ +=,-=,*=,/=,**=, etc. operations
-        """
-
-        self._fill()
-        self._dispatch(t.node)
-        self._write(' '+t.op+' ')
-        self._dispatch(t.expr)
-        if not self._do_indent:
-            self._write(';')
-
-    def _Bitand(self, t):
-        """ Bit and operation.
-        """
-
-        for i, node in enumerate(t.nodes):
-            self._write("(")
-            self._dispatch(node)
-            self._write(")")
-            if i != len(t.nodes)-1:
-                self._write(" & ")
-
-    def _Bitor(self, t):
-        """ Bit or operation
-        """
-
-        for i, node in enumerate(t.nodes):
-            self._write("(")
-            self._dispatch(node)
-            self._write(")")
-            if i != len(t.nodes)-1:
-                self._write(" | ")
-
-    def _CallFunc(self, t):
-        """ Function call.
-        """
-        self._dispatch(t.node)
-        self._write("(")
-        comma = False
-        for e in t.args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._dispatch(e)
-        if t.star_args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._write("*")
-            self._dispatch(t.star_args)
-        if t.dstar_args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._write("**")
-            self._dispatch(t.dstar_args)
-        self._write(")")
-
-    def _Compare(self, t):
-        self._dispatch(t.expr)
-        for op, expr in t.ops:
-            self._write(" " + op + " ")
-            self._dispatch(expr)
-
-    def _Const(self, t):
-        """ A constant value such as an integer value, 3, or a string, "hello".
-        """
-        self._dispatch(t.value)
-
-    def _Decorators(self, t):
-        """ Handle function decorators (eg. @has_units)
-        """
-        for node in t.nodes:
-            self._dispatch(node)
-
-    def _Dict(self, t):
-        self._write("{")
-        for  i, (k, v) in enumerate(t.items):
-            self._dispatch(k)
-            self._write(": ")
-            self._dispatch(v)
-            if i < len(t.items)-1:
-                self._write(", ")
-        self._write("}")
-
-    def _Discard(self, t):
-        """ Node for when return value is ignored such as in "foo(a)".
-        """
-        self._fill()
-        self._dispatch(t.expr)
-
-    def _Div(self, t):
-        self.__binary_op(t, '/')
-
-    def _Ellipsis(self, t):
-        self._write("...")
-
-    def _From(self, t):
-        """ Handle "from xyz import foo, bar as baz".
-        """
-        # fixme: Are From and ImportFrom handled differently?
-        self._fill("from ")
-        self._write(t.modname)
-        self._write(" import ")
-        for i, (name,asname) in enumerate(t.names):
-            if i != 0:
-                self._write(", ")
-            self._write(name)
-            if asname is not None:
-                self._write(" as "+asname)
-
-    def _Function(self, t):
-        """ Handle function definitions
-        """
-        if t.decorators is not None:
-            self._fill("@")
-            self._dispatch(t.decorators)
-        self._fill("def "+t.name + "(")
-        defaults = [None] * (len(t.argnames) - len(t.defaults)) + list(t.defaults)
-        for i, arg in enumerate(zip(t.argnames, defaults)):
-            self._write(arg[0])
-            if arg[1] is not None:
-                self._write('=')
-                self._dispatch(arg[1])
-            if i < len(t.argnames)-1:
-                self._write(', ')
-        self._write(")")
-        if self._single_func:
-            self._do_indent = False
-        self._enter()
-        self._dispatch(t.code)
-        self._leave()
-        self._do_indent = True
-
-    def _Getattr(self, t):
-        """ Handle getting an attribute of an object
-        """
-        if isinstance(t.expr, (Div, Mul, Sub, Add)):
-            self._write('(')
-            self._dispatch(t.expr)
-            self._write(')')
-        else:
-            self._dispatch(t.expr)
-            
-        self._write('.'+t.attrname)
-        
-    def _If(self, t):
-        self._fill()
-        
-        for i, (compare,code) in enumerate(t.tests):
-            if i == 0:
-                self._write("if ")
-            else:
-                self._write("elif ")
-            self._dispatch(compare)
-            self._enter()
-            self._fill()
-            self._dispatch(code)
-            self._leave()
-            self._write("\n")
-
-        if t.else_ is not None:
-            self._write("else")
-            self._enter()
-            self._fill()
-            self._dispatch(t.else_)
-            self._leave()
-            self._write("\n")
-            
-    def _IfExp(self, t):
-        self._dispatch(t.then)
-        self._write(" if ")
-        self._dispatch(t.test)
-
-        if t.else_ is not None:
-            self._write(" else (")
-            self._dispatch(t.else_)
-            self._write(")")
-
-    def _Import(self, t):
-        """ Handle "import xyz.foo".
-        """
-        self._fill("import ")
-        
-        for i, (name,asname) in enumerate(t.names):
-            if i != 0:
-                self._write(", ")
-            self._write(name)
-            if asname is not None:
-                self._write(" as "+asname)
-
-    def _Keyword(self, t):
-        """ Keyword value assignment within function calls and definitions.
-        """
-        self._write(t.name)
-        self._write("=")
-        self._dispatch(t.expr)
-        
-    def _List(self, t):
-        self._write("[")
-        for  i,node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i < len(t.nodes)-1:
-                self._write(", ")
-        self._write("]")
-
-    def _Module(self, t):
-        if t.doc is not None:
-            self._dispatch(t.doc)
-        self._dispatch(t.node)
-
-    def _Mul(self, t):
-        self.__binary_op(t, '*')
-
-    def _Name(self, t):
-        self._write(t.name)
-
-    def _NoneType(self, t):
-        self._write("None")
-        
-    def _Not(self, t):
-        self._write('not (')
-        self._dispatch(t.expr)
-        self._write(')')
-        
-    def _Or(self, t):
-        self._write(" (")
-        for i, node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i != len(t.nodes)-1:
-                self._write(") or (")
-        self._write(")")
-                
-    def _Pass(self, t):
-        self._write("pass\n")
-
-    def _Printnl(self, t):
-        self._fill("print ")
-        if t.dest:
-            self._write(">> ")
-            self._dispatch(t.dest)
-            self._write(", ")
-        comma = False
-        for node in t.nodes:
-            if comma: self._write(', ')
-            else: comma = True
-            self._dispatch(node)
-
-    def _Power(self, t):
-        self.__binary_op(t, '**')
-
-    def _Return(self, t):
-        self._fill("return ")
-        if t.value:
-            if isinstance(t.value, Tuple):
-                text = ', '.join([ name.name for name in t.value.asList() ])
-                self._write(text)
-            else:
-                self._dispatch(t.value)
-            if not self._do_indent:
-                self._write('; ')
-
-    def _Slice(self, t):
-        self._dispatch(t.expr)
-        self._write("[")
-        if t.lower:
-            self._dispatch(t.lower)
-        self._write(":")
-        if t.upper:
-            self._dispatch(t.upper)
-        #if t.step:
-        #    self._write(":")
-        #    self._dispatch(t.step)
-        self._write("]")
-
-    def _Sliceobj(self, t):
-        for i, node in enumerate(t.nodes):
-            if i != 0:
-                self._write(":")
-            if not (isinstance(node, Const) and node.value is None):
-                self._dispatch(node)
-
-    def _Stmt(self, tree):
-        for node in tree.nodes:
-            self._dispatch(node)
-
-    def _Sub(self, t):
-        self.__binary_op(t, '-')
-
-    def _Subscript(self, t):
-        self._dispatch(t.expr)
-        self._write("[")
-        for i, value in enumerate(t.subs):
-            if i != 0:
-                self._write(",")
-            self._dispatch(value)
-        self._write("]")
-
-    def _TryExcept(self, t):
-        self._fill("try")
-        self._enter()
-        self._dispatch(t.body)
-        self._leave()
-
-        for handler in t.handlers:
-            self._fill('except ')
-            self._dispatch(handler[0])
-            if handler[1] is not None:
-                self._write(', ')
-                self._dispatch(handler[1])
-            self._enter()
-            self._dispatch(handler[2])
-            self._leave()
-            
-        if t.else_:
-            self._fill("else")
-            self._enter()
-            self._dispatch(t.else_)
-            self._leave()
-
-    def _Tuple(self, t):
-
-        if not t.nodes:
-            # Empty tuple.
-            self._write("()")
-        else:
-            self._write("(")
-
-            # _write each elements, separated by a comma.
-            for element in t.nodes[:-1]:
-                self._dispatch(element)
-                self._write(", ")
-
-            # Handle the last one without writing comma
-            last_element = t.nodes[-1]
-            self._dispatch(last_element)
-
-            self._write(")")
-            
-    def _UnaryAdd(self, t):
-        self._write("+")
-        self._dispatch(t.expr)
-        
-    def _UnarySub(self, t):
-        self._write("-")
-        self._dispatch(t.expr)        
-
-    def _With(self, t):
-        self._fill('with ')
-        self._dispatch(t.expr)
-        if t.vars:
-            self._write(' as ')
-            self._dispatch(t.vars.name)
-        self._enter()
-        self._dispatch(t.body)
-        self._leave()
-        self._write('\n')
-        
-    def _int(self, t):
-        self._write(repr(t))
-
-    def __binary_op(self, t, symbol):
-        # Check if parenthesis are needed on left side and then dispatch
-        has_paren = False
-        left_class = str(t.left.__class__)
-        if (left_class in op_precedence.keys() and
-            op_precedence[left_class] < op_precedence[str(t.__class__)]):
-            has_paren = True
-        if has_paren:
-            self._write('(')
-        self._dispatch(t.left)
-        if has_paren:
-            self._write(')')
-        # Write the appropriate symbol for operator
-        self._write(symbol)
-        # Check if parenthesis are needed on the right side and then dispatch
-        has_paren = False
-        right_class = str(t.right.__class__)
-        if (right_class in op_precedence.keys() and
-            op_precedence[right_class] < op_precedence[str(t.__class__)]):
-            has_paren = True
-        if has_paren:
-            self._write('(')
-        self._dispatch(t.right)
-        if has_paren:
-            self._write(')')
-
-    def _float(self, t):
-        # if t is 0.1, str(t)->'0.1' while repr(t)->'0.1000000000001'
-        # We prefer str here.
-        self._write(str(t))
-
-    def _str(self, t):
-        self._write(repr(t))
-        
-    def _tuple(self, t):
-        self._write(str(t))
-
-    #########################################################################
-    # These are the methods from the _ast modules unparse.
-    #
-    # As our needs to handle more advanced code increase, we may want to
-    # modify some of the methods below so that they work for compiler.ast.
-    #########################################################################
-
-#    # stmt
-#    def _Expr(self, tree):
-#        self._fill()
-#        self._dispatch(tree.value)
-#
-#    def _Import(self, t):
-#        self._fill("import ")
-#        first = True
-#        for a in t.names:
-#            if first:
-#                first = False
-#            else:
-#                self._write(", ")
-#            self._write(a.name)
-#            if a.asname:
-#                self._write(" as "+a.asname)
-#
-##    def _ImportFrom(self, t):
-##        self._fill("from ")
-##        self._write(t.module)
-##        self._write(" import ")
-##        for i, a in enumerate(t.names):
-##            if i == 0:
-##                self._write(", ")
-##            self._write(a.name)
-##            if a.asname:
-##                self._write(" as "+a.asname)
-##        # XXX(jpe) what is level for?
-##
-#
-#    def _Break(self, t):
-#        self._fill("break")
-#
-#    def _Continue(self, t):
-#        self._fill("continue")
-#
-#    def _Delete(self, t):
-#        self._fill("del ")
-#        self._dispatch(t.targets)
-#
-#    def _Assert(self, t):
-#        self._fill("assert ")
-#        self._dispatch(t.test)
-#        if t.msg:
-#            self._write(", ")
-#            self._dispatch(t.msg)
-#
-#    def _Exec(self, t):
-#        self._fill("exec ")
-#        self._dispatch(t.body)
-#        if t.globals:
-#            self._write(" in ")
-#            self._dispatch(t.globals)
-#        if t.locals:
-#            self._write(", ")
-#            self._dispatch(t.locals)
-#
-#    def _Print(self, t):
-#        self._fill("print ")
-#        do_comma = False
-#        if t.dest:
-#            self._write(">>")
-#            self._dispatch(t.dest)
-#            do_comma = True
-#        for e in t.values:
-#            if do_comma:self._write(", ")
-#            else:do_comma=True
-#            self._dispatch(e)
-#        if not t.nl:
-#            self._write(",")
-#
-#    def _Global(self, t):
-#        self._fill("global")
-#        for i, n in enumerate(t.names):
-#            if i != 0:
-#                self._write(",")
-#            self._write(" " + n)
-#
-#    def _Yield(self, t):
-#        self._fill("yield")
-#        if t.value:
-#            self._write(" (")
-#            self._dispatch(t.value)
-#            self._write(")")
-#
-#    def _Raise(self, t):
-#        self._fill('raise ')
-#        if t.type:
-#            self._dispatch(t.type)
-#        if t.inst:
-#            self._write(", ")
-#            self._dispatch(t.inst)
-#        if t.tback:
-#            self._write(", ")
-#            self._dispatch(t.tback)
-#
-#
-#    def _TryFinally(self, t):
-#        self._fill("try")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#        self._fill("finally")
-#        self._enter()
-#        self._dispatch(t.finalbody)
-#        self._leave()
-#
-#    def _excepthandler(self, t):
-#        self._fill("except ")
-#        if t.type:
-#            self._dispatch(t.type)
-#        if t.name:
-#            self._write(", ")
-#            self._dispatch(t.name)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _ClassDef(self, t):
-#        self._write("\n")
-#        self._fill("class "+t.name)
-#        if t.bases:
-#            self._write("(")
-#            for a in t.bases:
-#                self._dispatch(a)
-#                self._write(", ")
-#            self._write(")")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _FunctionDef(self, t):
-#        self._write("\n")
-#        for deco in t.decorators:
-#            self._fill("@")
-#            self._dispatch(deco)
-#        self._fill("def "+t.name + "(")
-#        self._dispatch(t.args)
-#        self._write(")")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _For(self, t):
-#        self._fill("for ")
-#        self._dispatch(t.target)
-#        self._write(" in ")
-#        self._dispatch(t.iter)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#        if t.orelse:
-#            self._fill("else")
-#            self._enter()
-#            self._dispatch(t.orelse)
-#            self._leave
-#
-#    def _While(self, t):
-#        self._fill("while ")
-#        self._dispatch(t.test)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#        if t.orelse:
-#            self._fill("else")
-#            self._enter()
-#            self._dispatch(t.orelse)
-#            self._leave
-#
-#    # expr
-#    def _Str(self, tree):
-#        self._write(repr(tree.s))
-##
-#    def _Repr(self, t):
-#        self._write("`")
-#        self._dispatch(t.value)
-#        self._write("`")
-#
-#    def _Num(self, t):
-#        self._write(repr(t.n))
-#
-#    def _ListComp(self, t):
-#        self._write("[")
-#        self._dispatch(t.elt)
-#        for gen in t.generators:
-#            self._dispatch(gen)
-#        self._write("]")
-#
-#    def _GeneratorExp(self, t):
-#        self._write("(")
-#        self._dispatch(t.elt)
-#        for gen in t.generators:
-#            self._dispatch(gen)
-#        self._write(")")
-#
-#    def _comprehension(self, t):
-#        self._write(" for ")
-#        self._dispatch(t.target)
-#        self._write(" in ")
-#        self._dispatch(t.iter)
-#        for if_clause in t.ifs:
-#            self._write(" if ")
-#            self._dispatch(if_clause)
-#
-#    def _IfExp(self, t):
-#        self._dispatch(t.body)
-#        self._write(" if ")
-#        self._dispatch(t.test)
-#        if t.orelse:
-#            self._write(" else ")
-#            self._dispatch(t.orelse)
-#
-#    unop = {"Invert":"~", "Not": "not", "UAdd":"+", "USub":"-"}
-#    def _UnaryOp(self, t):
-#        self._write(self.unop[t.op.__class__.__name__])
-#        self._write("(")
-#        self._dispatch(t.operand)
-#        self._write(")")
-#
-#    binop = { "Add":"+", "Sub":"-", "Mult":"*", "Div":"/", "Mod":"%",
-#                    "LShift":">>", "RShift":"<<", "BitOr":"|", "BitXor":"^", "BitAnd":"&",
-#                    "FloorDiv":"//", "Pow": "**"}
-#    def _BinOp(self, t):
-#        self._write("(")
-#        self._dispatch(t.left)
-#        self._write(")" + self.binop[t.op.__class__.__name__] + "(")
-#        self._dispatch(t.right)
-#        self._write(")")
-#
-#    boolops = {_ast.And: 'and', _ast.Or: 'or'}
-#    def _BoolOp(self, t):
-#        self._write("(")
-#        self._dispatch(t.values[0])
-#        for v in t.values[1:]:
-#            self._write(" %s " % self.boolops[t.op.__class__])
-#            self._dispatch(v)
-#        self._write(")")
-#
-#    def _Attribute(self,t):
-#        self._dispatch(t.value)
-#        self._write(".")
-#        self._write(t.attr)
-#
-##    def _Call(self, t):
-##        self._dispatch(t.func)
-##        self._write("(")
-##        comma = False
-##        for e in t.args:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._dispatch(e)
-##        for e in t.keywords:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._dispatch(e)
-##        if t.starargs:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._write("*")
-##            self._dispatch(t.starargs)
-##        if t.kwargs:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._write("**")
-##            self._dispatch(t.kwargs)
-##        self._write(")")
-#
-#    # slice
-#    def _Index(self, t):
-#        self._dispatch(t.value)
-#
-#    def _ExtSlice(self, t):
-#        for i, d in enumerate(t.dims):
-#            if i != 0:
-#                self._write(': ')
-#            self._dispatch(d)
-#
-#    # others
-#    def _arguments(self, t):
-#        first = True
-#        nonDef = len(t.args)-len(t.defaults)
-#        for a in t.args[0:nonDef]:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._dispatch(a)
-#        for a,d in zip(t.args[nonDef:], t.defaults):
-#            if first:first = False
-#            else: self._write(", ")
-#            self._dispatch(a),
-#            self._write("=")
-#            self._dispatch(d)
-#        if t.vararg:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._write("*"+t.vararg)
-#        if t.kwarg:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._write("**"+t.kwarg)
-#
-##    def _keyword(self, t):
-##        self._write(t.arg)
-##        self._write("=")
-##        self._dispatch(t.value)
-#
-#    def _Lambda(self, t):
-#        self._write("lambda ")
-#        self._dispatch(t.args)
-#        self._write(": ")
-#        self._dispatch(t.body)
-
-
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/docscrape.py b/astropy_helpers/astropy_helpers/sphinx/ext/docscrape.py
deleted file mode 100644
index 2b1719d..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/docscrape.py
+++ /dev/null
@@ -1,531 +0,0 @@
-"""Extract reference documentation from the NumPy source tree.
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import inspect
-import textwrap
-import re
-import pydoc
-from warnings import warn
-import collections
-import sys
-
-
-class Reader(object):
-    """A line-based string reader.
-
-    """
-    def __init__(self, data):
-        """
-        Parameters
-        ----------
-        data : str
-           String with lines separated by '\n'.
-
-        """
-        if isinstance(data,list):
-            self._str = data
-        else:
-            self._str = data.split('\n') # store string as list of lines
-
-        self.reset()
-
-    def __getitem__(self, n):
-        return self._str[n]
-
-    def reset(self):
-        self._l = 0 # current line nr
-
-    def read(self):
-        if not self.eof():
-            out = self[self._l]
-            self._l += 1
-            return out
-        else:
-            return ''
-
-    def seek_next_non_empty_line(self):
-        for l in self[self._l:]:
-            if l.strip():
-                break
-            else:
-                self._l += 1
-
-    def eof(self):
-        return self._l >= len(self._str)
-
-    def read_to_condition(self, condition_func):
-        start = self._l
-        for line in self[start:]:
-            if condition_func(line):
-                return self[start:self._l]
-            self._l += 1
-            if self.eof():
-                return self[start:self._l+1]
-        return []
-
-    def read_to_next_empty_line(self):
-        self.seek_next_non_empty_line()
-        def is_empty(line):
-            return not line.strip()
-        return self.read_to_condition(is_empty)
-
-    def read_to_next_unindented_line(self):
-        def is_unindented(line):
-            return (line.strip() and (len(line.lstrip()) == len(line)))
-        return self.read_to_condition(is_unindented)
-
-    def peek(self,n=0):
-        if self._l + n < len(self._str):
-            return self[self._l + n]
-        else:
-            return ''
-
-    def is_empty(self):
-        return not ''.join(self._str).strip()
-
-
-class NumpyDocString(object):
-    def __init__(self, docstring, config={}):
-        docstring = textwrap.dedent(docstring).split('\n')
-
-        self._doc = Reader(docstring)
-        self._parsed_data = {
-            'Signature': '',
-            'Summary': [''],
-            'Extended Summary': [],
-            'Parameters': [],
-            'Returns': [],
-            'Raises': [],
-            'Warns': [],
-            'Other Parameters': [],
-            'Attributes': [],
-            'Methods': [],
-            'See Also': [],
-            'Notes': [],
-            'Warnings': [],
-            'References': '',
-            'Examples': '',
-            'index': {}
-            }
-
-        self._parse()
-
-    def __getitem__(self,key):
-        return self._parsed_data[key]
-
-    def __setitem__(self,key,val):
-        if key not in self._parsed_data:
-            warn("Unknown section %s" % key)
-        else:
-            self._parsed_data[key] = val
-
-    def _is_at_section(self):
-        self._doc.seek_next_non_empty_line()
-
-        if self._doc.eof():
-            return False
-
-        l1 = self._doc.peek().strip()  # e.g. Parameters
-
-        if l1.startswith('.. index::'):
-            return True
-
-        l2 = self._doc.peek(1).strip() #    ---------- or ==========
-        return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))
-
-    def _strip(self,doc):
-        i = 0
-        j = 0
-        for i,line in enumerate(doc):
-            if line.strip(): break
-
-        for j,line in enumerate(doc[::-1]):
-            if line.strip(): break
-
-        return doc[i:len(doc)-j]
-
-    def _read_to_next_section(self):
-        section = self._doc.read_to_next_empty_line()
-
-        while not self._is_at_section() and not self._doc.eof():
-            if not self._doc.peek(-1).strip(): # previous line was empty
-                section += ['']
-
-            section += self._doc.read_to_next_empty_line()
-
-        return section
-
-    def _read_sections(self):
-        while not self._doc.eof():
-            data = self._read_to_next_section()
-            name = data[0].strip()
-
-            if name.startswith('..'): # index section
-                yield name, data[1:]
-            elif len(data) < 2:
-                yield StopIteration
-            else:
-                yield name, self._strip(data[2:])
-
-    def _parse_param_list(self,content):
-        r = Reader(content)
-        params = []
-        while not r.eof():
-            header = r.read().strip()
-            if ' : ' in header:
-                arg_name, arg_type = header.split(' : ')[:2]
-            else:
-                arg_name, arg_type = header, ''
-
-            desc = r.read_to_next_unindented_line()
-            desc = dedent_lines(desc)
-
-            params.append((arg_name,arg_type,desc))
-
-        return params
-
-
-    _name_rgx = re.compile(r"^\s*(:(?P<role>\w+):`(?P<name>[a-zA-Z0-9_.-]+)`|"
-                           r" (?P<name2>[a-zA-Z0-9_.-]+))\s*", re.X)
-    def _parse_see_also(self, content):
-        """
-        func_name : Descriptive text
-            continued text
-        another_func_name : Descriptive text
-        func_name1, func_name2, :meth:`func_name`, func_name3
-
-        """
-        items = []
-
-        def parse_item_name(text):
-            """Match ':role:`name`' or 'name'"""
-            m = self._name_rgx.match(text)
-            if m:
-                g = m.groups()
-                if g[1] is None:
-                    return g[3], None
-                else:
-                    return g[2], g[1]
-            raise ValueError("%s is not a item name" % text)
-
-        def push_item(name, rest):
-            if not name:
-                return
-            name, role = parse_item_name(name)
-            items.append((name, list(rest), role))
-            del rest[:]
-
-        current_func = None
-        rest = []
-
-        for line in content:
-            if not line.strip(): continue
-
-            m = self._name_rgx.match(line)
-            if m and line[m.end():].strip().startswith(':'):
-                push_item(current_func, rest)
-                current_func, line = line[:m.end()], line[m.end():]
-                rest = [line.split(':', 1)[1].strip()]
-                if not rest[0]:
-                    rest = []
-            elif not line.startswith(' '):
-                push_item(current_func, rest)
-                current_func = None
-                if ',' in line:
-                    for func in line.split(','):
-                        if func.strip():
-                            push_item(func, [])
-                elif line.strip():
-                    current_func = line
-            elif current_func is not None:
-                rest.append(line.strip())
-        push_item(current_func, rest)
-        return items
-
-    def _parse_index(self, section, content):
-        """
-        .. index: default
-           :refguide: something, else, and more
-
-        """
-        def strip_each_in(lst):
-            return [s.strip() for s in lst]
-
-        out = {}
-        section = section.split('::')
-        if len(section) > 1:
-            out['default'] = strip_each_in(section[1].split(','))[0]
-        for line in content:
-            line = line.split(':')
-            if len(line) > 2:
-                out[line[1]] = strip_each_in(line[2].split(','))
-        return out
-
-    def _parse_summary(self):
-        """Grab signature (if given) and summary"""
-        if self._is_at_section():
-            return
-
-        # If several signatures present, take the last one
-        while True:
-            summary = self._doc.read_to_next_empty_line()
-            summary_str = " ".join([s.strip() for s in summary]).strip()
-            if re.compile('^([\w., ]+=)?\s*[\w\.]+\(.*\)$').match(summary_str):
-                self['Signature'] = summary_str
-                if not self._is_at_section():
-                    continue
-            break
-
-        if summary is not None:
-            self['Summary'] = summary
-
-        if not self._is_at_section():
-            self['Extended Summary'] = self._read_to_next_section()
-
-    def _parse(self):
-        self._doc.reset()
-        self._parse_summary()
-
-        for (section,content) in self._read_sections():
-            if not section.startswith('..'):
-                section = ' '.join([s.capitalize() for s in section.split(' ')])
-            if section in ('Parameters', 'Returns', 'Raises', 'Warns',
-                           'Other Parameters', 'Attributes', 'Methods'):
-                self[section] = self._parse_param_list(content)
-            elif section.startswith('.. index::'):
-                self['index'] = self._parse_index(section, content)
-            elif section == 'See Also':
-                self['See Also'] = self._parse_see_also(content)
-            else:
-                self[section] = content
-
-    # string conversion routines
-
-    def _str_header(self, name, symbol='-'):
-        return [name, len(name)*symbol]
-
-    def _str_indent(self, doc, indent=4):
-        out = []
-        for line in doc:
-            out += [' '*indent + line]
-        return out
-
-    def _str_signature(self):
-        if self['Signature']:
-            return [self['Signature'].replace('*','\*')] + ['']
-        else:
-            return ['']
-
-    def _str_summary(self):
-        if self['Summary']:
-            return self['Summary'] + ['']
-        else:
-            return []
-
-    def _str_extended_summary(self):
-        if self['Extended Summary']:
-            return self['Extended Summary'] + ['']
-        else:
-            return []
-
-    def _str_param_list(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            for param,param_type,desc in self[name]:
-                if param_type:
-                    out += ['%s : %s' % (param, param_type)]
-                else:
-                    out += [param]
-                out += self._str_indent(desc)
-            out += ['']
-        return out
-
-    def _str_section(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            out += self[name]
-            out += ['']
-        return out
-
-    def _str_see_also(self, func_role):
-        if not self['See Also']: return []
-        out = []
-        out += self._str_header("See Also")
-        last_had_desc = True
-        for func, desc, role in self['See Also']:
-            if role:
-                link = ':%s:`%s`' % (role, func)
-            elif func_role:
-                link = ':%s:`%s`' % (func_role, func)
-            else:
-                link = "`%s`_" % func
-            if desc or last_had_desc:
-                out += ['']
-                out += [link]
-            else:
-                out[-1] += ", %s" % link
-            if desc:
-                out += self._str_indent([' '.join(desc)])
-                last_had_desc = True
-            else:
-                last_had_desc = False
-        out += ['']
-        return out
-
-    def _str_index(self):
-        idx = self['index']
-        out = []
-        out += ['.. index:: %s' % idx.get('default','')]
-        for section, references in idx.items():
-            if section == 'default':
-                continue
-            out += ['   :%s: %s' % (section, ', '.join(references))]
-        return out
-
-    def __str__(self, func_role=''):
-        out = []
-        out += self._str_signature()
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        for param_list in ('Parameters', 'Returns', 'Other Parameters',
-                           'Raises', 'Warns'):
-            out += self._str_param_list(param_list)
-        out += self._str_section('Warnings')
-        out += self._str_see_also(func_role)
-        for s in ('Notes','References','Examples'):
-            out += self._str_section(s)
-        for param_list in ('Attributes', 'Methods'):
-            out += self._str_param_list(param_list)
-        out += self._str_index()
-        return '\n'.join(out)
-
-
-def indent(str,indent=4):
-    indent_str = ' '*indent
-    if str is None:
-        return indent_str
-    lines = str.split('\n')
-    return '\n'.join(indent_str + l for l in lines)
-
-def dedent_lines(lines):
-    """Deindent a list of lines maximally"""
-    return textwrap.dedent("\n".join(lines)).split("\n")
-
-def header(text, style='-'):
-    return text + '\n' + style*len(text) + '\n'
-
-
-class FunctionDoc(NumpyDocString):
-    def __init__(self, func, role='func', doc=None, config={}):
-        self._f = func
-        self._role = role # e.g. "func" or "meth"
-
-        if doc is None:
-            if func is None:
-                raise ValueError("No function or docstring given")
-            doc = inspect.getdoc(func) or ''
-        NumpyDocString.__init__(self, doc)
-
-        if not self['Signature'] and func is not None:
-            func, func_name = self.get_func()
-            try:
-                # try to read signature
-                if sys.version_info[0] >= 3:
-                    argspec = inspect.getfullargspec(func)
-                else:
-                    argspec = inspect.getargspec(func)
-                argspec = inspect.formatargspec(*argspec)
-                argspec = argspec.replace('*','\*')
-                signature = '%s%s' % (func_name, argspec)
-            except TypeError as e:
-                signature = '%s()' % func_name
-            self['Signature'] = signature
-
-    def get_func(self):
-        func_name = getattr(self._f, '__name__', self.__class__.__name__)
-        if inspect.isclass(self._f):
-            func = getattr(self._f, '__call__', self._f.__init__)
-        else:
-            func = self._f
-        return func, func_name
-
-    def __str__(self):
-        out = ''
-
-        func, func_name = self.get_func()
-        signature = self['Signature'].replace('*', '\*')
-
-        roles = {'func': 'function',
-                 'meth': 'method'}
-
-        if self._role:
-            if self._role not in roles:
-                print("Warning: invalid role %s" % self._role)
-            out += '.. %s:: %s\n    \n\n' % (roles.get(self._role,''),
-                                             func_name)
-
-        out += super(FunctionDoc, self).__str__(func_role=self._role)
-        return out
-
-
-class ClassDoc(NumpyDocString):
-
-    extra_public_methods = ['__call__']
-
-    def __init__(self, cls, doc=None, modulename='', func_doc=FunctionDoc,
-                 config={}):
-        if not inspect.isclass(cls) and cls is not None:
-            raise ValueError("Expected a class or None, but got %r" % cls)
-        self._cls = cls
-
-        if modulename and not modulename.endswith('.'):
-            modulename += '.'
-        self._mod = modulename
-
-        if doc is None:
-            if cls is None:
-                raise ValueError("No class or documentation string given")
-            doc = pydoc.getdoc(cls)
-
-        NumpyDocString.__init__(self, doc)
-
-        if config.get('show_class_members', True):
-            def splitlines_x(s):
-                if not s:
-                    return []
-                else:
-                    return s.splitlines()
-
-            for field, items in [('Methods', self.methods),
-                                 ('Attributes', self.properties)]:
-                if not self[field]:
-                    doc_list = []
-                    for name in sorted(items):
-                         try:
-                            doc_item = pydoc.getdoc(getattr(self._cls, name))
-                            doc_list.append((name, '', splitlines_x(doc_item)))
-                         except AttributeError:
-                            pass # method doesn't exist
-                    self[field] = doc_list
-
-    @property
-    def methods(self):
-        if self._cls is None:
-            return []
-        return [name for name,func in inspect.getmembers(self._cls)
-                if ((not name.startswith('_')
-                     or name in self.extra_public_methods)
-                    and isinstance(func, collections.Callable))]
-
-    @property
-    def properties(self):
-        if self._cls is None:
-            return []
-        return [name for name,func in inspect.getmembers(self._cls)
-                if not name.startswith('_') and
-                (func is None or isinstance(func, property) or
-                 inspect.isgetsetdescriptor(func))]
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/docscrape_sphinx.py b/astropy_helpers/astropy_helpers/sphinx/ext/docscrape_sphinx.py
deleted file mode 100644
index cdc2a37..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/docscrape_sphinx.py
+++ /dev/null
@@ -1,274 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import sys, re, inspect, textwrap, pydoc
-import sphinx
-import collections
-from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-class SphinxDocString(NumpyDocString):
-    def __init__(self, docstring, config={}):
-        NumpyDocString.__init__(self, docstring, config=config)
-        self.load_config(config)
-
-    def load_config(self, config):
-        self.use_plots = config.get('use_plots', False)
-        self.class_members_toctree = config.get('class_members_toctree', True)
-
-    # string conversion routines
-    def _str_header(self, name, symbol='`'):
-        return ['.. rubric:: ' + name, '']
-
-    def _str_field_list(self, name):
-        return [':' + name + ':']
-
-    def _str_indent(self, doc, indent=4):
-        out = []
-        for line in doc:
-            out += [' '*indent + line]
-        return out
-
-    def _str_signature(self):
-        return ['']
-        if self['Signature']:
-            return ['``%s``' % self['Signature']] + ['']
-        else:
-            return ['']
-
-    def _str_summary(self):
-        return self['Summary'] + ['']
-
-    def _str_extended_summary(self):
-        return self['Extended Summary'] + ['']
-
-    def _str_returns(self):
-        out = []
-        if self['Returns']:
-            out += self._str_field_list('Returns')
-            out += ['']
-            for param, param_type, desc in self['Returns']:
-                if param_type:
-                    out += self._str_indent(['**%s** : %s' % (param.strip(),
-                                                              param_type)])
-                else:
-                    out += self._str_indent([param.strip()])
-                if desc:
-                    out += ['']
-                    out += self._str_indent(desc, 8)
-                out += ['']
-        return out
-
-    def _str_param_list(self, name):
-        out = []
-        if self[name]:
-            out += self._str_field_list(name)
-            out += ['']
-            for param, param_type, desc in self[name]:
-                if param_type:
-                    out += self._str_indent(['**%s** : %s' % (param.strip(),
-                                                              param_type)])
-                else:
-                    out += self._str_indent(['**%s**' % param.strip()])
-                if desc:
-                    out += ['']
-                    out += self._str_indent(desc, 8)
-                out += ['']
-        return out
-
-    @property
-    def _obj(self):
-        if hasattr(self, '_cls'):
-            return self._cls
-        elif hasattr(self, '_f'):
-            return self._f
-        return None
-
-    def _str_member_list(self, name):
-        """
-        Generate a member listing, autosummary:: table where possible,
-        and a table where not.
-
-        """
-        out = []
-        if self[name]:
-            out += ['.. rubric:: %s' % name, '']
-            prefix = getattr(self, '_name', '')
-
-            if prefix:
-                prefix = '~%s.' % prefix
-
-            autosum = []
-            others = []
-            for param, param_type, desc in self[name]:
-                param = param.strip()
-
-                # Check if the referenced member can have a docstring or not
-                param_obj = getattr(self._obj, param, None)
-                if not (callable(param_obj)
-                        or isinstance(param_obj, property)
-                        or inspect.isgetsetdescriptor(param_obj)):
-                    param_obj = None
-
-                if param_obj and (pydoc.getdoc(param_obj) or not desc):
-                    # Referenced object has a docstring
-                    autosum += ["   %s%s" % (prefix, param)]
-                else:
-                    others.append((param, param_type, desc))
-
-            if autosum:
-                out += ['.. autosummary::']
-                if self.class_members_toctree:
-                    out += ['   :toctree:']
-                out += [''] + autosum
-
-            if others:
-                maxlen_0 = max(3, max([len(x[0]) for x in others]))
-                hdr = sixu("=")*maxlen_0 + sixu("  ") + sixu("=")*10
-                fmt = sixu('%%%ds  %%s  ') % (maxlen_0,)
-                out += ['', hdr]
-                for param, param_type, desc in others:
-                    desc = sixu(" ").join(x.strip() for x in desc).strip()
-                    if param_type:
-                        desc = "(%s) %s" % (param_type, desc)
-                    out += [fmt % (param.strip(), desc)]
-                out += [hdr]
-            out += ['']
-        return out
-
-    def _str_section(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            out += ['']
-            content = textwrap.dedent("\n".join(self[name])).split("\n")
-            out += content
-            out += ['']
-        return out
-
-    def _str_see_also(self, func_role):
-        out = []
-        if self['See Also']:
-            see_also = super(SphinxDocString, self)._str_see_also(func_role)
-            out = ['.. seealso::', '']
-            out += self._str_indent(see_also[2:])
-        return out
-
-    def _str_warnings(self):
-        out = []
-        if self['Warnings']:
-            out = ['.. warning::', '']
-            out += self._str_indent(self['Warnings'])
-        return out
-
-    def _str_index(self):
-        idx = self['index']
-        out = []
-        if len(idx) == 0:
-            return out
-
-        out += ['.. index:: %s' % idx.get('default','')]
-        for section, references in idx.items():
-            if section == 'default':
-                continue
-            elif section == 'refguide':
-                out += ['   single: %s' % (', '.join(references))]
-            else:
-                out += ['   %s: %s' % (section, ','.join(references))]
-        return out
-
-    def _str_references(self):
-        out = []
-        if self['References']:
-            out += self._str_header('References')
-            if isinstance(self['References'], str):
-                self['References'] = [self['References']]
-            out.extend(self['References'])
-            out += ['']
-            # Latex collects all references to a separate bibliography,
-            # so we need to insert links to it
-            if sphinx.__version__ >= "0.6":
-                out += ['.. only:: latex','']
-            else:
-                out += ['.. latexonly::','']
-            items = []
-            for line in self['References']:
-                m = re.match(r'.. \[([a-z0-9._-]+)\]', line, re.I)
-                if m:
-                    items.append(m.group(1))
-            out += ['   ' + ", ".join(["[%s]_" % item for item in items]), '']
-        return out
-
-    def _str_examples(self):
-        examples_str = "\n".join(self['Examples'])
-
-        if (self.use_plots and 'import matplotlib' in examples_str
-                and 'plot::' not in examples_str):
-            out = []
-            out += self._str_header('Examples')
-            out += ['.. plot::', '']
-            out += self._str_indent(self['Examples'])
-            out += ['']
-            return out
-        else:
-            return self._str_section('Examples')
-
-    def __str__(self, indent=0, func_role="obj"):
-        out = []
-        out += self._str_signature()
-        out += self._str_index() + ['']
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        out += self._str_param_list('Parameters')
-        out += self._str_returns()
-        for param_list in ('Other Parameters', 'Raises', 'Warns'):
-            out += self._str_param_list(param_list)
-        out += self._str_warnings()
-        out += self._str_see_also(func_role)
-        out += self._str_section('Notes')
-        out += self._str_references()
-        out += self._str_examples()
-        for param_list in ('Attributes', 'Methods'):
-            out += self._str_member_list(param_list)
-        out = self._str_indent(out,indent)
-        return '\n'.join(out)
-
-class SphinxFunctionDoc(SphinxDocString, FunctionDoc):
-    def __init__(self, obj, doc=None, config={}):
-        self.load_config(config)
-        FunctionDoc.__init__(self, obj, doc=doc, config=config)
-
-class SphinxClassDoc(SphinxDocString, ClassDoc):
-    def __init__(self, obj, doc=None, func_doc=None, config={}):
-        self.load_config(config)
-        ClassDoc.__init__(self, obj, doc=doc, func_doc=None, config=config)
-
-class SphinxObjDoc(SphinxDocString):
-    def __init__(self, obj, doc=None, config={}):
-        self._f = obj
-        self.load_config(config)
-        SphinxDocString.__init__(self, doc, config=config)
-
-def get_doc_object(obj, what=None, doc=None, config={}):
-    if what is None:
-        if inspect.isclass(obj):
-            what = 'class'
-        elif inspect.ismodule(obj):
-            what = 'module'
-        elif isinstance(obj, collections.Callable):
-            what = 'function'
-        else:
-            what = 'object'
-    if what == 'class':
-        return SphinxClassDoc(obj, func_doc=SphinxFunctionDoc, doc=doc,
-                              config=config)
-    elif what in ('function', 'method'):
-        return SphinxFunctionDoc(obj, doc=doc, config=config)
-    else:
-        if doc is None:
-            doc = pydoc.getdoc(obj)
-        return SphinxObjDoc(obj, doc, config=config)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/doctest.py b/astropy_helpers/astropy_helpers/sphinx/ext/doctest.py
deleted file mode 100644
index 22f0cba..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/doctest.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This is a set of three directives that allow us to insert metadata
-about doctests into the .rst files so the testing framework knows
-which tests to skip.
-
-This is quite different from the doctest extension in Sphinx itself,
-which actually does something.  For astropy, all of the testing is
-centrally managed from py.test and Sphinx is not used for running
-tests.
-"""
-from docutils.nodes import literal_block
-from sphinx.util.compat import Directive
-
-
-class DoctestSkipDirective(Directive):
-    has_content = True
-
-    def run(self):
-        code = '\n'.join(self.content)
-        return [literal_block(code, code)]
-
-
-class DoctestRequiresDirective(DoctestSkipDirective):
-    # This is silly, but we really support an unbounded number of
-    # optional arguments
-    optional_arguments = 64
-
-
-def setup(app):
-    app.add_directive('doctest-requires', DoctestRequiresDirective)
-    app.add_directive('doctest-skip', DoctestSkipDirective)
-    app.add_directive('doctest-skip-all', DoctestSkipDirective)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/edit_on_github.py b/astropy_helpers/astropy_helpers/sphinx/ext/edit_on_github.py
deleted file mode 100644
index 793bf8c..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/edit_on_github.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This extension makes it easy to edit documentation on github.
-
-It adds links associated with each docstring that go to the
-corresponding view source page on Github.  From there, the user can
-push the "Edit" button, edit the docstring, and submit a pull request.
-
-It has the following configuration options (to be set in the project's
-``conf.py``):
-
-* ``edit_on_github_project``
-    The name of the github project, in the form
-    "username/projectname".
-
-* ``edit_on_github_branch``
-    The name of the branch to edit.  If this is a released version,
-    this should be a git tag referring to that version.  For a
-    dev version, it often makes sense for it to be "master".  It
-    may also be a git hash.
-
-* ``edit_on_github_source_root``
-    The location within the source tree of the root of the
-    Python package.  Defaults to "lib".
-
-* ``edit_on_github_doc_root``
-    The location within the source tree of the root of the
-    documentation source.  Defaults to "doc", but it may make sense to
-    set it to "doc/source" if the project uses a separate source
-    directory.
-
-* ``edit_on_github_docstring_message``
-    The phrase displayed in the links to edit a docstring.  Defaults
-    to "[edit on github]".
-
-* ``edit_on_github_page_message``
-    The phrase displayed in the links to edit a RST page.  Defaults
-    to "[edit this page on github]".
-
-* ``edit_on_github_help_message``
-    The phrase displayed as a tooltip on the edit links.  Defaults to
-    "Push the Edit button on the next page"
-
-* ``edit_on_github_skip_regex``
-    When the path to the .rst file matches this regular expression,
-    no "edit this page on github" link will be added.  Defaults to
-    ``"_.*"``.
-"""
-import inspect
-import os
-import re
-import sys
-
-from docutils import nodes
-
-from sphinx import addnodes
-
-
-def import_object(modname, name):
-    """
-    Import the object given by *modname* and *name* and return it.
-    If not found, or the import fails, returns None.
-    """
-    try:
-        __import__(modname)
-        mod = sys.modules[modname]
-        obj = mod
-        for part in name.split('.'):
-            obj = getattr(obj, part)
-        return obj
-    except:
-        return None
-
-
-def get_url_base(app):
-    return  'http://github.com/%s/tree/%s/' % (
-        app.config.edit_on_github_project,
-        app.config.edit_on_github_branch)
-
-
-def doctree_read(app, doctree):
-    # Get the configuration parameters
-    if app.config.edit_on_github_project == 'REQUIRED':
-        raise ValueError(
-            "The edit_on_github_project configuration variable must be "
-            "provided in the conf.py")
-
-    source_root = app.config.edit_on_github_source_root
-    url = get_url_base(app)
-
-    docstring_message = app.config.edit_on_github_docstring_message
-
-    # Handle the docstring-editing links
-    for objnode in doctree.traverse(addnodes.desc):
-        if objnode.get('domain') != 'py':
-            continue
-        names = set()
-        for signode in objnode:
-            if not isinstance(signode, addnodes.desc_signature):
-                continue
-            modname = signode.get('module')
-            if not modname:
-                continue
-            fullname = signode.get('fullname')
-            if fullname in names:
-                # only one link per name, please
-                continue
-            names.add(fullname)
-            obj = import_object(modname, fullname)
-            anchor = None
-            if obj is not None:
-                try:
-                    lines, lineno = inspect.getsourcelines(obj)
-                except:
-                    pass
-                else:
-                    anchor = '#L%d' % lineno
-            if anchor:
-                real_modname = inspect.getmodule(obj).__name__
-                path = '%s%s%s.py%s' % (
-                    url, source_root, real_modname.replace('.', '/'), anchor)
-                onlynode = addnodes.only(expr='html')
-                onlynode += nodes.reference(
-                    reftitle=app.config.edit_on_github_help_message,
-                    refuri=path)
-                onlynode[0] += nodes.inline(
-                    '', '', nodes.raw('', ' ', format='html'),
-                    nodes.Text(docstring_message),
-                    classes=['edit-on-github', 'viewcode-link'])
-                signode += onlynode
-
-
-def html_page_context(app, pagename, templatename, context, doctree):
-    if (templatename == 'page.html' and
-        not re.match(app.config.edit_on_github_skip_regex, pagename)):
-
-        doc_root = app.config.edit_on_github_doc_root
-        if doc_root != '' and not doc_root.endswith('/'):
-            doc_root += '/'
-        doc_path = os.path.relpath(doctree.get('source'), app.builder.srcdir)
-        url = get_url_base(app)
-
-        page_message = app.config.edit_on_github_page_message
-
-        context['edit_on_github'] = url + doc_root + doc_path
-        context['edit_on_github_page_message'] = (
-            app.config.edit_on_github_page_message)
-
-
-def setup(app):
-    app.add_config_value('edit_on_github_project', 'REQUIRED', True)
-    app.add_config_value('edit_on_github_branch', 'master', True)
-    app.add_config_value('edit_on_github_source_root', 'lib', True)
-    app.add_config_value('edit_on_github_doc_root', 'doc', True)
-    app.add_config_value('edit_on_github_docstring_message',
-                         '[edit on github]', True)
-    app.add_config_value('edit_on_github_page_message',
-                         'Edit This Page on Github', True)
-    app.add_config_value('edit_on_github_help_message',
-                         'Push the Edit button on the next page', True)
-    app.add_config_value('edit_on_github_skip_regex',
-                         '_.*', True)
-
-    app.connect('doctree-read', doctree_read)
-    app.connect('html-page-context', html_page_context)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/numpydoc.py b/astropy_helpers/astropy_helpers/sphinx/ext/numpydoc.py
deleted file mode 100644
index 2bc2d1e..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/numpydoc.py
+++ /dev/null
@@ -1,187 +0,0 @@
-"""
-========
-numpydoc
-========
-
-Sphinx extension that handles docstrings in the Numpy standard format. [1]
-
-It will:
-
-- Convert Parameters etc. sections to field lists.
-- Convert See Also section to a See also entry.
-- Renumber references.
-- Extract the signature from the docstring, if it can't be determined otherwise.
-
-.. [1] https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import os, sys, re, pydoc
-import sphinx
-import inspect
-import collections
-
-if sphinx.__version__ < '1.0.1':
-    raise RuntimeError("Sphinx 1.0.1 or newer is required")
-
-from .docscrape_sphinx import get_doc_object, SphinxDocString
-from sphinx.util.compat import Directive
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-def mangle_docstrings(app, what, name, obj, options, lines,
-                      reference_offset=[0]):
-
-    cfg = dict(use_plots=app.config.numpydoc_use_plots,
-               show_class_members=app.config.numpydoc_show_class_members,
-               class_members_toctree=app.config.numpydoc_class_members_toctree,
-              )
-
-    if what == 'module':
-        # Strip top title
-        title_re = re.compile(sixu('^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*'),
-                              re.I|re.S)
-        lines[:] = title_re.sub(sixu(''), sixu("\n").join(lines)).split(sixu("\n"))
-    else:
-        doc = get_doc_object(obj, what, sixu("\n").join(lines), config=cfg)
-        if sys.version_info[0] >= 3:
-            doc = str(doc)
-        else:
-            doc = unicode(doc)
-        lines[:] = doc.split(sixu("\n"))
-
-    if app.config.numpydoc_edit_link and hasattr(obj, '__name__') and \
-           obj.__name__:
-        if hasattr(obj, '__module__'):
-            v = dict(full_name=sixu("%s.%s") % (obj.__module__, obj.__name__))
-        else:
-            v = dict(full_name=obj.__name__)
-        lines += [sixu(''), sixu('.. htmlonly::'), sixu('')]
-        lines += [sixu('    %s') % x for x in
-                  (app.config.numpydoc_edit_link % v).split("\n")]
-
-    # replace reference numbers so that there are no duplicates
-    references = []
-    for line in lines:
-        line = line.strip()
-        m = re.match(sixu('^.. \\[([a-z0-9_.-])\\]'), line, re.I)
-        if m:
-            references.append(m.group(1))
-
-    # start renaming from the longest string, to avoid overwriting parts
-    references.sort(key=lambda x: -len(x))
-    if references:
-        for i, line in enumerate(lines):
-            for r in references:
-                if re.match(sixu('^\\d+$'), r):
-                    new_r = sixu("R%d") % (reference_offset[0] + int(r))
-                else:
-                    new_r = sixu("%s%d") % (r, reference_offset[0])
-                lines[i] = lines[i].replace(sixu('[%s]_') % r,
-                                            sixu('[%s]_') % new_r)
-                lines[i] = lines[i].replace(sixu('.. [%s]') % r,
-                                            sixu('.. [%s]') % new_r)
-
-    reference_offset[0] += len(references)
-
-def mangle_signature(app, what, name, obj, options, sig, retann):
-    # Do not try to inspect classes that don't define `__init__`
-    if (inspect.isclass(obj) and
-        (not hasattr(obj, '__init__') or
-        'initializes x; see ' in pydoc.getdoc(obj.__init__))):
-        return '', ''
-
-    if not (isinstance(obj, collections.Callable) or hasattr(obj, '__argspec_is_invalid_')): return
-    if not hasattr(obj, '__doc__'): return
-
-    doc = SphinxDocString(pydoc.getdoc(obj))
-    if doc['Signature']:
-        sig = re.sub(sixu("^[^(]*"), sixu(""), doc['Signature'])
-        return sig, sixu('')
-
-def setup(app, get_doc_object_=get_doc_object):
-    if not hasattr(app, 'add_config_value'):
-        return # probably called by nose, better bail out
-
-    global get_doc_object
-    get_doc_object = get_doc_object_
-
-    app.connect('autodoc-process-docstring', mangle_docstrings)
-    app.connect('autodoc-process-signature', mangle_signature)
-    app.add_config_value('numpydoc_edit_link', None, False)
-    app.add_config_value('numpydoc_use_plots', None, False)
-    app.add_config_value('numpydoc_show_class_members', True, True)
-    app.add_config_value('numpydoc_class_members_toctree', True, True)
-
-    # Extra mangling domains
-    app.add_domain(NumpyPythonDomain)
-    app.add_domain(NumpyCDomain)
-
-#------------------------------------------------------------------------------
-# Docstring-mangling domains
-#------------------------------------------------------------------------------
-
-from docutils.statemachine import ViewList
-from sphinx.domains.c import CDomain
-from sphinx.domains.python import PythonDomain
-
-class ManglingDomainBase(object):
-    directive_mangling_map = {}
-
-    def __init__(self, *a, **kw):
-        super(ManglingDomainBase, self).__init__(*a, **kw)
-        self.wrap_mangling_directives()
-
-    def wrap_mangling_directives(self):
-        for name, objtype in list(self.directive_mangling_map.items()):
-            self.directives[name] = wrap_mangling_directive(
-                self.directives[name], objtype)
-
-class NumpyPythonDomain(ManglingDomainBase, PythonDomain):
-    name = 'np'
-    directive_mangling_map = {
-        'function': 'function',
-        'class': 'class',
-        'exception': 'class',
-        'method': 'function',
-        'classmethod': 'function',
-        'staticmethod': 'function',
-        'attribute': 'attribute',
-    }
-    indices = []
-
-class NumpyCDomain(ManglingDomainBase, CDomain):
-    name = 'np-c'
-    directive_mangling_map = {
-        'function': 'function',
-        'member': 'attribute',
-        'macro': 'function',
-        'type': 'class',
-        'var': 'object',
-    }
-
-def wrap_mangling_directive(base_directive, objtype):
-    class directive(base_directive):
-        def run(self):
-            env = self.state.document.settings.env
-
-            name = None
-            if self.arguments:
-                m = re.match(r'^(.*\s+)?(.*?)(\(.*)?', self.arguments[0])
-                name = m.group(2).strip()
-
-            if not name:
-                name = self.arguments[0]
-
-            lines = list(self.content)
-            mangle_docstrings(env.app, objtype, name, None, None, lines)
-            self.content = ViewList(lines, self.content.parent)
-
-            return base_directive.run(self)
-
-    return directive
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/phantom_import.py b/astropy_helpers/astropy_helpers/sphinx/ext/phantom_import.py
deleted file mode 100644
index 9a60b4a..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/phantom_import.py
+++ /dev/null
@@ -1,167 +0,0 @@
-"""
-==============
-phantom_import
-==============
-
-Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar
-extensions to use docstrings loaded from an XML file.
-
-This extension loads an XML file in the Pydocweb format [1] and
-creates a dummy module that contains the specified docstrings. This
-can be used to get the current docstrings from a Pydocweb instance
-without needing to rebuild the documented module.
-
-.. [1] http://code.google.com/p/pydocweb
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import imp, sys, compiler, types, os, inspect, re
-
-def setup(app):
-    app.connect('builder-inited', initialize)
-    app.add_config_value('phantom_import_file', None, True)
-
-def initialize(app):
-    fn = app.config.phantom_import_file
-    if (fn and os.path.isfile(fn)):
-        print("[numpydoc] Phantom importing modules from", fn, "...")
-        import_phantom_module(fn)
-
-#------------------------------------------------------------------------------
-# Creating 'phantom' modules from an XML description
-#------------------------------------------------------------------------------
-def import_phantom_module(xml_file):
-    """
-    Insert a fake Python module to sys.modules, based on a XML file.
-
-    The XML file is expected to conform to Pydocweb DTD. The fake
-    module will contain dummy objects, which guarantee the following:
-
-    - Docstrings are correct.
-    - Class inheritance relationships are correct (if present in XML).
-    - Function argspec is *NOT* correct (even if present in XML).
-      Instead, the function signature is prepended to the function docstring.
-    - Class attributes are *NOT* correct; instead, they are dummy objects.
-
-    Parameters
-    ----------
-    xml_file : str
-        Name of an XML file to read
-    
-    """
-    import lxml.etree as etree
-
-    object_cache = {}
-
-    tree = etree.parse(xml_file)
-    root = tree.getroot()
-
-    # Sort items so that
-    # - Base classes come before classes inherited from them
-    # - Modules come before their contents
-    all_nodes = dict([(n.attrib['id'], n) for n in root])
-    
-    def _get_bases(node, recurse=False):
-        bases = [x.attrib['ref'] for x in node.findall('base')]
-        if recurse:
-            j = 0
-            while True:
-                try:
-                    b = bases[j]
-                except IndexError: break
-                if b in all_nodes:
-                    bases.extend(_get_bases(all_nodes[b]))
-                j += 1
-        return bases
-
-    type_index = ['module', 'class', 'callable', 'object']
-    
-    def base_cmp(a, b):
-        x = cmp(type_index.index(a.tag), type_index.index(b.tag))
-        if x != 0: return x
-
-        if a.tag == 'class' and b.tag == 'class':
-            a_bases = _get_bases(a, recurse=True)
-            b_bases = _get_bases(b, recurse=True)
-            x = cmp(len(a_bases), len(b_bases))
-            if x != 0: return x
-            if a.attrib['id'] in b_bases: return -1
-            if b.attrib['id'] in a_bases: return 1
-        
-        return cmp(a.attrib['id'].count('.'), b.attrib['id'].count('.'))
-
-    nodes = root.getchildren()
-    nodes.sort(base_cmp)
-
-    # Create phantom items
-    for node in nodes:
-        name = node.attrib['id']
-        doc = (node.text or '').decode('string-escape') + "\n"
-        if doc == "\n": doc = ""
-
-        # create parent, if missing
-        parent = name
-        while True:
-            parent = '.'.join(parent.split('.')[:-1])
-            if not parent: break
-            if parent in object_cache: break
-            obj = imp.new_module(parent)
-            object_cache[parent] = obj
-            sys.modules[parent] = obj
-
-        # create object
-        if node.tag == 'module':
-            obj = imp.new_module(name)
-            obj.__doc__ = doc
-            sys.modules[name] = obj
-        elif node.tag == 'class':
-            bases = [object_cache[b] for b in _get_bases(node)
-                     if b in object_cache]
-            bases.append(object)
-            init = lambda self: None
-            init.__doc__ = doc
-            obj = type(name, tuple(bases), {'__doc__': doc, '__init__': init})
-            obj.__name__ = name.split('.')[-1]
-        elif node.tag == 'callable':
-            funcname = node.attrib['id'].split('.')[-1]
-            argspec = node.attrib.get('argspec')
-            if argspec:
-                argspec = re.sub('^[^(]*', '', argspec)
-                doc = "%s%s\n\n%s" % (funcname, argspec, doc)
-            obj = lambda: 0
-            obj.__argspec_is_invalid_ = True
-            if sys.version_info[0] >= 3:
-                obj.__name__ = funcname
-            else:
-                obj.func_name = funcname
-            obj.__name__ = name
-            obj.__doc__ = doc
-            if inspect.isclass(object_cache[parent]):
-                obj.__objclass__ = object_cache[parent]
-        else:
-            class Dummy(object): pass
-            obj = Dummy()
-            obj.__name__ = name
-            obj.__doc__ = doc
-            if inspect.isclass(object_cache[parent]):
-                obj.__get__ = lambda: None
-        object_cache[name] = obj
-
-        if parent:
-            if inspect.ismodule(object_cache[parent]):
-                obj.__module__ = parent
-                setattr(object_cache[parent], name.split('.')[-1], obj)
-
-    # Populate items
-    for node in root:
-        obj = object_cache.get(node.attrib['id'])
-        if obj is None: continue
-        for ref in node.findall('ref'):
-            if node.tag == 'class':
-                if ref.attrib['ref'].startswith(node.attrib['id'] + '.'):
-                    setattr(obj, ref.attrib['name'],
-                            object_cache.get(ref.attrib['ref']))
-            else:
-                setattr(obj, ref.attrib['name'],
-                        object_cache.get(ref.attrib['ref']))
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/smart_resolver.py b/astropy_helpers/astropy_helpers/sphinx/ext/smart_resolver.py
deleted file mode 100644
index 2cc7164..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/smart_resolver.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-The classes in the astropy docs are documented by their API location,
-which is not necessarily where they are defined in the source.  This
-causes a problem when certain automated features of the doc build,
-such as the inheritance diagrams or the `Bases` list of a class
-reference a class by its canonical location rather than its "user"
-location.
-
-In the `autodoc-process-docstring` event, a mapping from the actual
-name to the API name is maintained.  Later, in the `missing-reference`
-enent, unresolved references are looked up in this dictionary and
-corrected if possible.
-"""
-
-from docutils.nodes import literal
-
-
-def process_docstring(app, what, name, obj, options, lines):
-    if isinstance(obj, type):
-        env = app.env
-        if not hasattr(env, 'class_name_mapping'):
-            env.class_name_mapping = {}
-        mapping = env.class_name_mapping
-        mapping[obj.__module__ + '.' + obj.__name__] = name
-
-
-def missing_reference_handler(app, env, node, contnode):
-    if not hasattr(env, 'class_name_mapping'):
-        env.class_name_mapping = {}
-    mapping = env.class_name_mapping
-    reftype = node['reftype']
-    reftarget = node['reftarget']
-    if reftype in ('obj', 'class', 'exc', 'meth'):
-        reftarget = node['reftarget']
-        suffix = ''
-        if reftarget not in mapping:
-            if '.' in reftarget:
-                front, suffix = reftarget.rsplit('.', 1)
-            else:
-                suffix = reftarget
-
-            if suffix.startswith('_') and not suffix.startswith('__'):
-                # If this is a reference to a hidden class or method,
-                # we can't link to it, but we don't want to have a
-                # nitpick warning.
-                return node[0].deepcopy()
-
-            if reftype in ('obj', 'meth') and '.' in reftarget:
-                if front in mapping:
-                    reftarget = front
-                    suffix = '.' + suffix
-
-        if reftarget in mapping:
-            newtarget = mapping[reftarget] + suffix
-            if not node['refexplicit'] and not '~' in node.rawsource:
-                contnode = literal(text=newtarget)
-            newnode = env.domains['py'].resolve_xref(
-                env, node['refdoc'], app.builder, 'class', newtarget,
-                node, contnode)
-            if newnode is not None:
-                newnode['reftitle'] = reftarget
-            return newnode
-
-
-def setup(app):
-    app.connect('autodoc-process-docstring', process_docstring)
-
-    app.connect('missing-reference', missing_reference_handler)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst b/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
deleted file mode 100644
index a58aa35..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. currentmodule:: {{ module }}
-
-.. auto{{ objtype }}:: {{ objname }}
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst b/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
deleted file mode 100644
index 85105fa..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
+++ /dev/null
@@ -1,65 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
-   :show-inheritance:
-
-   {% if '__init__' in methods %}
-     {% set caught_result = methods.remove('__init__') %}
-   {% endif %}
-
-   {% block attributes_summary %}
-   {% if attributes %}
-
-   .. rubric:: Attributes Summary
-
-   .. autosummary::
-   {% for item in attributes %}
-      ~{{ name }}.{{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block methods_summary %}
-   {% if methods %}
-
-   .. rubric:: Methods Summary
-
-   .. autosummary::
-   {% for item in methods %}
-      ~{{ name }}.{{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block attributes_documentation %}
-   {% if attributes %}
-
-   .. rubric:: Attributes Documentation
-
-   {% for item in attributes %}
-   .. autoattribute:: {{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block methods_documentation %}
-   {% if methods %}
-
-   .. rubric:: Methods Documentation
-
-   {% for item in methods %}
-   .. automethod:: {{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst b/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
deleted file mode 100644
index 11208a2..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. automodule:: {{ fullname }}
-
-   {% block functions %}
-   {% if functions %}
-   .. rubric:: Functions
-
-   .. autosummary::
-   {% for item in functions %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
-
-   {% block classes %}
-   {% if classes %}
-   .. rubric:: Classes
-
-   .. autosummary::
-   {% for item in classes %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
-
-   {% block exceptions %}
-   {% if exceptions %}
-   .. rubric:: Exceptions
-
-   .. autosummary::
-   {% for item in exceptions %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tests/__init__.py b/astropy_helpers/astropy_helpers/sphinx/ext/tests/__init__.py
deleted file mode 100644
index 6476492..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tests/__init__.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import os
-import subprocess as sp
-import sys
-
-from textwrap import dedent
-
-import pytest
-
-
- at pytest.fixture
-def cython_testpackage(tmpdir, request):
-    """
-    Creates a trivial Cython package for use with tests.
-    """
-
-    test_pkg = tmpdir.mkdir('test_pkg')
-    test_pkg.mkdir('_eva_').ensure('__init__.py')
-    test_pkg.join('_eva_').join('unit02.pyx').write(dedent("""\
-        def pilot():
-            \"\"\"Returns the pilot of Eva Unit-02.\"\"\"
-
-            return True
-    """))
-
-    import astropy_helpers
-
-    test_pkg.join('setup.py').write(dedent("""\
-        import sys
-
-        sys.path.insert(0, {0!r})
-
-        from os.path import join
-        from setuptools import setup, Extension
-        from astropy_helpers.setup_helpers import register_commands
-
-        NAME = '_eva_'
-        VERSION = 0.1
-        RELEASE = True
-
-        cmdclassd = register_commands(NAME, VERSION, RELEASE)
-
-        setup(
-            name=NAME,
-            version=VERSION,
-            cmdclass=cmdclassd,
-            ext_modules=[Extension('_eva_.unit02',
-                                   [join('_eva_', 'unit02.pyx')])]
-        )
-    """.format(os.path.dirname(astropy_helpers.__path__[0]))))
-
-    test_pkg.chdir()
-    # Build the Cython module in a subprocess; otherwise strange things can
-    # happen with Cython's global module state
-    sp.call([sys.executable, 'setup.py', 'build_ext', '--inplace'])
-
-    sys.path.insert(0, str(test_pkg))
-    import _eva_.unit02
-
-    def cleanup(test_pkg=test_pkg):
-        for modname in ['_eva_', '_eva_.unit02']:
-            try:
-                del sys.modules[modname]
-            except KeyError:
-                pass
-
-        sys.path.remove(str(test_pkg))
-
-    request.addfinalizer(cleanup)
-
-    return test_pkg
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodapi.py b/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodapi.py
deleted file mode 100644
index 07b12e4..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodapi.py
+++ /dev/null
@@ -1,346 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import os
-import sys
-
-import pytest
-
-from . import *
-from ....tests import *
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-pytest.importorskip('sphinx')  # skips these tests if sphinx not present
-
-
-class FakeConfig(object):
-    """
-    Mocks up a sphinx configuration setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        for k, v in kwargs.iteritems():
-            setattr(self, k, v)
-
-
-class FakeApp(object):
-    """
-    Mocks up a `sphinx.application.Application` object for automodapi tests
-    """
-
-    # Some default config values
-    _defaults = {
-        'automodapi_toctreedirnm': 'api',
-        'automodapi_writereprocessed': False
-    }
-
-    def __init__(self, **configs):
-        config = self._defaults.copy()
-        config.update(configs)
-        self.config = FakeConfig(**config)
-        self.info = []
-        self.warnings = []
-
-    def info(self, msg, loc):
-        self.info.append((msg, loc))
-
-    def warn(self, msg, loc):
-        self.warnings.append((msg, loc))
-
-
-am_replacer_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.tests.test_automodapi
-{options}
-
-This comes after
-"""
-
-am_replacer_basic_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
--------------------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-Class Inheritance Diagram
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automod-diagram:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :private-bases:
-    :parts: 1
-    {empty}
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-# the .format is necessary for editors that remove empty-line whitespace
-
-
-def test_am_replacer_basic():
-    """
-    Tests replacing an ".. automodapi::" with the automodapi no-option
-    template
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_str.format(options=''), fakeapp)
-
-    assert result == am_replacer_basic_expected
-
-am_replacer_noinh_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
--------------------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_noinh():
-    """
-    Tests replacing an ".. automodapi::" with no-inheritance-diagram
-    option
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    ops = ['', ':no-inheritance-diagram:']
-    ostr = '\n    '.join(ops)
-    result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
-
-    assert result == am_replacer_noinh_expected
-
-am_replacer_titleandhdrs_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-*********
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-*******
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-Class Inheritance Diagram
-*************************
-
-.. automod-diagram:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :private-bases:
-    :parts: 1
-    {empty}
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_titleandhdrs():
-    """
-    Tests replacing an ".. automodapi::" entry with title-setting and header
-    character options.
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    ops = ['', ':title: A new title', ':headings: &*']
-    ostr = '\n    '.join(ops)
-    result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
-
-    assert result == am_replacer_titleandhdrs_expected
-
-
-am_replacer_nomain_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :no-main-docstr:
-
-This comes after
-"""
-
-am_replacer_nomain_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.automodapi Module
---------------------------------------------
-
-
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodapi
-    :functions-only:
-    :toctree: api/
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_nomain():
-    """
-    Tests replacing an ".. automodapi::" with "no-main-docstring" .
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_nomain_str, fakeapp)
-
-    assert result == am_replacer_nomain_expected
-
-
-am_replacer_skip_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :skip: something1
-    :skip: something2
-
-This comes after
-"""
-
-am_replacer_skip_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.automodapi Module
---------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodapi
-    :functions-only:
-    :toctree: api/
-    :skip: something1,something2
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_skip():
-    """
-    Tests using the ":skip: option in an ".. automodapi::" .
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_skip_str, fakeapp)
-
-    assert result == am_replacer_skip_expected
-
-
-am_replacer_invalidop_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :invalid-option:
-
-This comes after
-"""
-
-
-def test_am_replacer_invalidop():
-    """
-    Tests that a sphinx warning is produced with an invalid option.
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    automodapi_replace(am_replacer_invalidop_str, fakeapp)
-
-    expected_warnings = [('Found additional options invalid-option in '
-                          'automodapi.', None)]
-
-    assert fakeapp.warnings == expected_warnings
-
-
-am_replacer_cython_str = """
-This comes before
-
-.. automodapi:: _eva_.unit02
-{options}
-
-This comes after
-"""
-
-am_replacer_cython_expected = """
-This comes before
-
-_eva_.unit02 Module
--------------------
-
-.. automodule:: _eva_.unit02
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: _eva_.unit02
-    :functions-only:
-    :toctree: api/
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_cython(cython_testpackage):
-    """
-    Tests replacing an ".. automodapi::" for a Cython module.
-    """
-
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_cython_str.format(options=''),
-                                fakeapp)
-
-    assert result == am_replacer_cython_expected
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodsumm.py b/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodsumm.py
deleted file mode 100644
index 74d4900..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_automodsumm.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import sys
-
-import pytest
-
-from . import *
-from ....tests import *
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-pytest.importorskip('sphinx')  # skips these tests if sphinx not present
-
-
-class FakeEnv(object):
-    """
-    Mocks up a sphinx env setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        for k, v in kwargs.iteritems():
-            setattr(self, k, v)
-
-
-class FakeBuilder(object):
-    """
-    Mocks up a sphinx builder setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        self.env = FakeEnv(**kwargs)
-
-
-class FakeApp(object):
-    """
-    Mocks up a `sphinx.application.Application` object for automodapi tests
-    """
-    def __init__(self, srcdir, automodapipresent=True):
-        self.builder = FakeBuilder(srcdir=srcdir)
-        self.info = []
-        self.warnings = []
-        self._extensions = []
-        if automodapipresent:
-            self._extensions.append('astropy_helpers.sphinx.ext.automodapi')
-
-    def info(self, msg, loc):
-        self.info.append((msg, loc))
-
-    def warn(self, msg, loc):
-        self.warnings.append((msg, loc))
-
-
-ams_to_asmry_str = """
-Before
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodsumm
-    :p:
-
-And After
-"""
-
-ams_to_asmry_expected = """\
-.. currentmodule:: astropy_helpers.sphinx.ext.automodsumm
-
-.. autosummary::
-    :p:
-
-    Automoddiagram
-    Automodsumm
-    automodsumm_to_autosummary_lines
-    generate_automodsumm_docs
-    process_automodsumm_generation
-    setup"""
-
-
-def test_ams_to_asmry(tmpdir):
-    from ..automodsumm import automodsumm_to_autosummary_lines
-
-    fi = tmpdir.join('automodsumm.rst')
-    fi.write(ams_to_asmry_str)
-
-    fakeapp = FakeApp(srcdir='')
-    resultlines = automodsumm_to_autosummary_lines(str(fi), fakeapp)
-
-    assert '\n'.join(resultlines) == ams_to_asmry_expected
-
-
-ams_cython_str = """
-Before
-
-.. automodsumm:: _eva_.unit02
-    :functions-only:
-    :p:
-
-And After
-"""
-
-ams_cython_expected = """\
-.. currentmodule:: _eva_.unit02
-
-.. autosummary::
-    :p:
-
-    pilot"""
-
-
-def test_ams_cython(tmpdir, cython_testpackage):
-    from ..automodsumm import automodsumm_to_autosummary_lines
-
-    fi = tmpdir.join('automodsumm.rst')
-    fi.write(ams_cython_str)
-
-    fakeapp = FakeApp(srcdir='')
-    resultlines = automodsumm_to_autosummary_lines(str(fi), fakeapp)
-
-    assert '\n'.join(resultlines) == ams_cython_expected
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_docscrape.py b/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_docscrape.py
deleted file mode 100644
index 1cefd43..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_docscrape.py
+++ /dev/null
@@ -1,762 +0,0 @@
-# -*- encoding:utf-8 -*-
-from __future__ import division, absolute_import, print_function
-
-import sys, textwrap
-
-from ..docscrape import NumpyDocString, FunctionDoc, ClassDoc
-from ..docscrape_sphinx import SphinxDocString, SphinxClassDoc
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-doc_txt = '''\
-  numpy.multivariate_normal(mean, cov, shape=None, spam=None)
-
-  Draw values from a multivariate normal distribution with specified
-  mean and covariance.
-
-  The multivariate normal or Gaussian distribution is a generalisation
-  of the one-dimensional normal distribution to higher dimensions.
-
-  Parameters
-  ----------
-  mean : (N,) ndarray
-      Mean of the N-dimensional distribution.
-
-      .. math::
-
-         (1+2+3)/3
-
-  cov : (N, N) ndarray
-      Covariance matrix of the distribution.
-  shape : tuple of ints
-      Given a shape of, for example, (m,n,k), m*n*k samples are
-      generated, and packed in an m-by-n-by-k arrangement.  Because
-      each sample is N-dimensional, the output shape is (m,n,k,N).
-
-  Returns
-  -------
-  out : ndarray
-      The drawn samples, arranged according to `shape`.  If the
-      shape given is (m,n,...), then the shape of `out` is is
-      (m,n,...,N).
-
-      In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-      value drawn from the distribution.
-  list of str
-      This is not a real return value.  It exists to test
-      anonymous return values.
-
-  Other Parameters
-  ----------------
-  spam : parrot
-      A parrot off its mortal coil.
-
-  Raises
-  ------
-  RuntimeError
-      Some error
-
-  Warns
-  -----
-  RuntimeWarning
-      Some warning
-
-  Warnings
-  --------
-  Certain warnings apply.
-
-  Notes
-  -----
-  Instead of specifying the full covariance matrix, popular
-  approximations include:
-
-    - Spherical covariance (`cov` is a multiple of the identity matrix)
-    - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-  This geometrical property can be seen in two dimensions by plotting
-  generated data-points:
-
-  >>> mean = [0,0]
-  >>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
-  >>> x,y = multivariate_normal(mean,cov,5000).T
-  >>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-  Note that the covariance matrix must be symmetric and non-negative
-  definite.
-
-  References
-  ----------
-  .. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-         Processes," 3rd ed., McGraw-Hill Companies, 1991
-  .. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-         2nd ed., Wiley, 2001.
-
-  See Also
-  --------
-  some, other, funcs
-  otherfunc : relationship
-
-  Examples
-  --------
-  >>> mean = (1,2)
-  >>> cov = [[1,0],[1,0]]
-  >>> x = multivariate_normal(mean,cov,(3,3))
-  >>> print x.shape
-  (3, 3, 2)
-
-  The following is probably true, given that 0.6 is roughly twice the
-  standard deviation:
-
-  >>> print list( (x[0,0,:] - mean) < 0.6 )
-  [True, True]
-
-  .. index:: random
-     :refguide: random;distributions, random;gauss
-
-  '''
-doc = NumpyDocString(doc_txt)
-
-
-def test_signature():
-    assert doc['Signature'].startswith('numpy.multivariate_normal(')
-    assert doc['Signature'].endswith('spam=None)')
-
-def test_summary():
-    assert doc['Summary'][0].startswith('Draw values')
-    assert doc['Summary'][-1].endswith('covariance.')
-
-def test_extended_summary():
-    assert doc['Extended Summary'][0].startswith('The multivariate normal')
-
-def test_parameters():
-    assert len(doc['Parameters']) == 3
-    assert [n for n,_,_ in doc['Parameters']] == ['mean','cov','shape']
-
-    arg, arg_type, desc = doc['Parameters'][1]
-    assert arg_type == '(N, N) ndarray'
-    assert desc[0].startswith('Covariance matrix')
-    assert doc['Parameters'][0][-1][-2] == '   (1+2+3)/3'
-
-def test_other_parameters():
-    assert len(doc['Other Parameters']) == 1
-    assert [n for n,_,_ in doc['Other Parameters']] == ['spam']
-    arg, arg_type, desc = doc['Other Parameters'][0]
-    assert arg_type == 'parrot'
-    assert desc[0].startswith('A parrot off its mortal coil')
-
-def test_returns():
-    assert len(doc['Returns']) == 2
-    arg, arg_type, desc = doc['Returns'][0]
-    assert arg == 'out'
-    assert arg_type == 'ndarray'
-    assert desc[0].startswith('The drawn samples')
-    assert desc[-1].endswith('distribution.')
-
-    arg, arg_type, desc = doc['Returns'][1]
-    assert arg == 'list of str'
-    assert arg_type == ''
-    assert desc[0].startswith('This is not a real')
-    assert desc[-1].endswith('anonymous return values.')
-
-def test_notes():
-    assert doc['Notes'][0].startswith('Instead')
-    assert doc['Notes'][-1].endswith('definite.')
-    assert len(doc['Notes']) == 17
-
-def test_references():
-    assert doc['References'][0].startswith('..')
-    assert doc['References'][-1].endswith('2001.')
-
-def test_examples():
-    assert doc['Examples'][0].startswith('>>>')
-    assert doc['Examples'][-1].endswith('True]')
-
-def test_index():
-    assert doc['index']['default'] == 'random'
-    assert len(doc['index']) == 2
-    assert len(doc['index']['refguide']) == 2
-
-def non_blank_line_by_line_compare(a,b):
-    a = textwrap.dedent(a)
-    b = textwrap.dedent(b)
-    a = [l.rstrip() for l in a.split('\n') if l.strip()]
-    b = [l.rstrip() for l in b.split('\n') if l.strip()]
-    for n,line in enumerate(a):
-        if not line == b[n]:
-            raise AssertionError("Lines %s of a and b differ: "
-                                 "\n>>> %s\n<<< %s\n" %
-                                 (n,line,b[n]))
-def test_str():
-    non_blank_line_by_line_compare(str(doc),
-"""numpy.multivariate_normal(mean, cov, shape=None, spam=None)
-
-Draw values from a multivariate normal distribution with specified
-mean and covariance.
-
-The multivariate normal or Gaussian distribution is a generalisation
-of the one-dimensional normal distribution to higher dimensions.
-
-Parameters
-----------
-mean : (N,) ndarray
-    Mean of the N-dimensional distribution.
-
-    .. math::
-
-       (1+2+3)/3
-
-cov : (N, N) ndarray
-    Covariance matrix of the distribution.
-shape : tuple of ints
-    Given a shape of, for example, (m,n,k), m*n*k samples are
-    generated, and packed in an m-by-n-by-k arrangement.  Because
-    each sample is N-dimensional, the output shape is (m,n,k,N).
-
-Returns
--------
-out : ndarray
-    The drawn samples, arranged according to `shape`.  If the
-    shape given is (m,n,...), then the shape of `out` is is
-    (m,n,...,N).
-
-    In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-    value drawn from the distribution.
-list of str
-    This is not a real return value.  It exists to test
-    anonymous return values.
-
-Other Parameters
-----------------
-spam : parrot
-    A parrot off its mortal coil.
-
-Raises
-------
-RuntimeError
-    Some error
-
-Warns
------
-RuntimeWarning
-    Some warning
-
-Warnings
---------
-Certain warnings apply.
-
-See Also
---------
-`some`_, `other`_, `funcs`_
-
-`otherfunc`_
-    relationship
-
-Notes
------
-Instead of specifying the full covariance matrix, popular
-approximations include:
-
-  - Spherical covariance (`cov` is a multiple of the identity matrix)
-  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-This geometrical property can be seen in two dimensions by plotting
-generated data-points:
-
->>> mean = [0,0]
->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
->>> x,y = multivariate_normal(mean,cov,5000).T
->>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-Note that the covariance matrix must be symmetric and non-negative
-definite.
-
-References
-----------
-.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-       Processes," 3rd ed., McGraw-Hill Companies, 1991
-.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-       2nd ed., Wiley, 2001.
-
-Examples
---------
->>> mean = (1,2)
->>> cov = [[1,0],[1,0]]
->>> x = multivariate_normal(mean,cov,(3,3))
->>> print x.shape
-(3, 3, 2)
-
-The following is probably true, given that 0.6 is roughly twice the
-standard deviation:
-
->>> print list( (x[0,0,:] - mean) < 0.6 )
-[True, True]
-
-.. index:: random
-   :refguide: random;distributions, random;gauss""")
-
-
-def test_sphinx_str():
-    sphinx_doc = SphinxDocString(doc_txt)
-    non_blank_line_by_line_compare(str(sphinx_doc),
-"""
-.. index:: random
-   single: random;distributions, random;gauss
-
-Draw values from a multivariate normal distribution with specified
-mean and covariance.
-
-The multivariate normal or Gaussian distribution is a generalisation
-of the one-dimensional normal distribution to higher dimensions.
-
-:Parameters:
-
-    **mean** : (N,) ndarray
-
-        Mean of the N-dimensional distribution.
-
-        .. math::
-
-           (1+2+3)/3
-
-    **cov** : (N, N) ndarray
-
-        Covariance matrix of the distribution.
-
-    **shape** : tuple of ints
-
-        Given a shape of, for example, (m,n,k), m*n*k samples are
-        generated, and packed in an m-by-n-by-k arrangement.  Because
-        each sample is N-dimensional, the output shape is (m,n,k,N).
-
-:Returns:
-
-    **out** : ndarray
-
-        The drawn samples, arranged according to `shape`.  If the
-        shape given is (m,n,...), then the shape of `out` is is
-        (m,n,...,N).
-
-        In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-        value drawn from the distribution.
-
-    list of str
-
-        This is not a real return value.  It exists to test
-        anonymous return values.
-
-:Other Parameters:
-
-    **spam** : parrot
-
-        A parrot off its mortal coil.
-
-:Raises:
-
-    **RuntimeError**
-
-        Some error
-
-:Warns:
-
-    **RuntimeWarning**
-
-        Some warning
-
-.. warning::
-
-    Certain warnings apply.
-
-.. seealso::
-
-    :obj:`some`, :obj:`other`, :obj:`funcs`
-
-    :obj:`otherfunc`
-        relationship
-
-.. rubric:: Notes
-
-Instead of specifying the full covariance matrix, popular
-approximations include:
-
-  - Spherical covariance (`cov` is a multiple of the identity matrix)
-  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-This geometrical property can be seen in two dimensions by plotting
-generated data-points:
-
->>> mean = [0,0]
->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
->>> x,y = multivariate_normal(mean,cov,5000).T
->>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-Note that the covariance matrix must be symmetric and non-negative
-definite.
-
-.. rubric:: References
-
-.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-       Processes," 3rd ed., McGraw-Hill Companies, 1991
-.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-       2nd ed., Wiley, 2001.
-
-.. only:: latex
-
-   [1]_, [2]_
-
-.. rubric:: Examples
-
->>> mean = (1,2)
->>> cov = [[1,0],[1,0]]
->>> x = multivariate_normal(mean,cov,(3,3))
->>> print x.shape
-(3, 3, 2)
-
-The following is probably true, given that 0.6 is roughly twice the
-standard deviation:
-
->>> print list( (x[0,0,:] - mean) < 0.6 )
-[True, True]
-""")
-
-
-doc2 = NumpyDocString("""
-    Returns array of indices of the maximum values of along the given axis.
-
-    Parameters
-    ----------
-    a : {array_like}
-        Array to look in.
-    axis : {None, integer}
-        If None, the index is into the flattened array, otherwise along
-        the specified axis""")
-
-def test_parameters_without_extended_description():
-    assert len(doc2['Parameters']) == 2
-
-doc3 = NumpyDocString("""
-    my_signature(*params, **kwds)
-
-    Return this and that.
-    """)
-
-def test_escape_stars():
-    signature = str(doc3).split('\n')[0]
-    signature == 'my_signature(\*params, \*\*kwds)'
-
-doc4 = NumpyDocString(
-    """a.conj()
-
-    Return an array with all complex-valued elements conjugated.""")
-
-def test_empty_extended_summary():
-    assert doc4['Extended Summary'] == []
-
-doc5 = NumpyDocString(
-    """
-    a.something()
-
-    Raises
-    ------
-    LinAlgException
-        If array is singular.
-
-    Warns
-    -----
-    SomeWarning
-        If needed
-    """)
-
-def test_raises():
-    assert len(doc5['Raises']) == 1
-    name,_,desc = doc5['Raises'][0]
-    assert name == 'LinAlgException'
-    assert desc == ['If array is singular.']
-
-def test_warns():
-    assert len(doc5['Warns']) == 1
-    name,_,desc = doc5['Warns'][0]
-    assert name == 'SomeWarning'
-    assert desc == ['If needed']
-
-def test_see_also():
-    doc6 = NumpyDocString(
-    """
-    z(x,theta)
-
-    See Also
-    --------
-    func_a, func_b, func_c
-    func_d : some equivalent func
-    foo.func_e : some other func over
-             multiple lines
-    func_f, func_g, :meth:`func_h`, func_j,
-    func_k
-    :obj:`baz.obj_q`
-    :class:`class_j`: fubar
-        foobar
-    """)
-
-    assert len(doc6['See Also']) == 12
-    for func, desc, role in doc6['See Also']:
-        if func in ('func_a', 'func_b', 'func_c', 'func_f',
-                    'func_g', 'func_h', 'func_j', 'func_k', 'baz.obj_q'):
-            assert(not desc)
-        else:
-            assert(desc)
-
-        if func == 'func_h':
-            assert role == 'meth'
-        elif func == 'baz.obj_q':
-            assert role == 'obj'
-        elif func == 'class_j':
-            assert role == 'class'
-        else:
-            assert role is None
-
-        if func == 'func_d':
-            assert desc == ['some equivalent func']
-        elif func == 'foo.func_e':
-            assert desc == ['some other func over', 'multiple lines']
-        elif func == 'class_j':
-            assert desc == ['fubar', 'foobar']
-
-def test_see_also_print():
-    class Dummy(object):
-        """
-        See Also
-        --------
-        func_a, func_b
-        func_c : some relationship
-                 goes here
-        func_d
-        """
-        pass
-
-    obj = Dummy()
-    s = str(FunctionDoc(obj, role='func'))
-    assert(':func:`func_a`, :func:`func_b`' in s)
-    assert('    some relationship' in s)
-    assert(':func:`func_d`' in s)
-
-doc7 = NumpyDocString("""
-
-        Doc starts on second line.
-
-        """)
-
-def test_empty_first_line():
-    assert doc7['Summary'][0].startswith('Doc starts')
-
-
-def test_no_summary():
-    str(SphinxDocString("""
-    Parameters
-    ----------"""))
-
-
-def test_unicode():
-    doc = SphinxDocString("""
-    öäöäöäöäöåååå
-
-    öäöäöäööäååå
-
-    Parameters
-    ----------
-    ååå : äää
-        ööö
-
-    Returns
-    -------
-    ååå : ööö
-        äää
-
-    """)
-    assert isinstance(doc['Summary'][0], str)
-    assert doc['Summary'][0] == 'öäöäöäöäöåååå'
-
-def test_plot_examples():
-    cfg = dict(use_plots=True)
-
-    doc = SphinxDocString("""
-    Examples
-    --------
-    >>> import matplotlib.pyplot as plt
-    >>> plt.plot([1,2,3],[4,5,6])
-    >>> plt.show()
-    """, config=cfg)
-    assert 'plot::' in str(doc), str(doc)
-
-    doc = SphinxDocString("""
-    Examples
-    --------
-    .. plot::
-
-       import matplotlib.pyplot as plt
-       plt.plot([1,2,3],[4,5,6])
-       plt.show()
-    """, config=cfg)
-    assert str(doc).count('plot::') == 1, str(doc)
-
-def test_class_members():
-
-    class Dummy(object):
-        """
-        Dummy class.
-
-        """
-        def spam(self, a, b):
-            """Spam\n\nSpam spam."""
-            pass
-        def ham(self, c, d):
-            """Cheese\n\nNo cheese."""
-            pass
-        @property
-        def spammity(self):
-            """Spammity index"""
-            return 0.95
-
-        class Ignorable(object):
-            """local class, to be ignored"""
-            pass
-
-    for cls in (ClassDoc, SphinxClassDoc):
-        doc = cls(Dummy, config=dict(show_class_members=False))
-        assert 'Methods' not in str(doc), (cls, str(doc))
-        assert 'spam' not in str(doc), (cls, str(doc))
-        assert 'ham' not in str(doc), (cls, str(doc))
-        assert 'spammity' not in str(doc), (cls, str(doc))
-        assert 'Spammity index' not in str(doc), (cls, str(doc))
-
-        doc = cls(Dummy, config=dict(show_class_members=True))
-        assert 'Methods' in str(doc), (cls, str(doc))
-        assert 'spam' in str(doc), (cls, str(doc))
-        assert 'ham' in str(doc), (cls, str(doc))
-        assert 'spammity' in str(doc), (cls, str(doc))
-
-        if cls is SphinxClassDoc:
-            assert '.. autosummary::' in str(doc), str(doc)
-        else:
-            assert 'Spammity index' in str(doc), str(doc)
-
-def test_duplicate_signature():
-    # Duplicate function signatures occur e.g. in ufuncs, when the
-    # automatic mechanism adds one, and a more detailed comes from the
-    # docstring itself.
-
-    doc = NumpyDocString(
-    """
-    z(x1, x2)
-
-    z(a, theta)
-    """)
-
-    assert doc['Signature'].strip() == 'z(a, theta)'
-
-
-class_doc_txt = """
-    Foo
-
-    Parameters
-    ----------
-    f : callable ``f(t, y, *f_args)``
-        Aaa.
-    jac : callable ``jac(t, y, *jac_args)``
-        Bbb.
-
-    Attributes
-    ----------
-    t : float
-        Current time.
-    y : ndarray
-        Current variable values.
-
-    Methods
-    -------
-    a
-    b
-    c
-
-    Examples
-    --------
-    For usage examples, see `ode`.
-"""
-
-def test_class_members_doc():
-    doc = ClassDoc(None, class_doc_txt)
-    non_blank_line_by_line_compare(str(doc),
-    """
-    Foo
-
-    Parameters
-    ----------
-    f : callable ``f(t, y, *f_args)``
-        Aaa.
-    jac : callable ``jac(t, y, *jac_args)``
-        Bbb.
-
-    Examples
-    --------
-    For usage examples, see `ode`.
-
-    Attributes
-    ----------
-    t : float
-        Current time.
-    y : ndarray
-        Current variable values.
-
-    Methods
-    -------
-    a
-
-    b
-
-    c
-
-    .. index::
-
-    """)
-
-def test_class_members_doc_sphinx():
-    doc = SphinxClassDoc(None, class_doc_txt)
-    non_blank_line_by_line_compare(str(doc),
-    """
-    Foo
-
-    :Parameters:
-
-        **f** : callable ``f(t, y, *f_args)``
-
-            Aaa.
-
-        **jac** : callable ``jac(t, y, *jac_args)``
-
-            Bbb.
-
-    .. rubric:: Examples
-
-    For usage examples, see `ode`.
-
-    .. rubric:: Attributes
-
-    ===  ==========
-      t  (float) Current time.
-      y  (ndarray) Current variable values.
-    ===  ==========
-
-    .. rubric:: Methods
-
-    ===  ==========
-      a
-      b
-      c
-    ===  ==========
-
-    """)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_utils.py b/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_utils.py
deleted file mode 100644
index 8f1a9dd..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tests/test_utils.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#namedtuple is needed for find_mod_objs so it can have a non-local module
-
-import sys
-from collections import namedtuple
-
-import pytest
-
-from ..utils import find_mod_objs
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-
-def test_find_mod_objs():
-    lnms, fqns, objs = find_mod_objs('astropy_helpers')
-
-    # this import  is after the above call intentionally to make sure
-    # find_mod_objs properly imports astropy on its own
-    import astropy_helpers
-
-    # just check for astropy.test ... other things might be added, so we
-    # shouldn't check that it's the only thing
-    assert lnms == []
-
-    lnms, fqns, objs = find_mod_objs(
-        'astropy_helpers.sphinx.ext.tests.test_utils', onlylocals=False)
-
-    assert namedtuple in objs
-
-    lnms, fqns, objs = find_mod_objs(
-        'astropy_helpers.sphinx.ext.tests.test_utils', onlylocals=True)
-    assert 'namedtuple' not in lnms
-    assert 'collections.namedtuple' not in fqns
-    assert namedtuple not in objs
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/tocdepthfix.py b/astropy_helpers/astropy_helpers/sphinx/ext/tocdepthfix.py
deleted file mode 100644
index be29478..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/tocdepthfix.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from sphinx import addnodes
-
-
-def fix_toc_entries(app, doctree):
-    # Get the docname; I don't know why this isn't just passed in to the
-    # callback
-    # This seems a bit unreliable as it's undocumented, but it's not "private"
-    # either:
-    docname = app.builder.env.temp_data['docname']
-    if app.builder.env.metadata[docname].get('tocdepth', 0) != 0:
-        # We need to reprocess any TOC nodes in the doctree and make sure all
-        # the files listed in any TOCs are noted
-        for treenode in doctree.traverse(addnodes.toctree):
-            app.builder.env.note_toctree(docname, treenode)
-
-
-def setup(app):
-    app.connect('doctree-read', fix_toc_entries)
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/traitsdoc.py b/astropy_helpers/astropy_helpers/sphinx/ext/traitsdoc.py
deleted file mode 100644
index 596c54e..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/traitsdoc.py
+++ /dev/null
@@ -1,142 +0,0 @@
-"""
-=========
-traitsdoc
-=========
-
-Sphinx extension that handles docstrings in the Numpy standard format, [1]
-and support Traits [2].
-
-This extension can be used as a replacement for ``numpydoc`` when support
-for Traits is required.
-
-.. [1] http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
-.. [2] http://code.enthought.com/projects/traits/
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import inspect
-import os
-import pydoc
-import collections
-
-from . import docscrape
-from . import docscrape_sphinx
-from .docscrape_sphinx import SphinxClassDoc, SphinxFunctionDoc, SphinxDocString
-
-from . import numpydoc
-
-from . import comment_eater
-
-class SphinxTraitsDoc(SphinxClassDoc):
-    def __init__(self, cls, modulename='', func_doc=SphinxFunctionDoc):
-        if not inspect.isclass(cls):
-            raise ValueError("Initialise using a class. Got %r" % cls)
-        self._cls = cls
-
-        if modulename and not modulename.endswith('.'):
-            modulename += '.'
-        self._mod = modulename
-        self._name = cls.__name__
-        self._func_doc = func_doc
-
-        docstring = pydoc.getdoc(cls)
-        docstring = docstring.split('\n')
-
-        # De-indent paragraph
-        try:
-            indent = min(len(s) - len(s.lstrip()) for s in docstring
-                         if s.strip())
-        except ValueError:
-            indent = 0
-
-        for n,line in enumerate(docstring):
-            docstring[n] = docstring[n][indent:]
-
-        self._doc = docscrape.Reader(docstring)
-        self._parsed_data = {
-            'Signature': '',
-            'Summary': '',
-            'Description': [],
-            'Extended Summary': [],
-            'Parameters': [],
-            'Returns': [],
-            'Raises': [],
-            'Warns': [],
-            'Other Parameters': [],
-            'Traits': [],
-            'Methods': [],
-            'See Also': [],
-            'Notes': [],
-            'References': '',
-            'Example': '',
-            'Examples': '',
-            'index': {}
-            }
-
-        self._parse()
-
-    def _str_summary(self):
-        return self['Summary'] + ['']
-
-    def _str_extended_summary(self):
-        return self['Description'] + self['Extended Summary'] + ['']
-
-    def __str__(self, indent=0, func_role="func"):
-        out = []
-        out += self._str_signature()
-        out += self._str_index() + ['']
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        for param_list in ('Parameters', 'Traits', 'Methods',
-                           'Returns','Raises'):
-            out += self._str_param_list(param_list)
-        out += self._str_see_also("obj")
-        out += self._str_section('Notes')
-        out += self._str_references()
-        out += self._str_section('Example')
-        out += self._str_section('Examples')
-        out = self._str_indent(out,indent)
-        return '\n'.join(out)
-
-def looks_like_issubclass(obj, classname):
-    """ Return True if the object has a class or superclass with the given class
-    name.
-
-    Ignores old-style classes.
-    """
-    t = obj
-    if t.__name__ == classname:
-        return True
-    for klass in t.__mro__:
-        if klass.__name__ == classname:
-            return True
-    return False
-
-def get_doc_object(obj, what=None, config=None):
-    if what is None:
-        if inspect.isclass(obj):
-            what = 'class'
-        elif inspect.ismodule(obj):
-            what = 'module'
-        elif isinstance(obj, collections.Callable):
-            what = 'function'
-        else:
-            what = 'object'
-    if what == 'class':
-        doc = SphinxTraitsDoc(obj, '', func_doc=SphinxFunctionDoc, config=config)
-        if looks_like_issubclass(obj, 'HasTraits'):
-            for name, trait, comment in comment_eater.get_class_traits(obj):
-                # Exclude private traits.
-                if not name.startswith('_'):
-                    doc['Traits'].append((name, trait, comment.splitlines()))
-        return doc
-    elif what in ('function', 'method'):
-        return SphinxFunctionDoc(obj, '', config=config)
-    else:
-        return SphinxDocString(pydoc.getdoc(obj), config=config)
-
-def setup(app):
-    # init numpydoc
-    numpydoc.setup(app, get_doc_object)
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/utils.py b/astropy_helpers/astropy_helpers/sphinx/ext/utils.py
deleted file mode 100644
index 2a06c83..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/utils.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import inspect
-import sys
-
-
-def find_mod_objs(modname, onlylocals=False):
-    """ Returns all the public attributes of a module referenced by name.
-
-    .. note::
-        The returned list *not* include subpackages or modules of
-        `modname`,nor does it include private attributes (those that
-        beginwith '_' or are not in `__all__`).
-
-    Parameters
-    ----------
-    modname : str
-        The name of the module to search.
-    onlylocals : bool
-        If True, only attributes that are either members of `modname` OR one of
-        its modules or subpackages will be included.
-
-    Returns
-    -------
-    localnames : list of str
-        A list of the names of the attributes as they are named in the
-        module `modname` .
-    fqnames : list of str
-        A list of the full qualified names of the attributes (e.g.,
-        ``astropy.utils.misc.find_mod_objs``). For attributes that are
-        simple variables, this is based on the local name, but for
-        functions or classes it can be different if they are actually
-        defined elsewhere and just referenced in `modname`.
-    objs : list of objects
-        A list of the actual attributes themselves (in the same order as
-        the other arguments)
-
-    """
-
-    __import__(modname)
-    mod = sys.modules[modname]
-
-    if hasattr(mod, '__all__'):
-        pkgitems = [(k, mod.__dict__[k]) for k in mod.__all__]
-    else:
-        pkgitems = [(k, mod.__dict__[k]) for k in dir(mod) if k[0] != '_']
-
-    # filter out modules and pull the names and objs out
-    ismodule = inspect.ismodule
-    localnames = [k for k, v in pkgitems if not ismodule(v)]
-    objs = [v for k, v in pkgitems if not ismodule(v)]
-
-    # fully qualified names can be determined from the object's module
-    fqnames = []
-    for obj, lnm in zip(objs, localnames):
-        if hasattr(obj, '__module__') and hasattr(obj, '__name__'):
-            fqnames.append(obj.__module__ + '.' + obj.__name__)
-        else:
-            fqnames.append(modname + '.' + lnm)
-
-    if onlylocals:
-        valids = [fqn.startswith(modname) for fqn in fqnames]
-        localnames = [e for i, e in enumerate(localnames) if valids[i]]
-        fqnames = [e for i, e in enumerate(fqnames) if valids[i]]
-        objs = [e for i, e in enumerate(objs) if valids[i]]
-
-    return localnames, fqnames, objs
diff --git a/astropy_helpers/astropy_helpers/sphinx/ext/viewcode.py b/astropy_helpers/astropy_helpers/sphinx/ext/viewcode.py
deleted file mode 100644
index 1d657b8..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/ext/viewcode.py
+++ /dev/null
@@ -1,216 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    sphinx.ext.viewcode
-    ~~~~~~~~~~~~~~~~~~~
-
-    Add links to module code in Python object descriptions.
-
-    :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
-    :license: BSD, see LICENSE for details.
-
-    Patched using patch in https://bitbucket.org/birkenfeld/sphinx/issue/623/extension-viewcode-fails-with-function on 21 Aug 2013 by Kyle H Barbary
-"""
-
-from docutils import nodes
-
-from sphinx import addnodes
-from sphinx.locale import _
-from sphinx.pycode import ModuleAnalyzer
-from sphinx.util.nodes import make_refnode
-
-import sys
-import traceback
-
-if sys.version < '3':
-    text_type = unicode
-else:
-    text_type = str
-
-def doctree_read(app, doctree):
-    env = app.builder.env
-    if not hasattr(env, '_viewcode_modules'):
-        env._viewcode_modules = {}
- 
-    def get_full_modname(modname, attribute):
-        try:
-            __import__(modname)
-        except Exception as error:
-            if not app.quiet:
-                app.info(traceback.format_exc().rstrip())
-            app.warn('viewcode can\'t import %s, failed with error "%s"' %
-                (modname, error))
-            return None
-        module = sys.modules[modname]
-        try:
-            # Allow an attribute to have multiple parts and incidentially allow
-            # repeated .s in the attribute.
-            attr = attribute.split('.')
-            value = module
-            for attr in attribute.split('.'):
-                if attr:
-                    value = getattr(value, attr)
-        except AttributeError:
-            app.warn('Didn\'t find %s in %s' % (attribute, module.__name__))
-            return None
-        else:
-            return getattr(value, '__module__', None)
-
-
-    def has_tag(modname, fullname, docname, refname):
-        entry = env._viewcode_modules.get(modname, None)
-        if entry is None:
-            try:
-                analyzer = ModuleAnalyzer.for_module(modname)
-            except Exception:
-                env._viewcode_modules[modname] = False
-                return
-            analyzer.find_tags()
-            if not isinstance(analyzer.code, text_type):
-                code = analyzer.code.decode(analyzer.encoding)
-            else:
-                code = analyzer.code
-            entry = code, analyzer.tags, {}, refname
-            env._viewcode_modules[modname] = entry
-        elif entry is False:
-            return
-        _, tags, used, _ = entry
-        if fullname in tags:
-            used[fullname] = docname
-            return True
-
-
-    for objnode in doctree.traverse(addnodes.desc):
-        if objnode.get('domain') != 'py':
-            continue
-        names = set()
-        for signode in objnode:
-            if not isinstance(signode, addnodes.desc_signature):
-                continue
-            modname = signode.get('module')
-            fullname = signode.get('fullname')
-            refname = modname
-            if env.config.viewcode_import:
-                modname = get_full_modname(modname, fullname)
-            if not modname:
-                continue
-            if not has_tag(modname, fullname, env.docname, refname):
-                continue
-            if fullname in names:
-                # only one link per name, please
-                continue
-            names.add(fullname)
-            pagename = '_modules/' + modname.replace('.', '/')
-            onlynode = addnodes.only(expr='html')
-            onlynode += addnodes.pending_xref(
-                '', reftype='viewcode', refdomain='std', refexplicit=False,
-                reftarget=pagename, refid=fullname,
-                refdoc=env.docname)
-            onlynode[0] += nodes.inline('', _('[source]'),
-                                        classes=['viewcode-link'])
-            signode += onlynode
-
-
-def missing_reference(app, env, node, contnode):
-    # resolve our "viewcode" reference nodes -- they need special treatment
-    if node['reftype'] == 'viewcode':
-        return make_refnode(app.builder, node['refdoc'], node['reftarget'],
-                            node['refid'], contnode)
-
-
-def collect_pages(app):
-    env = app.builder.env
-    if not hasattr(env, '_viewcode_modules'):
-        return
-    highlighter = app.builder.highlighter
-    urito = app.builder.get_relative_uri
-
-    modnames = set(env._viewcode_modules)
-
-    app.builder.info(' (%d module code pages)' %
-                     len(env._viewcode_modules), nonl=1)
-
-    for modname, entry in env._viewcode_modules.iteritems():
-        if not entry:
-            continue
-        code, tags, used, refname = entry
-        # construct a page name for the highlighted source
-        pagename = '_modules/' + modname.replace('.', '/')
-        # highlight the source using the builder's highlighter
-        highlighted = highlighter.highlight_block(code, 'python', linenos=False)
-        # split the code into lines
-        lines = highlighted.splitlines()
-        # split off wrap markup from the first line of the actual code
-        before, after = lines[0].split('<pre>')
-        lines[0:1] = [before + '<pre>', after]
-        # nothing to do for the last line; it always starts with </pre> anyway
-        # now that we have code lines (starting at index 1), insert anchors for
-        # the collected tags (HACK: this only works if the tag boundaries are
-        # properly nested!)
-        maxindex = len(lines) - 1
-        for name, docname in used.iteritems():
-            type, start, end = tags[name]
-            backlink = urito(pagename, docname) + '#' + refname + '.' + name
-            lines[start] = (
-                '<div class="viewcode-block" id="%s"><a class="viewcode-back" '
-                'href="%s">%s</a>' % (name, backlink, _('[docs]'))
-                + lines[start])
-            lines[min(end - 1, maxindex)] += '</div>'
-        # try to find parents (for submodules)
-        parents = []
-        parent = modname
-        while '.' in parent:
-            parent = parent.rsplit('.', 1)[0]
-            if parent in modnames:
-                parents.append({
-                    'link': urito(pagename, '_modules/' +
-                                  parent.replace('.', '/')),
-                    'title': parent})
-        parents.append({'link': urito(pagename, '_modules/index'),
-                        'title': _('Module code')})
-        parents.reverse()
-        # putting it all together
-        context = {
-            'parents': parents,
-            'title': modname,
-            'body': _('<h1>Source code for %s</h1>') % modname + \
-                    '\n'.join(lines)
-        }
-        yield (pagename, context, 'page.html')
-
-    if not modnames:
-        return
-
-    app.builder.info(' _modules/index')
-    html = ['\n']
-    # the stack logic is needed for using nested lists for submodules
-    stack = ['']
-    for modname in sorted(modnames):
-        if modname.startswith(stack[-1]):
-            stack.append(modname + '.')
-            html.append('<ul>')
-        else:
-            stack.pop()
-            while not modname.startswith(stack[-1]):
-                stack.pop()
-                html.append('</ul>')
-            stack.append(modname + '.')
-        html.append('<li><a href="%s">%s</a></li>\n' % (
-            urito('_modules/index', '_modules/' + modname.replace('.', '/')),
-            modname))
-    html.append('</ul>' * (len(stack) - 1))
-    context = {
-        'title': _('Overview: module code'),
-        'body': _('<h1>All modules for which code is available</h1>') + \
-            ''.join(html),
-    }
-
-    yield ('_modules/index', context, 'page.html')
-
-
-def setup(app):
-    app.add_config_value('viewcode_import', True, False)
-    app.connect('doctree-read', doctree_read)
-    app.connect('html-collect-pages', collect_pages)
-    app.connect('missing-reference', missing_reference)
-    #app.add_config_value('viewcode_include_modules', [], 'env')
-    #app.add_config_value('viewcode_exclude_modules', [], 'env')
diff --git a/astropy_helpers/astropy_helpers/sphinx/local/python3links.inv b/astropy_helpers/astropy_helpers/sphinx/local/python3links.inv
deleted file mode 100644
index c9cbcd4..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/local/python3links.inv
+++ /dev/null
@@ -1,7 +0,0 @@
-# Sphinx inventory version 2
-# Project: Python
-# Version: 3.4
-# The remainder of this file is compressed using zlib.
-x�����0
��{
-/z،W�x���Yflص	��0� 	��-����
�O��\��T9��Sb�
3쎟�W%�f�V�{U�cJ
Qh54��8�BR��	�66��yJ���-F�#
-���I�G׀]k���j� �vV3"XR#xu	{�:��-��!{\�3i
�i
�?�"F)��2�۰F��}P�Q)�,�'�>����7
\ No newline at end of file
diff --git a/astropy_helpers/astropy_helpers/sphinx/local/python3links.txt b/astropy_helpers/astropy_helpers/sphinx/local/python3links.txt
deleted file mode 100644
index 269fcfe..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/local/python3links.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# Sphinx inventory version 2
-# Project: Python
-# Version: 3.4
-# The remainder of this file should be compressed using zlib.
-bytes py:function -1 library/functions.html#bytes -
-TimeoutError py:exception -1 library/exceptions.html#TimeoutError -
-object py:function -1 library/functions.html#object -
-object py:class -1 library/functions.html#object -
-urllib.request.urlopen py:function -1 library/urllib.request.html#urllib.request.urlopen -
-concurrent.futures.Future py:class -1 library/concurrent.futures.html#concurrent.futures.Future -
-concurrent.futures.ThreadPoolExecutor py:class -1 library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor -
-queue.Queue py:class -1 library/queue.html#queue.Queue -
-print() py:function -1 library/functions.html#print -
diff --git a/astropy_helpers/astropy_helpers/sphinx/setup_package.py b/astropy_helpers/astropy_helpers/sphinx/setup_package.py
deleted file mode 100644
index f9d0579..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/setup_package.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-def get_package_data():
-    # Install the theme files
-    return {
-        'astropy_helpers.sphinx': [
-            'ext/templates/*/*',
-            'local/*.inv',
-            'themes/bootstrap-astropy/*.*',
-            'themes/bootstrap-astropy/static/*.*']}
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
deleted file mode 100644
index 3bd8404..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>Table of Contents</h3>
-{{ toctree(maxdepth=-1, titles_only=true) }}
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
deleted file mode 100644
index 40b0da4..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
+++ /dev/null
@@ -1,96 +0,0 @@
-{% extends "basic/layout.html" %}
-
-{# Collapsible sidebar script from default/layout.html in Sphinx #}
-{% set script_files = script_files + ['_static/sidebar.js'] %}
-
-{# Add the google webfonts needed for the logo #}
-{% block extrahead %}
-<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600' rel='stylesheet' type='text/css'>
-{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
-
-{% endblock %}
-
-
-{% block header %}
-<div class="topbar">
-  <a class="brand" title="{{ _('Documentation Home') }}" href="{{ pathto(master_doc) }}"><span id="logotext1">{{ theme_logotext1 }}</span><span id="logotext2">{{ theme_logotext2 }}</span><span id="logotext3">{{ theme_logotext3 }}</span></a>
-  <ul>
-    <li><a class="homelink" title="Astropy Homepage" href="http://www.astropy.org"></a></li>
-    <li><a title="{{ _('General Index') }}" href="{{ pathto('genindex') }}">Index</a></li>
-    <li><a title="{{ _('Module Index') }}" href="{{ pathto('py-modindex') }}">Modules</a></li>
-    <li>
-      {% block sidebarsearch %}
-      {% include "searchbox.html" %}
-      {% endblock %}
-    </li>
-  </ul>
-</div>
-{% endblock %}
-
-{% block relbar1 %}
-<div class="related">
-    <h3>{{ _('Navigation') }}</h3>
-    <ul>
-      {%- if next %}
-      <li class="right">
-	<a href="{{ next.link|e }}" title="{{ next.title|striptags|e }}">
-	  next {{ "»"|safe }}
-	</a>
-      </li>
-      {%- endif %}
-      {%- if prev %}
-      <li class="right">
-	<a href="{{ prev.link|e }}" title="{{ prev.title|striptags|e }}">
-	  {{ "«"|safe }} previous
-	</a>
-	{% if next %}{{ reldelim2 }}{% endif %}
-      </li>
-      {%- endif %}
-      {%- block rootrellink %}
-      <li>
-	<a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
-	{{ reldelim1 }}
-      </li>
-      {%- endblock %}
-      {%- for parent in parents %}
-      <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
-      {%- endfor %}
-      {# Don't put the title in the relbar for the first (index) page. #}
-      {% if prev %}<li>{{ title }}</li>{% endif %}
-      {%- block relbaritems %} {% endblock %}
-    </ul>
-</div>
-{% endblock %}
-
-{# Silence the bottom relbar. #}
-{% block relbar2 %}{% endblock %}
-
-
-{%- block footer %}
-<footer class="footer">
-  <p class="pull-right">
-    {%- if edit_on_github %}
-    <a href="{{ edit_on_github }}">{{ edit_on_github_page_message }}</a>  
-    {%- endif %}
-    {%- if show_source and has_source and sourcename %}
-    <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
-       rel="nofollow">{{ _('Page Source') }}</a>
-    {%- endif %}  
-    <a href="#">Back to Top</a></p>
-  <p>
-    {%- if show_copyright %}
-    {%- if hasdoc('copyright') %}
-    {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
-    {%- else %}
-    {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}<br/>
-    {%- endif %}
-    {%- endif %}
-    {%- if show_sphinx %}
-    {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}  
-    {%- endif %}
-    {%- if last_updated %}
-    {% trans last_updated=last_updated|e %}Last built {{ last_updated }}.{% endtrans %} <br/>
-    {%- endif %}
-  </p>
-</footer>
-{%- endblock %}
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
deleted file mode 100644
index 0a21ad0..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>Page Contents</h3>
-{{ toc }}
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
deleted file mode 100644
index 0d17cc1..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{%- if pagename != "search" %}
-<form action="{{ pathto('search') }}" method="get">
-  <input type="text" name="q" placeholder="Search" />
-  <input type="hidden" name="check_keywords" value="yes" />
-  <input type="hidden" name="area" value="default" />
-</form>
-{%- endif %}
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
deleted file mode 100644
index 4322679..0000000
Binary files a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png and /dev/null differ
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
deleted file mode 100644
index c2bca3a..0000000
Binary files a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico and /dev/null differ
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
deleted file mode 100644
index fc3d930..0000000
Binary files a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png and /dev/null differ
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
deleted file mode 100644
index ba7fded..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
+++ /dev/null
@@ -1,585 +0,0 @@
-/*!
- * Bootstrap v1.4.0
- *
- * Copyright 2011 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Heavily modified by Kyle Barbary for the AstroPy Project for use with Sphinx.
- */
-
- at import url("basic.css");
-
-body {
-  background-color: #ffffff;
-  margin: 0;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-  color: #404040;
-}
-
-/* Hyperlinks ----------------------------------------------------------------*/
-
-a {
-  color: #0069d6;
-  text-decoration: none;
-  line-height: inherit;
-  font-weight: inherit;
-}
-
-a:hover {
-  color: #00438a;
-  text-decoration: underline;
-}
-
-/* Typography ----------------------------------------------------------------*/
-
-h1,h2,h3,h4,h5,h6 {
-  color: #404040;
-  margin: 0.7em 0 0 0;
-  line-height: 1.5em;
-}
-h1 {
-  font-size: 24px;
-  margin: 0;
-}
-h2 {
-  font-size: 21px;
-  line-height: 1.2em;
-  margin: 1em 0 0.5em 0;
-  border-bottom: 1px solid #404040;
-}
-h3 {
-  font-size: 18px;
-}
-h4 {
-  font-size: 16px;
-}
-h5 {
-  font-size: 14px;
-}
-h6 {
-  font-size: 13px;
-  text-transform: uppercase;
-}
-
-p {
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-  margin-top: 0px;
-  margin-bottom: 9px;
-}
-
-ul, ol {
-  margin-left: 0;
-  padding: 0 0 0 25px;
-}
-ul ul, ul ol, ol ol, ol ul {
-  margin-bottom: 0;
-}
-ul {
-  list-style: disc;
-}
-ol {
-  list-style: decimal;
-}
-li {
-  line-height: 18px;
-  color: #404040;
-}
-ul.unstyled {
-  list-style: none;
-  margin-left: 0;
-}
-dl {
-  margin-bottom: 18px;
-}
-dl dt, dl dd {
-  line-height: 18px;
-}
-dl dd {
-  margin-left: 9px;
-}
-hr {
-  margin: 20px 0 19px;
-  border: 0;
-  border-bottom: 1px solid #eee;
-}
-strong {
-  font-style: inherit;
-  font-weight: bold;
-}
-em {
-  font-style: italic;
-  font-weight: inherit;
-  line-height: inherit;
-}
-.muted {
-  color: #bfbfbf;
-}
-
-address {
-  display: block;
-  line-height: 18px;
-  margin-bottom: 18px;
-}
-code, pre {
-  padding: 0 3px 2px;
-  font-family: monospace;
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-}
-tt {
-  font-family: monospace;
-}
-code {
-  color: rgba(0, 0, 0, 0.75);
-  padding: 1px 3px;
-}
-pre {
-  display: block;
-  padding: 8.5px;
-  margin: 0 0 18px;
-  line-height: 18px;
-  border: 1px solid #ddd;
-  border: 1px solid rgba(0, 0, 0, 0.12);
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-  white-space: pre;
-  white-space: pre-wrap;
-  word-wrap: break-word;
-}
-
-img {
-  margin: 9px 0;
-}
-
-/* format inline code with a rounded box */
-tt {
-    margin: 0 2px;
-    padding: 0 5px;
-    border: 1px solid #ddd;
-    border: 1px solid rgba(0, 0, 0, 0.12);
-    border-radius: 3px;
-}
-
-/* all code has same box background color, even in headers */
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt, pre, code, tt {
-  background-color: #f8f8f8;
-}
-
-/* override box for links & other sphinx-specifc stuff */
-tt.xref, a tt, tt.descname, tt.descclassname {
-  padding: 0 1px 0 1px;
-  border: none;
-}
-
-/* override box for related bar at the top of the page */
-.related tt {
-  border: none;
-  padding: 0 1px 0 1px;
-  background-color: transparent;
-  font-weight: bold;
-}
-
-th {
-    background-color: #dddddd;
-}
-
-.viewcode-back {
-    font-family: sans-serif;
-}
-
-div.viewcode-block:target {
-    background-color: #f4debf;
-    border-top: 1px solid #ac9;
-    border-bottom: 1px solid #ac9;
-}
-
-table.docutils {
-    border-spacing: 5px;
-    border-collapse: separate;
-}
-
-/* Topbar --------------------------------------------------------------------*/
-
-div.topbar {
-  height: 40px;
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  z-index: 10000;
-  padding: 0px 10px;
-  background-color: #222;
-  background-color: #222222;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));
-  background-image: -moz-linear-gradient(top, #333333, #222222);
-  background-image: -ms-linear-gradient(top, #333333, #222222);
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));
-  background-image: -webkit-linear-gradient(top, #333333, #222222);
-  background-image: -o-linear-gradient(top, #333333, #222222);
-  background-image: linear-gradient(top, #333333, #222222);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
-}
-
-div.topbar a.brand {
-  font-family: 'Source Sans Pro', sans-serif;
-  font-size: 26px;
-  color: #ffffff;
-  font-weight: 600;
-  text-decoration: none;
-  float: left;
-  display: block;
-  height: 32px;
-  padding: 8px 12px 0px 45px;
-  margin-left: -10px;
-  background: transparent url("astropy_logo_32.png") no-repeat 10px 4px;
-}
-
-#logotext1 {
-}
-
-#logotext2 {
-    font-weight:200;
-    color: #ff5000;
-}
-#logotext3 {
-    font-weight:200;
-}
-
-div.topbar .brand:hover, div.topbar ul li a.homelink:hover {
-  background-color: #333;
-  background-color: rgba(255, 255, 255, 0.05);
-}
-
-div.topbar ul {
-    font-size: 110%;
-    list-style: none;
-    margin: 0;
-    padding: 0 0 0 10px;
-    float: right;
-    color: #bfbfbf;
-    text-align: center;
-    text-decoration: none;
-    height: 100%;
-}
-div.topbar ul li {
-    float: left;
-    display: inline;
-    height: 30px;
-    margin: 5px;
-    padding: 0px;
-}
-
-div.topbar ul li a {
-  color: #bfbfbf;
-  text-decoration: none;
-  padding: 5px;
-  display: block;
-  height: auto;
-  text-align: center;
-  vertical-align: middle;
-  border-radius: 4px;
-}
-
-div.topbar ul li a:hover {
-  color: #ffffff;
-  text-decoration: none;
-}
-
-div.topbar ul li a.homelink {
-  width: 112px;
-  display: block;
-  height: 20px;
-  padding: 5px 0px;
-  background: transparent url("astropy_linkout_20.png") no-repeat 10px 5px;
-}
-
-div.topbar form {
-  text-align: left;
-  margin: 0 0 0 5px;
-  position: relative;
-  filter: alpha(opacity=100);
-  -khtml-opacity: 1;
-  -moz-opacity: 1;
-  opacity: 1;
-}
-
-div.topbar input {
-  background-color: #444;
-  background-color: rgba(255, 255, 255, 0.3);
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: normal;
-  font-weight: 13px;
-  line-height: 1;
-  padding: 4px 9px;
-  color: #ffffff;
-  color: rgba(255, 255, 255, 0.75);
-  border: 1px solid #111;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  -webkit-transition: none;
-  -moz-transition: none;
-  -ms-transition: none;
-  -o-transition: none;
-  transition: none;
-}
-div.topbar input:-moz-placeholder {
-  color: #e6e6e6;
-}
-div.topbar input::-webkit-input-placeholder {
-  color: #e6e6e6;
-}
-div.topbar input:hover {
-  background-color: #bfbfbf;
-  background-color: rgba(255, 255, 255, 0.5);
-  color: #ffffff;
-}
-div.topbar input:focus, div.topbar input.focused {
-  outline: 0;
-  background-color: #ffffff;
-  color: #404040;
-  text-shadow: 0 1px 0 #ffffff;
-  border: 0;
-  padding: 5px 10px;
-  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-  -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-}
-
-
-/* Relation bar (breadcrumbs, prev, next) ------------------------------------*/
-
-div.related {
-    height: 21px;
-    width: auto;
-    margin: 0 10px;
-    position: absolute;
-    top: 42px;
-    clear: both;
-    left: 0;
-    right: 0;
-    z-index: 10000;
-    font-size: 100%;
-    vertical-align: middle;
-    background-color: #fff;
-    border-bottom: 1px solid #bbb;
-}
-div.related ul {
-    padding: 0;
-    margin: 0;
-}
-
-
-/* Footer --------------------------------------------------------------------*/
-
-footer {
-  display: block;
-  margin: 10px 10px 0px;
-  padding: 10px 0 0 0;
-  border-top: 1px solid #bbb;
-}
-.pull-right {
-  float: right;
-  width: 30em;
-  text-align: right;
-}
-
-
-/* Sphinx sidebar ------------------------------------------------------------*/
-
-div.sphinxsidebar {
-    font-size: inherit;
-    border-radius: 3px;
-    background-color: #eee;
-    border: 1px solid #bbb;
-}
-
-div.sphinxsidebarwrapper {
-    padding: 0px 0px 0px 5px;
-}
-
-div.sphinxsidebar h3 {
-    font-family: 'Trebuchet MS', sans-serif;
-    font-size: 1.4em;
-    font-weight: normal;
-    margin: 5px 0px 0px 5px;
-    padding: 0;
-    line-height: 1.6em;
-}
-div.sphinxsidebar h4 {
-    font-family: 'Trebuchet MS', sans-serif;
-    font-size: 1.3em;
-    font-weight: normal;
-    margin: 5px 0 0 0;
-    padding: 0;
-}
-div.sphinxsidebar p {
-}
-div.sphinxsidebar p.topless {
-    margin: 5px 10px 10px 10px;
-}
-div.sphinxsidebar ul {
-    margin: 0px 0px 0px 5px;
-    padding: 0;
-}
-
-div.sphinxsidebar ul ul {
-    margin-left: 15px;
-    list-style-type: disc;
-}
-
-/* If showing the global TOC (toctree),
-   color the current page differently */
-div.sphinxsidebar a.current {
-    color: #404040;
-}
-div.sphinxsidebar a.current:hover {
-    color: #404040;
-}
-
-
-/* document, documentwrapper, body, bodywrapper ----------------------------- */
-
-div.document {
-    margin-top: 72px;
-    margin-left: 10px;
-    margin-right: 10px;
-}
-
-div.documentwrapper {
-    float: left;
-    width: 100%;
-}
-
-div.body {
-    background-color: #ffffff;
-    padding: 0 0 0px 20px;
-}
-
-div.bodywrapper {
-    margin: 0 0 0 230px;
-    max-width: 55em;
-}
-
-
-/* Header links ------------------------------------------------------------- */
-
-a.headerlink {
-    font-size: 0.8em;
-    padding: 0 4px 0 4px;
-    text-decoration: none;
-}
-
-a.headerlink:hover {
-    background-color: #0069d6;
-    color: white;
-    text-docoration: none;
-}
-
-
-/* Admonitions and warnings ------------------------------------------------- */
-
-/* Shared by admonitions and warnings */
-div.admonition,
-div.warning {
-    padding: 0px;
-    border-radius: 3px;
-    -moz-border-radius: 3px;
-    -webkit-border-radius: 3px;
-}
-div.admonition p,
-div.warning p {
-    margin: 0.5em 1em 0.5em 1em;
-    padding: 0;
-}
-div.admonition pre,
-div.warning pre {
-    margin: 0.4em 1em 0.4em 1em;
-}
-div.admonition p.admonition-title,
-div.warning p.admonition-title {
-    margin: 0;
-    padding: 0.1em 0 0.1em 0.5em;
-    color: white;
-    font-weight: bold;
-    font-size: 1.1em;
-}
-div.admonition ul, div.admonition ol,
-div.warning ul, div.warning ol {
-    margin: 0.1em 0.5em 0.5em 3em;
-    padding: 0;
-}
-
-/* Admonitions only */
-div.admonition {
-    border: 1px solid #609060;
-    background-color: #e9ffe9;
-}
-div.admonition p.admonition-title {
-    background-color: #70A070;
-}
-
-/* Warnings only */
-div.warning {
-    border: 1px solid #900000;
-    background-color: #ffe9e9;
-}
-div.warning p.admonition-title {
-    background-color: #b04040;
-}
-
-
-/* Figures ------------------------------------------------------------------ */
-
-.figure.align-center {
-    clear: none;
-}
-
-/* This is a div for containing multiple figures side-by-side, for use with
- * .. container:: figures */
-div.figures {
-    border: 1px solid #CCCCCC;
-    background-color: #F8F8F8;
-    margin: 1em;
-    text-align: center;
-}
-
-div.figures .figure {
-    clear: none;
-    float: none;
-    display: inline-block;
-    border: none;
-    margin-left: 0.5em;
-    margin-right: 0.5em;
-}
-
-.field-list th {
-    white-space: nowrap;
-}
-
-table.field-list {
-    border-spacing: 0px;
-    margin-left: 1px;
-    border-left: 5px solid rgb(238, 238, 238) !important;
-}
-
-table.field-list th.field-name {
-    display: inline-block;
-    padding: 1px 8px 1px 5px;
-    white-space: nowrap;
-    background-color: rgb(238, 238, 238);
-    border-radius: 0 3px 3px 0;
-    -webkit-border-radius: 0 3px 3px 0;
-}
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
deleted file mode 100644
index 5d82c67..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
+++ /dev/null
@@ -1,57 +0,0 @@
-$(document).ready(function() {
-    /* Add a [>>>] button on the top-right corner of code samples to hide
-     * the >>> and ... prompts and the output and thus make the code
-     * copyable. */
-    var div = $('.highlight-python .highlight,' +
-                '.highlight-python3 .highlight')
-    var pre = div.find('pre');
-
-    // get the styles from the current theme
-    pre.parent().parent().css('position', 'relative');
-    var hide_text = 'Hide the prompts and output';
-    var show_text = 'Show the prompts and output';
-    var border_width = pre.css('border-top-width');
-    var border_style = pre.css('border-top-style');
-    var border_color = pre.css('border-top-color');
-    var button_styles = {
-        'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
-        'border-color': border_color, 'border-style': border_style,
-        'border-width': border_width, 'color': border_color, 'text-size': '75%',
-        'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
-        'border-radius': '0 3px 0 0'
-    }
-
-    // create and add the button to all the code blocks that contain >>>
-    div.each(function(index) {
-        var jthis = $(this);
-        if (jthis.find('.gp').length > 0) {
-            var button = $('<span class="copybutton">>>></span>');
-            button.css(button_styles)
-            button.attr('title', hide_text);
-            jthis.prepend(button);
-        }
-        // tracebacks (.gt) contain bare text elements that need to be
-        // wrapped in a span to work with .nextUntil() (see later)
-        jthis.find('pre:has(.gt)').contents().filter(function() {
-            return ((this.nodeType == 3) && (this.data.trim().length > 0));
-        }).wrap('<span>');
-    });
-
-    // define the behavior of the button when it's clicked
-    $('.copybutton').toggle(
-        function() {
-            var button = $(this);
-            button.parent().find('.go, .gp, .gt').hide();
-            button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
-            button.css('text-decoration', 'line-through');
-            button.attr('title', show_text);
-        },
-        function() {
-            var button = $(this);
-            button.parent().find('.go, .gp, .gt').show();
-            button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
-            button.css('text-decoration', 'none');
-            button.attr('title', hide_text);
-        });
-});
-
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
deleted file mode 100644
index 15d87f3..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * sidebar.js
- * ~~~~~~~~~~
- *
- * This script makes the Sphinx sidebar collapsible.
- *
- * .sphinxsidebar contains .sphinxsidebarwrapper.  This script adds
- * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
- * used to collapse and expand the sidebar.
- *
- * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
- * and the width of the sidebar and the margin-left of the document
- * are decreased. When the sidebar is expanded the opposite happens.
- * This script saves a per-browser/per-session cookie used to
- * remember the position of the sidebar among the pages.
- * Once the browser is closed the cookie is deleted and the position
- * reset to the default (expanded).
- *
- * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-$(function() {
-  // global elements used by the functions.
-  // the 'sidebarbutton' element is defined as global after its
-  // creation, in the add_sidebar_button function
-  var bodywrapper = $('.bodywrapper');
-  var sidebar = $('.sphinxsidebar');
-  var sidebarwrapper = $('.sphinxsidebarwrapper');
-
-  // for some reason, the document has no sidebar; do not run into errors
-  if (!sidebar.length) return;
-
-  // original margin-left of the bodywrapper and width of the sidebar
-  // with the sidebar expanded
-  var bw_margin_expanded = bodywrapper.css('margin-left');
-  var ssb_width_expanded = sidebar.width();
-
-  // margin-left of the bodywrapper and width of the sidebar
-  // with the sidebar collapsed
-  var bw_margin_collapsed = 12;
-  var ssb_width_collapsed = 12;
-
-  // custom colors
-  var dark_color = '#404040';
-  var light_color = '#505050';
-
-  function sidebar_is_collapsed() {
-    return sidebarwrapper.is(':not(:visible)');
-  }
-
-  function toggle_sidebar() {
-    if (sidebar_is_collapsed())
-      expand_sidebar();
-    else
-      collapse_sidebar();
-  }
-
-  function collapse_sidebar() {
-    sidebarwrapper.hide();
-    sidebar.css('width', ssb_width_collapsed);
-    bodywrapper.css('margin-left', bw_margin_collapsed);
-    sidebarbutton.css({
-        'margin-left': '-1px',
-        'height': bodywrapper.height(),
-	'border-radius': '3px'
-    });
-    sidebarbutton.find('span').text('»');
-    sidebarbutton.attr('title', _('Expand sidebar'));
-    document.cookie = 'sidebar=collapsed';
-  }
-
-  function expand_sidebar() {
-    bodywrapper.css('margin-left', bw_margin_expanded);
-    sidebar.css('width', ssb_width_expanded);
-    sidebarwrapper.show();
-    sidebarbutton.css({
-        'margin-left': ssb_width_expanded - 12,
-        'height': bodywrapper.height(),
-	'border-radius': '0px 3px 3px 0px'
-    });
-    sidebarbutton.find('span').text('«');
-    sidebarbutton.attr('title', _('Collapse sidebar'));
-    document.cookie = 'sidebar=expanded';
-  }
-
-  function add_sidebar_button() {
-    sidebarwrapper.css({
-        'float': 'left',
-        'margin-right': '0',
-        'width': ssb_width_expanded - 18
-    });
-    // create the button
-    sidebar.append('<div id="sidebarbutton"><span>«</span></div>');
-    var sidebarbutton = $('#sidebarbutton');
-
-    // find the height of the viewport to center the '<<' in the page
-    var viewport_height;
-    if (window.innerHeight)
- 	  viewport_height = window.innerHeight;
-    else
-	  viewport_height = $(window).height();
-    var sidebar_offset = sidebar.offset().top;
-    var sidebar_height = Math.max(bodywrapper.height(), sidebar.height());
-    sidebarbutton.find('span').css({
-        'font-family': '"Lucida Grande",Arial,sans-serif', 
-	'display': 'block',
-	'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10,
-	'width': 12,
-	'position': 'fixed',
-	'text-align': 'center'
-    });
-
-    sidebarbutton.click(toggle_sidebar);
-    sidebarbutton.attr('title', _('Collapse sidebar'));
-    sidebarbutton.css({
-        'color': '#FFFFFF',
-	'background-color': light_color,
-	'border': '1px solid ' + light_color,
-        'border-radius': '0px 3px 3px 0px',
-        'font-size': '1.2em',
-        'cursor': 'pointer',
-        'height': sidebar_height,
-        'padding-top': '1px',
-	'margin': '-1px',
-        'margin-left': ssb_width_expanded - 12
-    });
-
-    sidebarbutton.hover(
-      function () {
-          $(this).css('background-color', dark_color);
-      },
-      function () {
-          $(this).css('background-color', light_color);
-      }
-    );
-  }
-
-  function set_position_from_cookie() {
-    if (!document.cookie)
-      return;
-    var items = document.cookie.split(';');
-    for(var k=0; k<items.length; k++) {
-      var key_val = items[k].split('=');
-      var key = key_val[0];
-      if (key == 'sidebar') {
-        var value = key_val[1];
-        if ((value == 'collapsed') && (!sidebar_is_collapsed()))
-          collapse_sidebar();
-        else if ((value == 'expanded') && (sidebar_is_collapsed()))
-          expand_sidebar();
-      }
-    }
-  }
-
-  add_sidebar_button();
-  var sidebarbutton = $('#sidebarbutton');
-  set_position_from_cookie();
-});
diff --git a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf b/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
deleted file mode 100644
index ff1e5c7..0000000
--- a/astropy_helpers/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# AstroPy theme based on Twitter Bootstrap CSS
-[theme]
-inherit = basic
-stylesheet = bootstrap-astropy.css
-pygments_style = sphinx
-
-[options]
-logotext1 = astro
-logotext2 = py
-logotext3 = :docs
diff --git a/astropy_helpers/astropy_helpers/src/__init__.py b/astropy_helpers/astropy_helpers/src/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/astropy_helpers/astropy_helpers/src/compiler.c b/astropy_helpers/astropy_helpers/src/compiler.c
deleted file mode 100644
index 75500ca..0000000
--- a/astropy_helpers/astropy_helpers/src/compiler.c
+++ /dev/null
@@ -1,129 +0,0 @@
-#include <Python.h>
-
-/***************************************************************************
- * Macros for determining the compiler version.
- *
- * These are borrowed from boost, and majorly abridged to include only
- * the compilers we care about.
- ***************************************************************************/
-
-#ifndef PY3K
-#if PY_MAJOR_VERSION >= 3
-#define PY3K 1
-#else
-#define PY3K 0
-#endif
-#endif
-
-
-#define STRINGIZE(X) DO_STRINGIZE(X)
-#define DO_STRINGIZE(X) #X
-
-#if defined __clang__
-/*  Clang C++ emulates GCC, so it has to appear early. */
-#    define COMPILER "Clang version " __clang_version__
-
-#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
-/* Intel */
-#    if defined(__INTEL_COMPILER)
-#        define INTEL_VERSION __INTEL_COMPILER
-#    elif defined(__ICL)
-#        define INTEL_VERSION __ICL
-#    elif defined(__ICC)
-#        define INTEL_VERSION __ICC
-#    elif defined(__ECC)
-#        define INTEL_VERSION __ECC
-#    endif
-#    define COMPILER "Intel C compiler version " STRINGIZE(INTEL_VERSION)
-
-#elif defined(__GNUC__)
-/* gcc */
-#    define COMPILER "GCC version " __VERSION__
-
-#elif defined(__SUNPRO_CC)
-/* Sun Workshop Compiler */
-#    define COMPILER "Sun compiler version " STRINGIZE(__SUNPRO_CC)
-
-#elif defined(_MSC_VER)
-/* Microsoft Visual C/C++
-   Must be last since other compilers define _MSC_VER for compatibility as well */
-#    if _MSC_VER < 1200
-#        define COMPILER_VERSION 5.0
-#    elif _MSC_VER < 1300
-#        define COMPILER_VERSION 6.0
-#    elif _MSC_VER == 1300
-#        define COMPILER_VERSION 7.0
-#    elif _MSC_VER == 1310
-#        define COMPILER_VERSION 7.1
-#    elif _MSC_VER == 1400
-#        define COMPILER_VERSION 8.0
-#    elif _MSC_VER == 1500
-#        define COMPILER_VERSION 9.0
-#    elif _MSC_VER == 1600
-#        define COMPILER_VERSION 10.0
-#    else
-#        define COMPILER_VERSION _MSC_VER
-#    endif
-#    define COMPILER "Microsoft Visual C++ version " STRINGIZE(COMPILER_VERSION)
-
-#else
-/* Fallback */
-#    define COMPILER "Unknown compiler"
-
-#endif
-
-
-/***************************************************************************
- * Module-level
- ***************************************************************************/
-
-struct module_state {
-/* The Sun compiler can't handle empty structs */
-#if defined(__SUNPRO_C) || defined(_MSC_VER)
-    int _dummy;
-#endif
-};
-
-#if PY3K
-    static struct PyModuleDef moduledef = {
-        PyModuleDef_HEAD_INIT,
-        "_compiler",
-        NULL,
-        sizeof(struct module_state),
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NULL
-    };
-
-    #define INITERROR return NULL
-
-    PyMODINIT_FUNC
-    PyInit__compiler(void)
-
-#else
-    #define INITERROR return
-
-    PyMODINIT_FUNC
-    init_compiler(void)
-#endif
-
-{
-  PyObject* m;
-
-#if PY3K
-  m = PyModule_Create(&moduledef);
-#else
-  m = Py_InitModule3("_compiler", NULL, NULL);
-#endif
-
-  if (m == NULL)
-    INITERROR;
-
-  PyModule_AddStringConstant(m, "compiler", COMPILER);
-
-#if PY3K
-  return m;
-#endif
-}
diff --git a/astropy_helpers/astropy_helpers/src/setup_package.py b/astropy_helpers/astropy_helpers/src/setup_package.py
deleted file mode 100644
index f750125..0000000
--- a/astropy_helpers/astropy_helpers/src/setup_package.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def get_package_data():
-    return {'astropy_helpers.src': ['compiler.c']}
diff --git a/astropy_helpers/astropy_helpers/test_helpers.py b/astropy_helpers/astropy_helpers/test_helpers.py
deleted file mode 100644
index dfe91ce..0000000
--- a/astropy_helpers/astropy_helpers/test_helpers.py
+++ /dev/null
@@ -1,207 +0,0 @@
-from __future__ import (absolute_import, division, print_function,
-                        unicode_literals)
-import os
-import shutil
-import subprocess
-import sys
-import tempfile
-
-from distutils.core import Command
-
-from .compat import _fix_user_options
-
-
-PY3 = sys.version_info[0] == 3
-
-
-class AstropyTest(Command, object):
-    description = 'Run the tests for this package'
-
-    user_options = [
-        ('package=', 'P',
-         "The name of a specific package to test, e.g. 'io.fits' or 'utils'.  "
-         "If nothing is specified, all default tests are run."),
-        ('test-path=', 't',
-         'Specify a test location by path.  If a relative path to a  .py file, '
-         'it is relative to the built package, so e.g., a  leading "astropy/" '
-         'is necessary.  If a relative  path to a .rst file, it is relative to '
-         'the directory *below* the --docs-path directory, so a leading '
-         '"docs/" is usually necessary.  May also be an absolute path.'),
-        ('verbose-results', 'V',
-         'Turn on verbose output from pytest.'),
-        ('plugins=', 'p',
-         'Plugins to enable when running pytest.'),
-        ('pastebin=', 'b',
-         "Enable pytest pastebin output. Either 'all' or 'failed'."),
-        ('args=', 'a',
-         'Additional arguments to be passed to pytest.'),
-        ('remote-data', 'R', 'Run tests that download remote data.'),
-        ('pep8', '8',
-         'Enable PEP8 checking and disable regular tests. '
-         'Requires the pytest-pep8 plugin.'),
-        ('pdb', 'd',
-         'Start the interactive Python debugger on errors.'),
-        ('coverage', 'c',
-         'Create a coverage report. Requires the coverage package.'),
-        ('open-files', 'o', 'Fail if any tests leave files open.'),
-        ('parallel=', 'j',
-         'Run the tests in parallel on the specified number of '
-         'CPUs.  If negative, all the cores on the machine will be '
-         'used.  Requires the pytest-xdist plugin.'),
-        ('docs-path=', None,
-         'The path to the documentation .rst files.  If not provided, and '
-         'the current directory contains a directory called "docs", that '
-         'will be used.'),
-        ('skip-docs', None,
-         "Don't test the documentation .rst files.")
-    ]
-
-    user_options = _fix_user_options(user_options)
-
-    package_name = ''
-
-    def initialize_options(self):
-        self.package = None
-        self.test_path = None
-        self.verbose_results = False
-        self.plugins = None
-        self.pastebin = None
-        self.args = None
-        self.remote_data = False
-        self.pep8 = False
-        self.pdb = False
-        self.coverage = False
-        self.open_files = False
-        self.parallel = 0
-        self.docs_path = None
-        self.skip_docs = False
-
-    def finalize_options(self):
-        # Normally we would validate the options here, but that's handled in
-        # run_tests
-        pass
-
-    def run(self):
-        try:
-            import astropy
-        except ImportError:
-            raise ImportError(
-                "The 'test' command requires the astropy package to be "
-                "installed and importable.")
-
-        self.reinitialize_command('build', inplace=False)
-        self.run_command('build')
-        build_cmd = self.get_finalized_command('build')
-        new_path = os.path.abspath(build_cmd.build_lib)
-
-        if self.docs_path is None:
-            if os.path.exists('docs'):
-                self.docs_path = os.path.abspath('docs')
-        else:
-            self.docs_path = os.path.abspath(self.docs_path)
-
-        # Copy the build to a temporary directory for the purposes of testing
-        # - this avoids creating pyc and __pycache__ directories inside the
-        # build directory
-        tmp_dir = tempfile.mkdtemp(prefix=self.package_name + '-test-')
-        testing_path = os.path.join(tmp_dir, os.path.basename(new_path))
-        shutil.copytree(new_path, testing_path)
-        shutil.copy('setup.cfg', testing_path)
-
-        cmd_pre = ''
-        cmd_post = ''
-
-        try:
-            if self.coverage:
-                if self.parallel != 0:
-                    raise ValueError(
-                        "--coverage can not be used with --parallel")
-
-                try:
-                    import coverage
-                except ImportError:
-                    raise ImportError(
-                        "--coverage requires that the coverage package is "
-                        "installed.")
-
-                # Don't use get_pkg_data_filename here, because it
-                # requires importing astropy.config and thus screwing
-                # up coverage results for those packages.
-                coveragerc = os.path.join(
-                    testing_path, self.package_name, 'tests', 'coveragerc')
-
-                # We create a coveragerc that is specific to the version
-                # of Python we're running, so that we can mark branches
-                # as being specifically for Python 2 or Python 3
-                with open(coveragerc, 'r') as fd:
-                    coveragerc_content = fd.read()
-                if PY3:
-                    ignore_python_version = '2'
-                else:
-                    ignore_python_version = '3'
-                coveragerc_content = coveragerc_content.replace(
-                    "{ignore_python_version}", ignore_python_version).replace(
-                        "{packagename}", self.package_name)
-                tmp_coveragerc = os.path.join(tmp_dir, 'coveragerc')
-                with open(tmp_coveragerc, 'wb') as tmp:
-                    tmp.write(coveragerc_content.encode('utf-8'))
-
-                cmd_pre = (
-                    'import coverage; '
-                    'cov = coverage.coverage(data_file="{0}", config_file="{1}"); '
-                    'cov.start();'.format(
-                        os.path.abspath(".coverage"), tmp_coveragerc))
-                cmd_post = (
-                    'cov.stop(); '
-                    'from astropy.tests.helper import _save_coverage; '
-                    '_save_coverage(cov, result, "{0}", "{1}");'.format(
-                        os.path.abspath('.'), testing_path))
-
-            if PY3:
-                set_flag = "import builtins; builtins._ASTROPY_TEST_ = True"
-            else:
-                set_flag = "import __builtin__; __builtin__._ASTROPY_TEST_ = True"
-
-            cmd = ('{cmd_pre}{0}; import {1.package_name}, sys; result = ('
-                   '{1.package_name}.test('
-                   'package={1.package!r}, '
-                   'test_path={1.test_path!r}, '
-                   'args={1.args!r}, '
-                   'plugins={1.plugins!r}, '
-                   'verbose={1.verbose_results!r}, '
-                   'pastebin={1.pastebin!r}, '
-                   'remote_data={1.remote_data!r}, '
-                   'pep8={1.pep8!r}, '
-                   'pdb={1.pdb!r}, '
-                   'open_files={1.open_files!r}, '
-                   'parallel={1.parallel!r}, '
-                   'docs_path={1.docs_path!r}, '
-                   'skip_docs={1.skip_docs!r})); '
-                   '{cmd_post}'
-                   'sys.exit(result)')
-            cmd = cmd.format(set_flag, self, cmd_pre=cmd_pre, cmd_post=cmd_post)
-
-            # Run the tests in a subprocess--this is necessary since
-            # new extension modules may have appeared, and this is the
-            # easiest way to set up a new environment
-
-            # Remove temporary directory
-            # On Python 3.x prior to 3.3, the creation of .pyc files
-            # is not atomic.  py.test jumps through some hoops to make
-            # this work by parsing import statements and carefully
-            # importing files atomically.  However, it can't detect
-            # when __import__ is used, so its carefulness still fails.
-            # The solution here (admittedly a bit of a hack), is to
-            # turn off the generation of .pyc files altogether by
-            # passing the `-B` switch to `python`.  This does mean
-            # that each core will have to compile .py file to bytecode
-            # itself, rather than getting lucky and borrowing the work
-            # already done by another core.  Compilation is an
-            # insignificant fraction of total testing time, though, so
-            # it's probably not worth worrying about.
-            retcode = subprocess.call([sys.executable, '-B', '-c', cmd],
-                                      cwd=testing_path, close_fds=False)
-        finally:
-            shutil.rmtree(tmp_dir)
-
-        raise SystemExit(retcode)
diff --git a/astropy_helpers/astropy_helpers/tests/__init__.py b/astropy_helpers/astropy_helpers/tests/__init__.py
deleted file mode 100644
index 267f062..0000000
--- a/astropy_helpers/astropy_helpers/tests/__init__.py
+++ /dev/null
@@ -1,172 +0,0 @@
-import os
-import subprocess as sp
-import sys
-
-from setuptools.sandbox import run_setup
-
-import pytest
-
-PACKAGE_DIR = os.path.dirname(__file__)
-
-
-def run_cmd(cmd, args, path=None, raise_error=True):
-    """
-    Runs a shell command with the given argument list.  Changes directory to
-    ``path`` if given, otherwise runs the command in the current directory.
-
-    Returns a 3-tuple of (stdout, stderr, exit code)
-
-    If ``raise_error=True`` raise an exception on non-zero exit codes.
-    """
-
-    if path is not None:
-        # Transparently support py.path objects
-        path = str(path)
-
-    p = sp.Popen([cmd] + list(args), stdout=sp.PIPE, stderr=sp.PIPE,
-                 cwd=path)
-    streams = tuple(s.decode('latin1').strip() for s in p.communicate())
-    return_code = p.returncode
-
-    if raise_error and return_code != 0:
-        raise RuntimeError(
-            "The command `{0}` with args {1!r} exited with code {2}.\n"
-            "Stdout:\n\n{3}\n\nStderr:\n\n{4}".format(
-                cmd, list(args), return_code, streams[0], streams[1]))
-
-    return streams + (return_code,)
-
-
- at pytest.fixture(scope='function', autouse=True)
-def reset_setup_helpers(request):
-    """
-    Saves and restores the global state of the astropy_helpers.setup_helpers
-    module between tests.
-    """
-
-    mod = __import__('astropy_helpers.setup_helpers', fromlist=[''])
-
-    old_state = mod._module_state.copy()
-
-    def finalizer(old_state=old_state):
-        mod = sys.modules.get('astropy_helpers.setup_helpers')
-        if mod is not None:
-            mod._module_state.update(old_state)
-
-    request.addfinalizer(finalizer)
-
-
- at pytest.fixture(scope='function', autouse=True)
-def reset_distutils_log():
-    """
-    This is a setup/teardown fixture that ensures the log-level of the
-    distutils log is always set to a default of WARN, since different
-    settings could affect tests that check the contents of stdout.
-    """
-
-    from distutils import log
-    log.set_threshold(log.WARN)
-
-
- at pytest.fixture
-def package_template(tmpdir, request):
-    """Create a copy of the package_template repository (containing the package
-    template) in a tempdir and change directories to that temporary copy.
-
-    Also ensures that any previous imports of the test package are unloaded
-    from `sys.modules`.
-    """
-
-    tmp_package = tmpdir.join('package_template')
-
-    # TODO: update URL once package-template changes are merged
-    run_cmd('git', ['clone', 'https://github.com/astropy/package-template',
-                    str(tmp_package)])
-
-    old_cwd = os.getcwd()
-
-    # Before changing directores import the local ah_boostrap module so that it
-    # is tested, and *not* the copy that happens to be included in the test
-    # package
-
-    import ah_bootstrap
-
-    # This is required to prevent the multiprocessing atexit bug
-    import multiprocessing
-
-    os.chdir(str(tmp_package))
-
-    if 'packagename' in sys.modules:
-        del sys.modules['packagename']
-
-    old_astropy_helpers = None
-    if 'astropy_helpers' in sys.modules:
-        # Delete the astropy_helpers that was imported by running the tests so
-        # as to not confuse the astropy_helpers that will be used in testing
-        # the package
-        old_astropy_helpers = sys.modules['astropy_helpers']
-        del sys.modules['astropy_helpers']
-
-    if '' in sys.path:
-        sys.path.remove('')
-
-    sys.path.insert(0, '')
-
-    def finalize(old_cwd=old_cwd, old_astropy_helpers=old_astropy_helpers):
-        os.chdir(old_cwd)
-        sys.modules['astropy_helpers'] = old_astropy_helpers
-
-    request.addfinalizer(finalize)
-
-    return tmp_package
-
-
-TEST_PACKAGE_SETUP_PY = """\
-#!/usr/bin/env python
-
-from setuptools import setup
-
-NAME = 'astropy-helpers-test'
-VERSION = {version!r}
-
-setup(name=NAME, version=VERSION,
-      packages=['_astropy_helpers_test_'],
-      zip_safe=False)
-"""
-
-
- at pytest.fixture
-def testpackage(tmpdir, version='0.1'):
-    """
-    This fixture creates a simplified package called _astropy_helpers_test_
-    used primarily for testing ah_boostrap, but without using the
-    astropy_helpers package directly and getting it confused with the
-    astropy_helpers package already under test.
-    """
-
-    source = tmpdir.mkdir('testpkg')
-
-    with source.as_cwd():
-        source.mkdir('_astropy_helpers_test_')
-        init = source.join('_astropy_helpers_test_', '__init__.py')
-        init.write('__version__ = {0!r}'.format(version))
-        setup_py = TEST_PACKAGE_SETUP_PY.format(version=version)
-        source.join('setup.py').write(setup_py)
-
-        # Make the new test package into a git repo
-        run_cmd('git', ['init'])
-        run_cmd('git', ['add', '--all'])
-        run_cmd('git', ['commit', '-m', 'test package'])
-
-    return source
-
-
-# Ugly workaround
-# Note sure exactly why, but there is some weird interaction between setuptools
-# entry points and the way run_setup messes with sys.modules that causes this
-# module go out out of scope during the tests; importing it here prevents that
-try:
-    import setuptools.py31compat
-except ImportError:
-    # Note all versions of setuptools have this module
-    pass
diff --git a/astropy_helpers/astropy_helpers/tests/test_ah_bootstrap.py b/astropy_helpers/astropy_helpers/tests/test_ah_bootstrap.py
deleted file mode 100644
index 7d609f9..0000000
--- a/astropy_helpers/astropy_helpers/tests/test_ah_bootstrap.py
+++ /dev/null
@@ -1,382 +0,0 @@
-import glob
-import os
-import textwrap
-import sys
-
-from setuptools.package_index import PackageIndex
-from setuptools.sandbox import run_setup
-
-import pytest
-
-from . import *
-from ..utils import silence
-
-
-TEST_SETUP_PY = """\
-#!/usr/bin/env python
-from __future__ import print_function
-
-import os
-import sys
-
-import ah_bootstrap
-# reset the name of the package installed by ah_boostrap to
-# _astropy_helpers_test_--this will prevent any confusion by pkg_resources with
-# any already installed packages named astropy_helpers
-# We also disable auto-upgrade by default
-ah_bootstrap.DIST_NAME = 'astropy-helpers-test'
-ah_bootstrap.PACKAGE_NAME = '_astropy_helpers_test_'
-ah_bootstrap.AUTO_UPGRADE = False
-ah_bootstrap.DOWNLOAD_IF_NEEDED = False
-try:
-    ah_bootstrap.use_astropy_helpers({args})
-finally:
-    ah_bootstrap.DIST_NAME = 'astropy-helpers'
-    ah_bootstrap.PACKAGE_NAME = 'astropy_helpers'
-    ah_bootstrap.AUTO_UPGRADE = True
-    ah_bootstrap.DOWNLOAD_IF_NEEDED = True
-
-import _astropy_helpers_test_
-filename = os.path.abspath(_astropy_helpers_test_.__file__)
-filename = filename.replace('.pyc', '.py')  # More consistent this way
-print(filename)
-"""
-
-
-def test_bootstrap_from_submodule(tmpdir, testpackage, capsys):
-    """
-    Tests importing _astropy_helpers_test_ from a submodule in a git
-    repository.  This tests actually performing a fresh clone of the repository
-    without the submodule initialized, and that importing astropy_helpers in
-    that context works transparently after calling
-    `ah_boostrap.use_astropy_helpers`.
-    """
-
-    orig_repo = tmpdir.mkdir('orig')
-
-    # Ensure ah_bootstrap is imported from the local directory
-    import ah_bootstrap
-
-    with orig_repo.as_cwd():
-        run_cmd('git', ['init'])
-
-        # Write a test setup.py that uses ah_bootstrap; it also ensures that
-        # any previous reference to astropy_helpers is first wiped from
-        # sys.modules
-        orig_repo.join('setup.py').write(TEST_SETUP_PY.format(args=''))
-        run_cmd('git', ['add', 'setup.py'])
-
-        # Add our own clone of the astropy_helpers repo as a submodule named
-        # astropy_helpers
-        run_cmd('git', ['submodule', 'add', str(testpackage),
-                        '_astropy_helpers_test_'])
-
-        run_cmd('git', ['commit', '-m', 'test repository'])
-
-        os.chdir(str(tmpdir))
-
-        # Creates a clone of our test repo in the directory 'clone'
-        run_cmd('git', ['clone', 'orig', 'clone'])
-
-        os.chdir('clone')
-
-        run_setup('setup.py', [])
-
-        stdout, stderr = capsys.readouterr()
-        path = stdout.strip()
-
-        # Ensure that the astropy_helpers used by the setup.py is the one that
-        # was imported from git submodule
-        a = os.path.normcase(path)
-        b = os.path.normcase(str(tmpdir.join('clone', '_astropy_helpers_test_',
-                                             '_astropy_helpers_test_',
-                                             '__init__.py')))
-        assert a == b
-
-
-def test_bootstrap_from_submodule_no_locale(tmpdir, testpackage, capsys,
-                                            monkeypatch):
-    """
-    Regression test for https://github.com/astropy/astropy/issues/2749
-
-    Runs test_bootstrap_from_submodule but with missing locale/langauge
-    settings.
-    """
-
-    for varname in ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'):
-        monkeypatch.delenv(varname, raising=False)
-
-    test_bootstrap_from_submodule(tmpdir, testpackage, capsys)
-
-
-def test_bootstrap_from_submodule_bad_locale(tmpdir, testpackage, capsys,
-                                             monkeypatch):
-    """
-    Additional regression test for
-    https://github.com/astropy/astropy/issues/2749
-    """
-
-    for varname in ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'):
-        monkeypatch.delenv(varname, raising=False)
-
-    # Test also with bad LC_CTYPE a la http://bugs.python.org/issue18378
-    monkeypatch.setenv('LC_CTYPE', 'UTF-8')
-
-    test_bootstrap_from_submodule(tmpdir, testpackage, capsys)
-
-
-def test_check_submodule_no_git(tmpdir, testpackage):
-    """
-    Tests that when importing astropy_helpers from a submodule, it is still
-    recognized as a submodule even when using the --no-git option.
-
-    In particular this ensures that the auto-upgrade feature is not activated.
-    """
-
-    orig_repo = tmpdir.mkdir('orig')
-
-    # Ensure ah_bootstrap is imported from the local directory
-    import ah_bootstrap
-
-    with orig_repo.as_cwd():
-        run_cmd('git', ['init'])
-
-        # Write a test setup.py that uses ah_bootstrap; it also ensures that
-        # any previous reference to astropy_helpers is first wiped from
-        # sys.modules
-        args = 'auto_upgrade=True'
-        orig_repo.join('setup.py').write(TEST_SETUP_PY.format(args=args))
-        run_cmd('git', ['add', 'setup.py'])
-
-        # Add our own clone of the astropy_helpers repo as a submodule named
-        # astropy_helpers
-        run_cmd('git', ['submodule', 'add', str(testpackage),
-                        '_astropy_helpers_test_'])
-
-        run_cmd('git', ['commit', '-m', 'test repository'])
-
-        # Temporarily patch _do_upgrade to fail if called
-        class UpgradeError(Exception):
-            pass
-
-        def _do_upgrade(*args, **kwargs):
-            raise UpgradeError()
-
-        orig_do_upgrade = ah_bootstrap._do_upgrade
-        ah_bootstrap._do_upgrade = _do_upgrade
-        try:
-            run_setup('setup.py', ['--no-git'])
-        except UpgradeError:
-            pytest.fail('Attempted to run auto-upgrade despite importing '
-                        '_astropy_helpers_test_ from a git submodule')
-        finally:
-            ah_bootstrap._do_upgrade = orig_do_upgrade
-
-
-def test_bootstrap_from_directory(tmpdir, testpackage, capsys):
-    """
-    Tests simply bundling a copy of the astropy_helpers source code in its
-    entirety bundled directly in the source package and not in an archive.
-    """
-
-    import ah_bootstrap
-
-    source = tmpdir.mkdir('source')
-    testpackage.copy(source.join('_astropy_helpers_test_'))
-
-    with source.as_cwd():
-        source.join('setup.py').write(TEST_SETUP_PY.format(args=''))
-        run_setup('setup.py', [])
-        stdout, stderr = capsys.readouterr()
-
-        stdout = stdout.splitlines()
-        if stdout:
-            path = stdout[-1].strip()
-        else:
-            path = ''
-
-        # Ensure that the astropy_helpers used by the setup.py is the one that
-        # was imported from git submodule
-        a = os.path.normcase(path)
-        b = os.path.normcase(str(source.join('_astropy_helpers_test_',
-                                             '_astropy_helpers_test_',
-                                             '__init__.py')))
-        assert a == b
-
-
-def test_bootstrap_from_archive(tmpdir, testpackage, capsys):
-    """
-    Tests importing _astropy_helpers_test_ from a .tar.gz source archive
-    shipped alongside the package that uses it.
-    """
-
-    orig_repo = tmpdir.mkdir('orig')
-
-    # Ensure ah_bootstrap is imported from the local directory
-    import ah_bootstrap
-
-    # Make a source distribution of the test package
-    with silence():
-        run_setup(str(testpackage.join('setup.py')),
-                  ['sdist', '--dist-dir=dist', '--formats=gztar'])
-
-    dist_dir = testpackage.join('dist')
-    for dist_file in dist_dir.visit('*.tar.gz'):
-        dist_file.copy(orig_repo)
-
-    with orig_repo.as_cwd():
-        # Write a test setup.py that uses ah_bootstrap; it also ensures that
-        # any previous reference to astropy_helpers is first wiped from
-        # sys.modules
-        args = 'path={0!r}'.format(os.path.basename(str(dist_file)))
-        orig_repo.join('setup.py').write(TEST_SETUP_PY.format(args=args))
-
-        run_setup('setup.py', [])
-
-        stdout, stderr = capsys.readouterr()
-        path = stdout.splitlines()[-1].strip()
-
-        # Installation from the .tar.gz should have resulted in a .egg
-        # directory that the _astropy_helpers_test_ package was imported from
-        eggs = glob.glob('*.egg')
-        assert eggs
-        egg = orig_repo.join(eggs[0])
-        assert os.path.isdir(str(egg))
-
-        a = os.path.normcase(path)
-        b = os.path.normcase(str(egg.join('_astropy_helpers_test_',
-                                          '__init__.py')))
-
-        assert a == b
-
-
-def test_download_if_needed(tmpdir, testpackage, capsys):
-    """
-    Tests the case where astropy_helpers was not actually included in a
-    package, or is otherwise missing, and we need to "download" it.
-
-    This does not test actually downloading from the internet--this is normally
-    done through setuptools' easy_install command which can also install from a
-    source archive.  From the point of view of ah_boostrap the two actions are
-    equivalent, so we can just as easily simulate this by providing a setup.cfg
-    giving the path to a source archive to "download" (as though it were a
-    URL).
-    """
-
-    source = tmpdir.mkdir('source')
-
-    # Ensure ah_bootstrap is imported from the local directory
-    import ah_bootstrap
-
-    # Make a source distribution of the test package
-    with silence():
-        run_setup(str(testpackage.join('setup.py')),
-                  ['sdist', '--dist-dir=dist', '--formats=gztar'])
-
-    dist_dir = testpackage.join('dist')
-
-    with source.as_cwd():
-        source.join('setup.py').write(TEST_SETUP_PY.format(
-            args='download_if_needed=True'))
-        source.join('setup.cfg').write(textwrap.dedent("""\
-            [easy_install]
-            find_links = {find_links}
-        """.format(find_links=str(dist_dir))))
-
-        run_setup('setup.py', [])
-
-        stdout, stderr = capsys.readouterr()
-
-        # Just take the last line--on Python 2.6 distutils logs warning
-        # messages to stdout instead of stderr, causing them to be mixed up
-        # with our expected output
-        path = stdout.splitlines()[-1].strip()
-
-        # easy_install should have worked by 'installing' astropy_helpers as a
-        # .egg in the current directory
-        eggs = glob.glob('*.egg')
-        assert eggs
-        egg = source.join(eggs[0])
-        assert os.path.isdir(str(egg))
-
-        a = os.path.normcase(path)
-        b = os.path.normcase(str(egg.join('_astropy_helpers_test_',
-                                          '__init__.py')))
-        assert a == b
-
-
-def test_upgrade(tmpdir, capsys):
-    # Run the testpackage fixture manually, since we use it multiple times in
-    # this test to make different versions of _astropy_helpers_test_
-    orig_dir = testpackage(tmpdir.mkdir('orig'))
-
-    # Make a test package that uses _astropy_helpers_test_
-    source = tmpdir.mkdir('source')
-    dist_dir = source.mkdir('dists')
-    orig_dir.copy(source.join('_astropy_helpers_test_'))
-
-    with source.as_cwd():
-        setup_py = TEST_SETUP_PY.format(args='auto_upgrade=True')
-        source.join('setup.py').write(setup_py)
-
-        # This will be used to later to fake downloading the upgrade package
-        source.join('setup.cfg').write(textwrap.dedent("""\
-            [easy_install]
-            find_links = {find_links}
-        """.format(find_links=str(dist_dir))))
-
-    # Make additional "upgrade" versions of the _astropy_helpers_test_
-    # package--one of them is version 0.2 and the other is version 0.1.1.  The
-    # auto-upgrade should ignore version 0.2 but use version 0.1.1.
-    upgrade_dir_1 = testpackage(tmpdir.mkdir('upgrade_1'), version='0.2')
-    upgrade_dir_2 = testpackage(tmpdir.mkdir('upgrade_2'), version='0.1.1')
-
-    dists = []
-    # For each upgrade package go ahead and build a source distribution of it
-    # and copy that source distribution to a dist directory we'll use later to
-    # simulate a 'download'
-    for upgrade_dir in [upgrade_dir_1, upgrade_dir_2]:
-        with silence():
-            run_setup(str(upgrade_dir.join('setup.py')),
-                      ['sdist', '--dist-dir=dist', '--formats=gztar'])
-        dists.append(str(upgrade_dir.join('dist')))
-        for dist_file in upgrade_dir.visit('*.tar.gz'):
-            dist_file.copy(source.join('dists'))
-
-    # Monkey with the PackageIndex in ah_bootstrap so that it is initialized
-    # with the test upgrade packages, and so that it does not actually go out
-    # to the internet to look for anything
-    import ah_bootstrap
-
-    class FakePackageIndex(PackageIndex):
-        def __init__(self, *args, **kwargs):
-            PackageIndex.__init__(self, *args, **kwargs)
-            self.to_scan = dists
-
-        def find_packages(self, requirement):
-            # no-op
-            pass
-
-    ah_bootstrap.PackageIndex = FakePackageIndex
-
-    try:
-        with source.as_cwd():
-            # Now run the source setup.py; this test is similar to
-            # test_download_if_needed, but we explicitly check that the correct
-            # *version* of _astropy_helpers_test_ was used
-            run_setup('setup.py', [])
-
-            stdout, stderr = capsys.readouterr()
-            path = stdout.splitlines()[-1].strip()
-            eggs = glob.glob('*.egg')
-            assert eggs
-
-            egg = source.join(eggs[0])
-            assert os.path.isdir(str(egg))
-            a = os.path.normcase(path)
-            b = os.path.normcase(str(egg.join('_astropy_helpers_test_',
-                                              '__init__.py')))
-            assert a == b
-            assert 'astropy_helpers_test-0.1.1-' in str(egg)
-    finally:
-        ah_bootstrap.PackageIndex = PackageIndex
diff --git a/astropy_helpers/astropy_helpers/tests/test_git_helpers.py b/astropy_helpers/astropy_helpers/tests/test_git_helpers.py
deleted file mode 100644
index 576f7c6..0000000
--- a/astropy_helpers/astropy_helpers/tests/test_git_helpers.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import imp
-import os
-import re
-
-from setuptools.sandbox import run_setup
-
-from . import *
-
-
-_DEV_VERSION_RE = re.compile(r'\d+\.\d+(?:\.\d+)?\.dev(\d+)')
-
-
-def test_update_git_devstr(package_template, capsys):
-    """Tests that the commit number in the package's version string updates
-    after git commits even without re-running setup.py.
-    """
-
-    run_setup('setup.py', ['--version'])
-
-    stdout, stderr = capsys.readouterr()
-    version = stdout.strip()
-
-    m = _DEV_VERSION_RE.match(version)
-    assert m, (
-        "Stdout did not match the version string pattern:"
-        "\n\n{0}\n\nStderr:\n\n{1}".format(stdout, stderr))
-    revcount = int(m.group(1))
-
-    import packagename
-    assert packagename.__version__ == version
-
-    # Make a silly git commit
-    with open('.test', 'w'):
-        pass
-
-    run_cmd('git', ['add', '.test'])
-    run_cmd('git', ['commit', '-m', 'test'])
-
-    import packagename.version
-    imp.reload(packagename.version)
-
-    # Previously this checked packagename.__version__, but in order for that to
-    # be updated we also have to re-import _astropy_init which could be tricky.
-    # Checking directly that the packagename.version module was updated is
-    # sufficient:
-    m = _DEV_VERSION_RE.match(packagename.version.version)
-    assert m
-    assert int(m.group(1)) == revcount + 1
-
-    # This doesn't test astropy_helpers.get_helpers.update_git_devstr directly
-    # since a copy of that function is made in packagename.version (so that it
-    # can work without astropy_helpers installed).  In order to get test
-    # coverage on the actual astropy_helpers copy of that function just call it
-    # directly and compare to the value in packagename
-    from astropy_helpers.git_helpers import update_git_devstr
-
-    newversion = update_git_devstr(version, path=str(package_template))
-    assert newversion == packagename.version.version
diff --git a/astropy_helpers/astropy_helpers/tests/test_setup_helpers.py b/astropy_helpers/astropy_helpers/tests/test_setup_helpers.py
deleted file mode 100644
index 5ffa681..0000000
--- a/astropy_helpers/astropy_helpers/tests/test_setup_helpers.py
+++ /dev/null
@@ -1,119 +0,0 @@
-import sys
-
-from textwrap import dedent
-
-from setuptools.sandbox import run_setup
-
-from .. import setup_helpers
-from ..setup_helpers import get_package_info, register_commands
-from . import *
-
-
-def test_cython_autoextensions(tmpdir):
-    """
-    Regression test for https://github.com/astropy/astropy-helpers/pull/19
-
-    Ensures that Cython extensions in sub-packages are discovered and built
-    only once.
-    """
-
-    # Make a simple test package
-    test_pkg = tmpdir.mkdir('test_pkg')
-    test_pkg.mkdir('yoda').mkdir('luke')
-    test_pkg.ensure('yoda', '__init__.py')
-    test_pkg.ensure('yoda', 'luke', '__init__.py')
-    test_pkg.join('yoda', 'luke', 'dagobah.pyx').write(
-        """def testfunc(): pass""")
-
-    # Required, currently, for get_package_info to work
-    register_commands('yoda', '0.0', False)
-    package_info = get_package_info(str(test_pkg))
-
-    assert len(package_info['ext_modules']) == 1
-    assert package_info['ext_modules'][0].name == 'yoda.luke.dagobah'
-
-
-def test_no_cython_buildext(tmpdir):
-    """
-    Regression test for https://github.com/astropy/astropy-helpers/pull/35
-
-    This tests the custom build_ext command installed by astropy_helpers when
-    used with a project that has no Cython extensions (but does have one or
-    more normal C extensions).
-    """
-
-    # In order for this test to test the correct code path we need to fool
-    # setup_helpers into thinking we don't have Cython installed
-    setup_helpers._module_state['have_cython'] = False
-
-    test_pkg = tmpdir.mkdir('test_pkg')
-    test_pkg.mkdir('_eva_').ensure('__init__.py')
-
-    # TODO: It might be later worth making this particular test package into a
-    # reusable fixture for other build_ext tests
-
-    # A minimal C extension for testing
-    test_pkg.join('_eva_').join('unit01.c').write(dedent("""\
-        #include <Python.h>
-        #ifndef PY3K
-        #if PY_MAJOR_VERSION >= 3
-        #define PY3K 1
-        #else
-        #define PY3K 0
-        #endif
-        #endif
-
-        #if PY3K
-        static struct PyModuleDef moduledef = {
-            PyModuleDef_HEAD_INIT,
-            "unit01",
-            NULL,
-            -1,
-            NULL
-        };
-        PyMODINIT_FUNC
-        PyInit_unit01(void) {
-            return PyModule_Create(&moduledef);
-        }
-        #else
-        PyMODINIT_FUNC
-        initunit01(void) {
-            Py_InitModule3("unit01", NULL, NULL);
-        }
-        #endif
-    """))
-
-    test_pkg.join('setup.py').write(dedent("""\
-        from os.path import join
-        from setuptools import setup, Extension
-        from astropy_helpers.setup_helpers import register_commands
-
-        NAME = '_eva_'
-        VERSION = 0.1
-        RELEASE = True
-
-        cmdclassd = register_commands(NAME, VERSION, RELEASE)
-
-        setup(
-            name=NAME,
-            version=VERSION,
-            cmdclass=cmdclassd,
-            ext_modules=[Extension('_eva_.unit01',
-                                   [join('_eva_', 'unit01.c')])]
-        )
-    """))
-
-    test_pkg.chdir()
-    run_setup('setup.py', ['build_ext', '--inplace'])
-    sys.path.insert(0, str(test_pkg))
-    try:
-        import _eva_.unit01
-        dirname = os.path.abspath(os.path.dirname(_eva_.unit01.__file__))
-        assert dirname == str(test_pkg.join('_eva_'))
-    finally:
-        for modname in ['_eva_', '_eva_.unit01']:
-            try:
-                del sys.modules[modname]
-            except KeyError:
-                pass
-        sys.path.remove(str(test_pkg))
diff --git a/astropy_helpers/astropy_helpers/utils.py b/astropy_helpers/astropy_helpers/utils.py
deleted file mode 100644
index bb05fb8..0000000
--- a/astropy_helpers/astropy_helpers/utils.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import contextlib
-import imp
-import os
-import sys
-
-
-# Python 3.3's importlib caches filesystem reads for faster imports in the
-# general case. But sometimes it's necessary to manually invalidate those
-# caches so that the import system can pick up new generated files.  See
-# https://github.com/astropy/astropy/issues/820
-if sys.version_info[:2] >= (3, 3):
-    from importlib import invalidate_caches
-else:
-    invalidate_caches = lambda: None
-
-
-class _DummyFile(object):
-    """A noop writeable object."""
-
-    errors = ''  # Required for Python 3.x
-
-    def write(self, s):
-        pass
-
-    def flush(self):
-        pass
-
-
- at contextlib.contextmanager
-def silence():
-    """A context manager that silences sys.stdout and sys.stderr."""
-
-    old_stdout = sys.stdout
-    old_stderr = sys.stderr
-    sys.stdout = _DummyFile()
-    sys.stderr = _DummyFile()
-    exception_occurred = False
-    try:
-        yield
-    except:
-        exception_occurred = True
-        # Go ahead and clean up so that exception handling can work normally
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-        raise
-
-    if not exception_occurred:
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-
-
-if sys.platform == 'win32':
-    import ctypes
-
-    def _has_hidden_attribute(filepath):
-        """
-        Returns True if the given filepath has the hidden attribute on
-        MS-Windows.  Based on a post here:
-        http://stackoverflow.com/questions/284115/cross-platform-hidden-file-detection
-        """
-        if isinstance(filepath, bytes):
-            filepath = filepath.decode(sys.getfilesystemencoding())
-        try:
-            attrs = ctypes.windll.kernel32.GetFileAttributesW(filepath)
-            assert attrs != -1
-            result = bool(attrs & 2)
-        except (AttributeError, AssertionError):
-            result = False
-        return result
-else:
-    def _has_hidden_attribute(filepath):
-        return False
-
-
-def is_path_hidden(filepath):
-    """
-    Determines if a given file or directory is hidden.
-
-    Parameters
-    ----------
-    filepath : str
-        The path to a file or directory
-
-    Returns
-    -------
-    hidden : bool
-        Returns `True` if the file is hidden
-    """
-
-    name = os.path.basename(os.path.abspath(filepath))
-    if isinstance(name, bytes):
-        is_dotted = name.startswith(b'.')
-    else:
-        is_dotted = name.startswith('.')
-    return is_dotted or _has_hidden_attribute(filepath)
-
-
-def walk_skip_hidden(top, onerror=None, followlinks=False):
-    """
-    A wrapper for `os.walk` that skips hidden files and directories.
-
-    This function does not have the parameter `topdown` from
-    `os.walk`: the directories must always be recursed top-down when
-    using this function.
-
-    See also
-    --------
-    os.walk : For a description of the parameters
-    """
-
-    for root, dirs, files in os.walk(
-            top, topdown=True, onerror=onerror,
-            followlinks=followlinks):
-        # These lists must be updated in-place so os.walk will skip
-        # hidden directories
-        dirs[:] = [d for d in dirs if not is_path_hidden(d)]
-        files[:] = [f for f in files if not is_path_hidden(f)]
-        yield root, dirs, files
-
-
-def write_if_different(filename, data):
-    """Write `data` to `filename`, if the content of the file is different.
-
-    Parameters
-    ----------
-    filename : str
-        The file name to be written to.
-    data : bytes
-        The data to be written to `filename`.
-    """
-
-    assert isinstance(data, bytes)
-
-    if os.path.exists(filename):
-        with open(filename, 'rb') as fd:
-            original_data = fd.read()
-    else:
-        original_data = None
-
-    if original_data != data:
-        with open(filename, 'wb') as fd:
-            fd.write(data)
-
-
-def import_file(filename):
-    """
-    Imports a module from a single file as if it doesn't belong to a
-    particular package.
-    """
-    # Specifying a traditional dot-separated fully qualified name here
-    # results in a number of "Parent module 'astropy' not found while
-    # handling absolute import" warnings.  Using the same name, the
-    # namespaces of the modules get merged together.  So, this
-    # generates an underscore-separated name which is more likely to
-    # be unique, and it doesn't really matter because the name isn't
-    # used directly here anyway.
-    with open(filename, 'U') as fd:
-        name = '_'.join(
-            os.path.relpath(os.path.splitext(filename)[0]).split(os.sep)[1:])
-        return imp.load_module(name, fd, filename, ('.py', 'U', 1))
diff --git a/astropy_helpers/astropy_helpers/version.py b/astropy_helpers/astropy_helpers/version.py
deleted file mode 100644
index 2cf23ca..0000000
--- a/astropy_helpers/astropy_helpers/version.py
+++ /dev/null
@@ -1,169 +0,0 @@
-# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2014-09-16 18:05:48.195649
-
-
-import locale
-import os
-import subprocess
-import warnings
-
-
-def _decode_stdio(stream):
-    try:
-        stdio_encoding = locale.getdefaultlocale()[1] or 'utf-8'
-    except ValueError:
-        stdio_encoding = 'utf-8'
-
-    try:
-        text = stream.decode(stdio_encoding)
-    except UnicodeDecodeError:
-        # Final fallback
-        text = stream.decode('latin1')
-
-    return text
-
-
-def update_git_devstr(version, path=None):
-    """
-    Updates the git revision string if and only if the path is being imported
-    directly from a git working copy.  This ensures that the revision number in
-    the version string is accurate.
-    """
-
-    try:
-        # Quick way to determine if we're in git or not - returns '' if not
-        devstr = get_git_devstr(sha=True, show_warning=False, path=path)
-    except OSError:
-        return version
-
-    if not devstr:
-        # Probably not in git so just pass silently
-        return version
-
-    if 'dev' in version:  # update to the current git revision
-        version_base = version.split('.dev', 1)[0]
-        devstr = get_git_devstr(sha=False, show_warning=False, path=path)
-
-        return version_base + '.dev' + devstr
-    else:
-        #otherwise it's already the true/release version
-        return version
-
-
-def get_git_devstr(sha=False, show_warning=True, path=None):
-    """
-    Determines the number of revisions in this repository.
-
-    Parameters
-    ----------
-    sha : bool
-        If True, the full SHA1 hash will be returned. Otherwise, the total
-        count of commits in the repository will be used as a "revision
-        number".
-
-    show_warning : bool
-        If True, issue a warning if git returns an error code, otherwise errors
-        pass silently.
-
-    path : str or None
-        If a string, specifies the directory to look in to find the git
-        repository.  If `None`, the current working directory is used.
-        If given a filename it uses the directory containing that file.
-
-    Returns
-    -------
-    devversion : str
-        Either a string with the revsion number (if `sha` is False), the
-        SHA1 hash of the current commit (if `sha` is True), or an empty string
-        if git version info could not be identified.
-
-    """
-
-    if path is None:
-        path = os.getcwd()
-
-    if not os.path.isdir(path):
-        path = os.path.abspath(os.path.dirname(path))
-
-    if not os.path.exists(os.path.join(path, '.git')):
-        return ''
-
-    if sha:
-        # Faster for getting just the hash of HEAD
-        cmd = ['rev-parse', 'HEAD']
-    else:
-        cmd = ['rev-list', '--count', 'HEAD']
-
-    def run_git(cmd):
-        try:
-            p = subprocess.Popen(['git'] + cmd, cwd=path,
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE,
-                                 stdin=subprocess.PIPE)
-            stdout, stderr = p.communicate()
-        except OSError as e:
-            if show_warning:
-                warnings.warn('Error running git: ' + str(e))
-            return (None, '', '')
-
-        if p.returncode == 128:
-            if show_warning:
-                warnings.warn('No git repository present at {0!r}! Using '
-                              'default dev version.'.format(path))
-            return (p.returncode, '', '')
-        if p.returncode == 129:
-            if show_warning:
-                warnings.warn('Your git looks old (does it support {0}?); ' 
-                              'consider upgrading to v1.7.2 or '
-                              'later.'.format(cmd[0]))
-            return (p.returncode, stdout, stderr)
-        elif p.returncode != 0:
-            if show_warning:
-                warnings.warn('Git failed while determining revision '
-                              'count: {0}'.format(_decode_stdio(stderr)))
-            return (p.returncode, stdout, stderr)
-
-        return p.returncode, stdout, stderr
-
-    returncode, stdout, stderr = run_git(cmd)
-
-    if not sha and returncode == 129:
-        # git returns 129 if a command option failed to parse; in
-        # particualr this could happen in git versions older than 1.7.2
-        # where the --count option is not supported
-        # Also use --abbrev-commit and --abbrev=0 to display the minimum
-        # number of characters needed per-commit (rather than the full hash)
-        cmd = ['rev-list', '--abbrev-commit', '--abbrev=0', 'HEAD']
-        returncode, stdout, stderr = run_git(cmd)
-        # Fall back on the old method of getting all revisions and counting
-        # the lines
-        if returncode == 0:
-            return str(stdout.count(b'\n'))
-        else:
-            return ''
-    elif sha:
-        return _decode_stdio(stdout)[:40]
-    else:
-        return _decode_stdio(stdout).strip()
-
-_last_generated_version = '0.4.2'
-
-version = update_git_devstr(_last_generated_version)
-githash = get_git_devstr(sha=True, show_warning=False)
-
-
-major = 0
-minor = 4
-bugfix = 2
-
-release = True
-debug = False
-
-try:
-    from ._compiler import compiler
-except ImportError:
-    compiler = "unknown"
-
-try:
-    from .cython_version import cython_version
-except ImportError:
-    cython_version = "unknown"
diff --git a/astropy_helpers/astropy_helpers/version_helpers.py b/astropy_helpers/astropy_helpers/version_helpers.py
deleted file mode 100644
index cd35c25..0000000
--- a/astropy_helpers/astropy_helpers/version_helpers.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-"""
-Utilities for generating the version string for Astropy (or an affiliated
-package) and the version.py module, which contains version info for the
-package.
-
-Within the generated astropy.version module, the `major`, `minor`, and `bugfix`
-variables hold the respective parts of the version number (bugfix is '0' if
-absent). The `release` variable is True if this is a release, and False if this
-is a development version of astropy. For the actual version string, use::
-
-    from astropy.version import version
-
-or::
-
-    from astropy import __version__
-
-"""
-
-from __future__ import division
-
-import datetime
-import imp
-import os
-import pkgutil
-import sys
-
-from distutils import log
-
-from . import git_helpers
-from .setup_helpers import is_distutils_display_option, get_pkg_version_module
-from .utils import invalidate_caches
-
-PY3 = sys.version_info[0] == 3
-
-
-
-def _version_split(version):
-    """
-    Split a version string into major, minor, and bugfix numbers (with bugfix
-    optional, defaulting to 0).
-    """
-
-    for prerel in ('.dev', 'a', 'b', 'rc'):
-        if prerel in version:
-            version = version.split(prerel)[0]
-
-    versplit = version.split('.')
-    major = int(versplit[0])
-    minor = int(versplit[1])
-    bugfix = 0 if len(versplit) < 3 else int(versplit[2])
-    return major, minor, bugfix
-
-
-# This is used by setup.py to create a new version.py - see that file for
-# details. Note that the imports have to be absolute, since this is also used
-# by affiliated packages.
-_FROZEN_VERSION_PY_TEMPLATE = """
-# Autogenerated by {packagename}'s setup.py on {timestamp}
-
-{header}
-
-major = {major}
-minor = {minor}
-bugfix = {bugfix}
-
-release = {rel}
-debug = {debug}
-
-try:
-    from ._compiler import compiler
-except ImportError:
-    compiler = "unknown"
-
-try:
-    from .cython_version import cython_version
-except ImportError:
-    cython_version = "unknown"
-"""[1:]
-
-
-_FROZEN_VERSION_PY_WITH_GIT_HEADER = """
-{git_helpers}
-
-_last_generated_version = {verstr!r}
-
-version = update_git_devstr(_last_generated_version)
-githash = get_git_devstr(sha=True, show_warning=False)
-"""[1:]
-
-
-def _get_version_py_str(packagename, version, release, debug, uses_git=True):
-    timestamp = str(datetime.datetime.now())
-    major, minor, bugfix = _version_split(version)
-
-    if packagename.lower() == 'astropy':
-        packagename = 'Astropy'
-    else:
-        packagename = 'Astropy-affiliated package ' + packagename
-
-    if uses_git:
-        loader = pkgutil.get_loader(git_helpers)
-        source = loader.get_source(git_helpers.__name__) or ''
-        source_lines = source.splitlines()
-        if not source_lines:
-            log.warn('Cannot get source code for astropy_helpers.git_helpers; '
-                     'git support disabled.')
-            return _get_version_py_str(packagename, version, release, debug,
-                                       uses_git=False)
-        idx = 0
-        for idx, line in enumerate(source_lines):
-            if line.startswith('# BEGIN'):
-                break
-        git_helpers_py = '\n'.join(source_lines[idx + 1:])
-
-        if PY3:
-            verstr = version
-        else:
-            # In Python 2 don't pass in a unicode string; otherwise verstr will
-            # be represented with u'' syntax which breaks on Python 3.x with x
-            # < 3.  This is only an issue when developing on multiple Python
-            # versions at once
-            verstr = version.encode('utf8')
-
-        header = _FROZEN_VERSION_PY_WITH_GIT_HEADER.format(
-                git_helpers=git_helpers_py,
-                verstr=verstr)
-    else:
-        header = 'version = {0!r}'.format(version)
-
-    return _FROZEN_VERSION_PY_TEMPLATE.format(packagename=packagename,
-                                              timestamp=timestamp,
-                                              header=header,
-                                              major=major,
-                                              minor=minor,
-                                              bugfix=bugfix,
-                                              rel=release, debug=debug)
-
-
-def generate_version_py(packagename, version, release=None, debug=None,
-                        uses_git=True):
-    """Regenerate the version.py module if necessary."""
-
-    try:
-        version_module = get_pkg_version_module(packagename)
-
-        try:
-            last_generated_version = version_module._last_generated_version
-        except AttributeError:
-            last_generated_version = version_module.version
-
-        current_release = version_module.release
-        current_debug = version_module.debug
-    except ImportError:
-        version_module = None
-        last_generated_version = None
-        current_release = None
-        current_debug = None
-
-    if release is None:
-        # Keep whatever the current value is, if it exists
-        release = bool(current_release)
-
-    if debug is None:
-        # Likewise, keep whatever the current value is, if it exists
-        debug = bool(current_debug)
-
-    version_py = os.path.join(packagename, 'version.py')
-
-    if (last_generated_version != version or current_release != release or
-        current_debug != debug):
-        if '-q' not in sys.argv and '--quiet' not in sys.argv:
-            log.set_threshold(log.INFO)
-
-        if is_distutils_display_option():
-            # Always silence unnecessary log messages when display options are
-            # being used
-            log.set_threshold(log.WARN)
-
-        log.info('Freezing version number to {0}'.format(version_py))
-
-        with open(version_py, 'w') as f:
-            # This overwrites the actual version.py
-            f.write(_get_version_py_str(packagename, version, release, debug,
-                                        uses_git=uses_git))
-
-        invalidate_caches()
-
-        if version_module:
-            imp.reload(version_module)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/__init__.py
deleted file mode 100644
index 5a8b56b..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-try:
-    from .version import version as __version__
-except ImportError:
-    __version__ = ''
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/__init__.py
deleted file mode 100644
index 818e760..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-def _fix_user_options(options):
-    """
-    This is for Python 2.x and 3.x compatibility.  distutils expects Command
-    options to all be byte strings on Python 2 and Unicode strings on Python 3.
-    """
-
-    def to_str_or_none(x):
-        if x is None:
-            return None
-        return str(x)
-
-    return [tuple(to_str_or_none(x) for x in y) for y in options]
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/_subprocess_py2/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/_subprocess_py2/__init__.py
deleted file mode 100644
index a14df41..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/_subprocess_py2/__init__.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from __future__ import absolute_import
-
-from subprocess import *
-
-
-def check_output(*popenargs, **kwargs):
-    r"""Run command with arguments and return its output as a byte
-    string.
-
-    If the exit code was non-zero it raises a CalledProcessError.  The
-    CalledProcessError object will have the return code in the
-    returncode
-    attribute and output in the output attribute.
-
-    The arguments are the same as for the Popen constructor.  Example::
-
-    >>> check_output(["ls", "-l", "/dev/null"])
-    'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'
-
-    The stdout argument is not allowed as it is used internally.
-    To capture standard error in the result, use stderr=STDOUT.::
-
-    >>> check_output(["/bin/sh", "-c",
-    ...               "ls -l non_existent_file ; exit 0"],
-    ...              stderr=STDOUT)
-    'ls: non_existent_file: No such file or directory\n'
-    """
-    if 'stdout' in kwargs:
-        raise ValueError('stdout argument not allowed, it will be overridden.')
-    process = Popen(stdout=PIPE, *popenargs, **kwargs)
-    output, unused_err = process.communicate()
-    retcode = process.poll()
-    if retcode:
-        cmd = kwargs.get("args")
-        if cmd is None:
-            cmd = popenargs[0]
-        raise CalledProcessError(retcode, cmd)
-    return output
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/subprocess.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/subprocess.py
deleted file mode 100644
index 93a388b..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/compat/subprocess.py
+++ /dev/null
@@ -1,19 +0,0 @@
-"""
-A replacement wrapper around the subprocess module that adds
-check_output (which was only added to Python in 2.7.
-
-Instead of importing subprocess, other modules should use this as follows::
-
-    from astropy.utils.compat import subprocess
-
-This module is safe to import from anywhere within astropy.
-"""
-from __future__ import absolute_import, print_function
-
-import subprocess
-
-# python2.7 and later provide a check_output method
-if not hasattr(subprocess, 'check_output'):
-    from ._subprocess_py2 import check_output
-
-from subprocess import *
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/git_helpers.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/git_helpers.py
deleted file mode 100644
index 88aae9d..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/git_helpers.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-"""
-Utilities for retrieving revision information from a project's git repository.
-"""
-
-# Do not remove the following comment; it is used by
-# astropy_helpers.version_helpers to determine the beginning of the code in
-# this module
-
-# BEGIN
-
-import locale
-import os
-import subprocess
-import warnings
-
-
-def _decode_stdio(stream):
-    try:
-        stdio_encoding = locale.getdefaultlocale()[1] or 'utf-8'
-    except ValueError:
-        stdio_encoding = 'utf-8'
-
-    try:
-        text = stream.decode(stdio_encoding)
-    except UnicodeDecodeError:
-        # Final fallback
-        text = stream.decode('latin1')
-
-    return text
-
-
-def update_git_devstr(version, path=None):
-    """
-    Updates the git revision string if and only if the path is being imported
-    directly from a git working copy.  This ensures that the revision number in
-    the version string is accurate.
-    """
-
-    try:
-        # Quick way to determine if we're in git or not - returns '' if not
-        devstr = get_git_devstr(sha=True, show_warning=False, path=path)
-    except OSError:
-        return version
-
-    if not devstr:
-        # Probably not in git so just pass silently
-        return version
-
-    if 'dev' in version:  # update to the current git revision
-        version_base = version.split('.dev', 1)[0]
-        devstr = get_git_devstr(sha=False, show_warning=False, path=path)
-
-        return version_base + '.dev' + devstr
-    else:
-        #otherwise it's already the true/release version
-        return version
-
-
-def get_git_devstr(sha=False, show_warning=True, path=None):
-    """
-    Determines the number of revisions in this repository.
-
-    Parameters
-    ----------
-    sha : bool
-        If True, the full SHA1 hash will be returned. Otherwise, the total
-        count of commits in the repository will be used as a "revision
-        number".
-
-    show_warning : bool
-        If True, issue a warning if git returns an error code, otherwise errors
-        pass silently.
-
-    path : str or None
-        If a string, specifies the directory to look in to find the git
-        repository.  If `None`, the current working directory is used.
-        If given a filename it uses the directory containing that file.
-
-    Returns
-    -------
-    devversion : str
-        Either a string with the revsion number (if `sha` is False), the
-        SHA1 hash of the current commit (if `sha` is True), or an empty string
-        if git version info could not be identified.
-
-    """
-
-    if path is None:
-        path = os.getcwd()
-
-    if not os.path.isdir(path):
-        path = os.path.abspath(os.path.dirname(path))
-
-    if not os.path.exists(os.path.join(path, '.git')):
-        return ''
-
-    if sha:
-        # Faster for getting just the hash of HEAD
-        cmd = ['rev-parse', 'HEAD']
-    else:
-        cmd = ['rev-list', '--count', 'HEAD']
-
-    def run_git(cmd):
-        try:
-            p = subprocess.Popen(['git'] + cmd, cwd=path,
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE,
-                                 stdin=subprocess.PIPE)
-            stdout, stderr = p.communicate()
-        except OSError as e:
-            if show_warning:
-                warnings.warn('Error running git: ' + str(e))
-            return (None, '', '')
-
-        if p.returncode == 128:
-            if show_warning:
-                warnings.warn('No git repository present at {0!r}! Using '
-                              'default dev version.'.format(path))
-            return (p.returncode, '', '')
-        if p.returncode == 129:
-            if show_warning:
-                warnings.warn('Your git looks old (does it support {0}?); ' 
-                              'consider upgrading to v1.7.2 or '
-                              'later.'.format(cmd[0]))
-            return (p.returncode, stdout, stderr)
-        elif p.returncode != 0:
-            if show_warning:
-                warnings.warn('Git failed while determining revision '
-                              'count: {0}'.format(_decode_stdio(stderr)))
-            return (p.returncode, stdout, stderr)
-
-        return p.returncode, stdout, stderr
-
-    returncode, stdout, stderr = run_git(cmd)
-
-    if not sha and returncode == 129:
-        # git returns 129 if a command option failed to parse; in
-        # particualr this could happen in git versions older than 1.7.2
-        # where the --count option is not supported
-        # Also use --abbrev-commit and --abbrev=0 to display the minimum
-        # number of characters needed per-commit (rather than the full hash)
-        cmd = ['rev-list', '--abbrev-commit', '--abbrev=0', 'HEAD']
-        returncode, stdout, stderr = run_git(cmd)
-        # Fall back on the old method of getting all revisions and counting
-        # the lines
-        if returncode == 0:
-            return str(stdout.count(b'\n'))
-        else:
-            return ''
-    elif sha:
-        return _decode_stdio(stdout)[:40]
-    else:
-        return _decode_stdio(stdout).strip()
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/setup_helpers.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/setup_helpers.py
deleted file mode 100644
index d682e95..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/setup_helpers.py
+++ /dev/null
@@ -1,1526 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This module contains a number of utilities for use during
-setup/build/packaging that are useful to astropy as a whole.
-"""
-
-from __future__ import absolute_import, print_function
-
-import collections
-import errno
-import imp
-import inspect
-import os
-import pkgutil
-import re
-import shlex
-import shutil
-import subprocess
-import sys
-import textwrap
-
-from distutils import log, ccompiler, sysconfig
-from distutils.cmd import DistutilsOptionError
-from distutils.dist import Distribution
-from distutils.errors import DistutilsError, DistutilsFileError
-from distutils.core import Extension
-from distutils.core import Command
-from distutils.command.sdist import sdist as DistutilsSdist
-from setuptools.command.build_ext import build_ext as SetuptoolsBuildExt
-from setuptools.command.build_py import build_py as SetuptoolsBuildPy
-from setuptools.command.install import install as SetuptoolsInstall
-from setuptools.command.install_lib import install_lib as SetuptoolsInstallLib
-
-from setuptools.command.register import register as SetuptoolsRegister
-from setuptools import find_packages
-
-from .test_helpers import AstropyTest
-from .utils import silence, invalidate_caches, walk_skip_hidden
-
-_module_state = {
-    'adjusted_compiler': False,
-    'registered_commands': None,
-    'have_cython': False,
-    'have_sphinx': False
-}
-
-try:
-    import Cython
-    _module_state['have_cython'] = True
-except ImportError:
-    pass
-
-try:
-    import sphinx
-    from sphinx.setup_command import BuildDoc as SphinxBuildDoc
-    _module_state['have_sphinx'] = True
-except ValueError as e:
-    # This can occur deep in the bowels of Sphinx's imports by way of docutils
-    # and an occurence of this bug: http://bugs.python.org/issue18378
-    # In this case sphinx is effectively unusable
-    if 'unknown locale' in e.args[0]:
-        log.warn(
-            "Possible misconfiguration of one of the environment variables "
-            "LC_ALL, LC_CTYPES, LANG, or LANGUAGE.  For an example of how to "
-            "configure your system's language environment on OSX see "
-            "http://blog.remibergsma.com/2012/07/10/"
-            "setting-locales-correctly-on-mac-osx-terminal-application/")
-except ImportError:
-    pass
-except SyntaxError:
-    # occurs if markupsafe is recent version, which doesn't support Python 3.2
-    pass
-
-
-PY3 = sys.version_info[0] >= 3
-
-
-# This adds a new keyword to the setup() function
-Distribution.skip_2to3 = []
-
-
-def adjust_compiler(package):
-    """
-    This function detects broken compilers and switches to another.  If
-    the environment variable CC is explicitly set, or a compiler is
-    specified on the commandline, no override is performed -- the purpose
-    here is to only override a default compiler.
-
-    The specific compilers with problems are:
-
-        * The default compiler in XCode-4.2, llvm-gcc-4.2,
-          segfaults when compiling wcslib.
-
-    The set of broken compilers can be updated by changing the
-    compiler_mapping variable.  It is a list of 2-tuples where the
-    first in the pair is a regular expression matching the version
-    of the broken compiler, and the second is the compiler to change
-    to.
-    """
-
-    compiler_mapping = [
-        (b'i686-apple-darwin[0-9]*-llvm-gcc-4.2', 'clang')
-        ]
-
-    if _module_state['adjusted_compiler']:
-        return
-
-    # Whatever the result of this function is, it only needs to be run once
-    _module_state['adjusted_compiler'] = True
-
-    if 'CC' in os.environ:
-
-        # Check that CC is not set to llvm-gcc-4.2
-        c_compiler = os.environ['CC']
-
-        try:
-            version = get_compiler_version(c_compiler)
-        except OSError:
-            msg = textwrap.dedent(
-                    """
-                    The C compiler set by the CC environment variable:
-
-                        {compiler:s}
-
-                    cannot be found or executed.
-                    """.format(compiler=c_compiler))
-            log.warn(msg)
-            sys.exit(1)
-
-        for broken, fixed in compiler_mapping:
-            if re.match(broken, version):
-                msg = textwrap.dedent(
-                    """Compiler specified by CC environment variable
-                    ({compiler:s}:{version:s}) will fail to compile {pkg:s}.
-                    Please set CC={fixed:s} and try again.
-                    You can do this, for example, by running:
-
-                        CC={fixed:s} python setup.py <command>
-
-                    where <command> is the command you ran.
-                    """.format(compiler=c_compiler, version=version,
-                               pkg=package, fixed=fixed))
-                log.warn(msg)
-                sys.exit(1)
-
-        # If C compiler is set via CC, and isn't broken, we are good to go. We
-        # should definitely not try accessing the compiler specified by
-        # ``sysconfig.get_config_var('CC')`` lower down, because this may fail
-        # if the compiler used to compile Python is missing (and maybe this is
-        # why the user is setting CC). For example, the official Python 2.7.3
-        # MacOS X binary was compled with gcc-4.2, which is no longer available
-        # in XCode 4.
-        return
-
-    if get_distutils_build_option('compiler'):
-        return
-
-    compiler_type = ccompiler.get_default_compiler()
-
-    if compiler_type == 'unix':
-
-        # We have to get the compiler this way, as this is the one that is
-        # used if os.environ['CC'] is not set. It is actually read in from
-        # the Python Makefile. Note that this is not necessarily the same
-        # compiler as returned by ccompiler.new_compiler()
-        c_compiler = sysconfig.get_config_var('CC')
-
-        try:
-            version = get_compiler_version(c_compiler)
-        except OSError:
-            msg = textwrap.dedent(
-                    """
-                    The C compiler used to compile Python {compiler:s}, and
-                    which is normally used to compile C extensions, is not
-                    available. You can explicitly specify which compiler to
-                    use by setting the CC environment variable, for example:
-
-                        CC=gcc python setup.py <command>
-
-                    or if you are using MacOS X, you can try:
-
-                        CC=clang python setup.py <command>
-                    """.format(compiler=c_compiler))
-            log.warn(msg)
-            sys.exit(1)
-
-
-        for broken, fixed in compiler_mapping:
-            if re.match(broken, version):
-                os.environ['CC'] = fixed
-                break
-
-
-def get_compiler_version(compiler):
-
-    process = subprocess.Popen(
-        shlex.split(compiler) + ['--version'], stdout=subprocess.PIPE)
-
-    output = process.communicate()[0].strip()
-    try:
-        version = output.split()[0]
-    except IndexError:
-        return 'unknown'
-
-    return version
-
-
-def get_dummy_distribution():
-    """Returns a distutils Distribution object used to instrument the setup
-    environment before calling the actual setup() function.
-    """
-
-    if _module_state['registered_commands'] is None:
-        raise RuntimeError(
-            'astropy_helpers.setup_helpers.register_commands() must be '
-            'called before using '
-            'astropy_helpers.setup_helpers.get_dummy_distribution()')
-
-    # Pre-parse the Distutils command-line options and config files to if
-    # the option is set.
-    dist = Distribution({'script_name': os.path.basename(sys.argv[0]),
-                         'script_args': sys.argv[1:]})
-    dist.cmdclass.update(_module_state['registered_commands'])
-
-    with silence():
-        try:
-            dist.parse_config_files()
-            dist.parse_command_line()
-        except (DistutilsError, AttributeError, SystemExit):
-            # Let distutils handle DistutilsErrors itself AttributeErrors can
-            # get raise for ./setup.py --help SystemExit can be raised if a
-            # display option was used, for example
-            pass
-
-    return dist
-
-
-def get_distutils_option(option, commands):
-    """ Returns the value of the given distutils option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    commands : list of str
-        The list of commands on which this option is available
-
-    Returns
-    -------
-    val : str or None
-        the value of the given distutils option. If the option is not set,
-        returns None.
-    """
-
-    dist = get_dummy_distribution()
-
-    for cmd in commands:
-        cmd_opts = dist.command_options.get(cmd)
-        if cmd_opts is not None and option in cmd_opts:
-            return cmd_opts[option][1]
-    else:
-        return None
-
-
-def get_distutils_build_option(option):
-    """ Returns the value of the given distutils build option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build option. If the option
-        is not set, returns None.
-    """
-    return get_distutils_option(option, ['build', 'build_ext', 'build_clib'])
-
-
-def get_distutils_install_option(option):
-    """ Returns the value of the given distutils install option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build option. If the option
-        is not set, returns None.
-    """
-    return get_distutils_option(option, ['install'])
-
-
-def get_distutils_build_or_install_option(option):
-    """ Returns the value of the given distutils build or install option.
-
-    Parameters
-    ----------
-    option : str
-        The name of the option
-
-    Returns
-    -------
-    val : str or None
-        The value of the given distutils build or install option. If the
-        option is not set, returns None.
-    """
-    return get_distutils_option(option, ['build', 'build_ext', 'build_clib',
-                                         'install'])
-
-
-def get_compiler_option():
-    """ Determines the compiler that will be used to build extension modules.
-
-    Returns
-    -------
-    compiler : str
-        The compiler option specificied for the build, build_ext, or build_clib
-        command; or the default compiler for the platform if none was
-        specified.
-
-    """
-
-    compiler = get_distutils_build_option('compiler')
-    if compiler is None:
-        return ccompiler.get_default_compiler()
-
-    return compiler
-
-
-def get_debug_option(packagename):
-    """ Determines if the build is in debug mode.
-
-    Returns
-    -------
-    debug : bool
-        True if the current build was started with the debug option, False
-        otherwise.
-
-    """
-
-    try:
-        current_debug = get_pkg_version_module(packagename,
-                                               fromlist=['debug'])[0]
-    except (ImportError, AttributeError):
-        current_debug = None
-
-    # Only modify the debug flag if one of the build commands was explicitly
-    # run (i.e. not as a sub-command of something else)
-    dist = get_dummy_distribution()
-    if any(cmd in dist.commands for cmd in ['build', 'build_ext']):
-        debug = bool(get_distutils_build_option('debug'))
-    else:
-        debug = bool(current_debug)
-
-    if current_debug is not None and current_debug != debug:
-        build_ext_cmd = dist.get_command_class('build_ext')
-        build_ext_cmd.force_rebuild = True
-
-    return debug
-
-
-# TODO: Move this into astropy_helpers.version_helpers once the dependency of
-# version_helpers on *this* module has been resolved (IOW, once these modules
-# have been refactored to reduce their interdependency)
-def get_pkg_version_module(packagename, fromlist=None):
-    """Returns the package's .version module generated by
-    `astropy_helpers.version_helpers.generate_version_py`.  Raises an
-    ImportError if the version module is not found.
-
-    If ``fromlist`` is an iterable, return a tuple of the members of the
-    version module corresponding to the member names given in ``fromlist``.
-    Raises an `AttributeError` if any of these module members are not found.
-    """
-
-    if not fromlist:
-        # Due to a historical quirk of Python's import implementation,
-        # __import__ will not return submodules of a package if 'fromlist' is
-        # empty.
-        # TODO: For Python 3.1 and up it may be preferable to use importlib
-        # instead of the __import__ builtin
-        return __import__(packagename + '.version', fromlist=[''])
-    else:
-        mod = __import__(packagename + '.version', fromlist=fromlist)
-        return tuple(getattr(mod, member) for member in fromlist)
-
-
-def register_commands(package, version, release):
-    if _module_state['registered_commands'] is not None:
-        return _module_state['registered_commands']
-
-    _module_state['registered_commands'] = registered_commands = {
-        'test': generate_test_command(package),
-
-        # Use distutils' sdist because it respects package_data.
-        # setuptools/distributes sdist requires duplication of information in
-        # MANIFEST.in
-        'sdist': DistutilsSdist,
-
-        # The exact form of the build_ext command depends on whether or not
-        # we're building a release version
-        'build_ext': generate_build_ext_command(package, release),
-
-        # We have a custom build_py to generate the default configuration file
-        'build_py': AstropyBuildPy,
-
-        # Since install can (in some circumstances) be run without
-        # first building, we also need to override install and
-        # install_lib.  See #2223
-        'install': AstropyInstall,
-        'install_lib': AstropyInstallLib,
-
-        'register': AstropyRegister
-    }
-
-
-    if _module_state['have_sphinx']:
-        registered_commands['build_sphinx'] = AstropyBuildSphinx
-    else:
-        registered_commands['build_sphinx'] = FakeBuildSphinx
-
-    # Need to override the __name__ here so that the commandline options are
-    # presented as being related to the "build" command, for example; normally
-    # this wouldn't be necessary since commands also have a command_name
-    # attribute, but there is a bug in distutils' help display code that it
-    # uses __name__ instead of command_name. Yay distutils!
-    for name, cls in registered_commands.items():
-        cls.__name__ = name
-
-    # Add a few custom options; more of these can be added by specific packages
-    # later
-    for option in [
-            ('use-system-libraries',
-             "Use system libraries whenever possible", True)]:
-        add_command_option('build', *option)
-        add_command_option('install', *option)
-
-    return registered_commands
-
-
-def generate_test_command(package_name):
-    """
-    Creates a custom 'test' command for the given package which sets the
-    command's ``package_name`` class attribute to the name of the package being
-    tested.
-    """
-
-    return type(package_name.title() + 'Test', (AstropyTest,),
-                {'package_name': package_name})
-
-
-def generate_build_ext_command(packagename, release):
-    """
-    Creates a custom 'build_ext' command that allows for manipulating some of
-    the C extension options at build time.  We use a function to build the
-    class since the base class for build_ext may be different depending on
-    certain build-time parameters (for example, we may use Cython's build_ext
-    instead of the default version in distutils).
-
-    Uses the default distutils.command.build_ext by default.
-    """
-
-    uses_cython = should_build_with_cython(packagename, release)
-
-    if uses_cython:
-        from Cython.Distutils import build_ext as basecls
-    else:
-        basecls = SetuptoolsBuildExt
-
-    attrs = dict(basecls.__dict__)
-    orig_run = getattr(basecls, 'run', None)
-    orig_finalize = getattr(basecls, 'finalize_options', None)
-
-    def finalize_options(self):
-        # Add a copy of the _compiler.so module as well, but only if there are
-        # in fact C modules to compile (otherwise there's no reason to include
-        # a record of the compiler used)
-        if self.extensions:
-            src_path = os.path.relpath(
-                os.path.join(os.path.dirname(__file__), 'src'))
-            shutil.copy2(os.path.join(src_path, 'compiler.c'),
-                         os.path.join(self.package_name, '_compiler.c'))
-            ext = Extension(self.package_name + '._compiler',
-                            [os.path.join(self.package_name, '_compiler.c')])
-            self.extensions.insert(0, ext)
-
-        if orig_finalize is not None:
-            orig_finalize(self)
-
-        # Generate
-        if self.uses_cython:
-            try:
-                from Cython import __version__ as cython_version
-            except ImportError:
-                # This shouldn't happen if we made it this far
-                cython_version = None
-
-            if (cython_version is not None and
-                    cython_version != self.uses_cython):
-                self.force_rebuild = True
-                # Update the used cython version
-                self.uses_cython = cython_version
-
-        # Regardless of the value of the '--force' option, force a rebuild if
-        # the debug flag changed from the last build
-        if self.force_rebuild:
-            self.force = True
-
-    def run(self):
-        # For extensions that require 'numpy' in their include dirs, replace
-        # 'numpy' with the actual paths
-        np_include = get_numpy_include_path()
-        for extension in self.extensions:
-            if 'numpy' in extension.include_dirs:
-                idx = extension.include_dirs.index('numpy')
-                extension.include_dirs.insert(idx, np_include)
-                extension.include_dirs.remove('numpy')
-
-            # Replace .pyx with C-equivalents, unless c files are missing
-            for jdx, src in enumerate(extension.sources):
-                if src.endswith('.pyx'):
-                    pyxfn = src
-                    cfn = src[:-4] + '.c'
-                elif src.endswith('.c'):
-                    pyxfn = src[:-2] + '.pyx'
-                    cfn = src
-
-                if not os.path.isfile(pyxfn):
-                    continue
-
-                if self.uses_cython:
-                    extension.sources[jdx] = pyxfn
-                else:
-                    if os.path.isfile(cfn):
-                        extension.sources[jdx] = cfn
-                    else:
-                        msg = (
-                            'Could not find C file {0} for Cython file {1} '
-                            'when building extension {2}. Cython must be '
-                            'installed to build from a git checkout.'.format(
-                                cfn, pyxfn, extension.name))
-                        raise IOError(errno.ENOENT, msg, cfn)
-
-        if orig_run is not None:
-            # This should always be the case for a correctly implemented
-            # distutils command.
-            orig_run(self)
-
-        # Update cython_version.py if building with Cython
-        try:
-            cython_version = get_pkg_version_module(
-                    packagename, fromlist=['cython_version'])[0]
-        except (AttributeError, ImportError):
-            cython_version = 'unknown'
-        if self.uses_cython and self.uses_cython != cython_version:
-            package_dir = os.path.relpath(packagename)
-            cython_py = os.path.join(package_dir, 'cython_version.py')
-            with open(cython_py, 'w') as f:
-                f.write('# Generated file; do not modify\n')
-                f.write('cython_version = {0!r}\n'.format(self.uses_cython))
-
-            if os.path.isdir(self.build_lib):
-                # The build/lib directory may not exist if the build_py command
-                # was not previously run, which may sometimes be the case
-                self.copy_file(cython_py,
-                               os.path.join(self.build_lib, cython_py),
-                               preserve_mode=False)
-
-            invalidate_caches()
-
-    attrs['run'] = run
-    attrs['finalize_options'] = finalize_options
-    attrs['force_rebuild'] = False
-    attrs['uses_cython'] = uses_cython
-    attrs['package_name'] = packagename
-    attrs['user_options'] = basecls.user_options[:]
-    attrs['boolean_options'] = basecls.boolean_options[:]
-
-    return type('build_ext', (basecls, object), attrs)
-
-
-def _get_platlib_dir(cmd):
-    plat_specifier = '.{0}-{1}'.format(cmd.plat_name, sys.version[0:3])
-    return os.path.join(cmd.build_base, 'lib' + plat_specifier)
-
-
-class AstropyInstall(SetuptoolsInstall):
-    user_options = SetuptoolsInstall.user_options[:]
-    boolean_options = SetuptoolsInstall.boolean_options[:]
-
-    def finalize_options(self):
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-        self.build_lib = platlib_dir
-        SetuptoolsInstall.finalize_options(self)
-
-
-class AstropyInstallLib(SetuptoolsInstallLib):
-    user_options = SetuptoolsInstallLib.user_options[:]
-    boolean_options = SetuptoolsInstallLib.boolean_options[:]
-
-    def finalize_options(self):
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-        self.build_dir = platlib_dir
-        SetuptoolsInstallLib.finalize_options(self)
-
-
-class AstropyBuildPy(SetuptoolsBuildPy):
-    user_options = SetuptoolsBuildPy.user_options[:]
-    boolean_options = SetuptoolsBuildPy.boolean_options[:]
-
-    def finalize_options(self):
-        # Update build_lib settings from the build command to always put
-        # build files in platform-specific subdirectories of build/, even
-        # for projects with only pure-Python source (this is desirable
-        # specifically for support of multiple Python version).
-        build_cmd = self.get_finalized_command('build')
-        platlib_dir = _get_platlib_dir(build_cmd)
-
-        build_cmd.build_purelib = platlib_dir
-        build_cmd.build_lib = platlib_dir
-        self.build_lib = platlib_dir
-
-        SetuptoolsBuildPy.finalize_options(self)
-
-    def run_2to3(self, files, doctests=False):
-        # Filter the files to exclude things that shouldn't be 2to3'd
-        skip_2to3 = self.distribution.skip_2to3
-        filtered_files = []
-        for file in files:
-            for package in skip_2to3:
-                if file[len(self.build_lib) + 1:].startswith(package):
-                    break
-            else:
-                filtered_files.append(file)
-
-        SetuptoolsBuildPy.run_2to3(self, filtered_files, doctests)
-
-    def run(self):
-        # first run the normal build_py
-        SetuptoolsBuildPy.run(self)
-
-
-def add_command_option(command, name, doc, is_bool=False):
-    """
-    Add a custom option to a setup command.
-
-    Issues a warning if the option already exists on that command.
-
-    Parameters
-    ----------
-    command : str
-        The name of the command as given on the command line
-
-    name : str
-        The name of the build option
-
-    doc : str
-        A short description of the option, for the `--help` message
-
-    is_bool : bool, optional
-        When `True`, the option is a boolean option and doesn't
-        require an associated value.
-    """
-
-    dist = get_dummy_distribution()
-    cmdcls = dist.get_command_class(command)
-
-    if (hasattr(cmdcls, '_astropy_helpers_options') and
-            name in cmdcls._astropy_helpers_options):
-        return
-
-    attr = name.replace('-', '_')
-
-    if hasattr(cmdcls, attr):
-        raise RuntimeError(
-            '{0!r} already has a {1!r} class attribute, barring {2!r} from '
-            'being usable as a custom option name.'.format(cmdcls, attr, name))
-
-    for idx, cmd in enumerate(cmdcls.user_options):
-        if cmd[0] == name:
-            log.warn('Overriding existing {0!r} option '
-                     '{1!r}'.format(command, name))
-            del cmdcls.user_options[idx]
-            if name in cmdcls.boolean_options:
-                cmdcls.boolean_options.remove(name)
-            break
-
-    cmdcls.user_options.append((name, None, doc))
-
-    if is_bool:
-        cmdcls.boolean_options.append(name)
-
-    # Distutils' command parsing requires that a command object have an
-    # attribute with the same name as the option (with '-' replaced with '_')
-    # in order for that option to be recognized as valid
-    setattr(cmdcls, attr, None)
-
-    # This caches the options added through add_command_option so that if it is
-    # run multiple times in the same interpreter repeated adds are ignored
-    # (this way we can still raise a RuntimeError if a custom option overrides
-    # a built-in option)
-    if not hasattr(cmdcls, '_astropy_helpers_options'):
-        cmdcls._astropy_helpers_options = set([name])
-    else:
-        cmdcls._astropy_helpers_options.add(name)
-
-
-class AstropyRegister(SetuptoolsRegister):
-    """Extends the built in 'register' command to support a ``--hidden`` option
-    to make the registered version hidden on PyPI by default.
-
-    The result of this is that when a version is registered as "hidden" it can
-    still be downloaded from PyPI, but it does not show up in the list of
-    actively supported versions under http://pypi.python.org/pypi/astropy, and
-    is not set as the most recent version.
-
-    Although this can always be set through the web interface it may be more
-    convenient to be able to specify via the 'register' command.  Hidden may
-    also be considered a safer default when running the 'register' command,
-    though this command uses distutils' normal behavior if the ``--hidden``
-    option is omitted.
-    """
-
-    user_options = SetuptoolsRegister.user_options + [
-        ('hidden', None, 'mark this release as hidden on PyPI by default')
-    ]
-    boolean_options = SetuptoolsRegister.boolean_options + ['hidden']
-
-    def initialize_options(self):
-        SetuptoolsRegister.initialize_options(self)
-        self.hidden = False
-
-    def build_post_data(self, action):
-        data = SetuptoolsRegister.build_post_data(self, action)
-        if action == 'submit' and self.hidden:
-            data['_pypi_hidden'] = '1'
-        return data
-
-    def _set_config(self):
-        # The original register command is buggy--if you use .pypirc with a
-        # server-login section *at all* the repository you specify with the -r
-        # option will be overwritten with either the repository in .pypirc or
-        # with the default,
-        # If you do not have a .pypirc using the -r option will just crash.
-        # Way to go distutils
-
-        # If we don't set self.repository back to a default value _set_config
-        # can crash if there was a user-supplied value for this option; don't
-        # worry, we'll get the real value back afterwards
-        self.repository = 'pypi'
-        SetuptoolsRegister._set_config(self)
-        options = self.distribution.get_option_dict('register')
-        if 'repository' in options:
-            source, value = options['repository']
-            # Really anything that came from setup.cfg or the command line
-            # should override whatever was in .pypirc
-            self.repository = value
-
-
-if _module_state['have_sphinx']:
-    class AstropyBuildSphinx(SphinxBuildDoc):
-        """ A version of the ``build_sphinx`` command that uses the
-        version of Astropy that is built by the setup ``build`` command,
-        rather than whatever is installed on the system - to build docs
-        against the installed version, run ``make html`` in the
-        ``astropy/docs`` directory.
-
-        This also automatically creates the docs/_static directories -
-        this is needed because github won't create the _static dir
-        because it has no tracked files.
-        """
-
-        description = 'Build Sphinx documentation for Astropy environment'
-        user_options = SphinxBuildDoc.user_options[:]
-        user_options.append(('warnings-returncode', 'w',
-                             'Parses the sphinx output and sets the return '
-                             'code to 1 if there are any warnings. Note that '
-                             'this will cause the sphinx log to only update '
-                             'when it completes, rather than continuously as '
-                             'is normally the case.'))
-        user_options.append(('clean-docs', 'l',
-                             'Completely clean previous builds, including '
-                             'automodapi-generated files before building new '
-                             'ones'))
-        user_options.append(('no-intersphinx', 'n',
-                             'Skip intersphinx, even if conf.py says to use '
-                             'it'))
-        user_options.append(('open-docs-in-browser', 'o',
-                             'Open the docs in a browser (using the '
-                             'webbrowser module) if the build finishes '
-                             'successfully.'))
-
-        boolean_options = SphinxBuildDoc.boolean_options[:]
-        boolean_options.append('warnings-returncode')
-        boolean_options.append('clean-docs')
-        boolean_options.append('no-intersphinx')
-        boolean_options.append('open-docs-in-browser')
-
-        _self_iden_rex = re.compile(r"self\.([^\d\W][\w]+)", re.UNICODE)
-
-        def initialize_options(self):
-            SphinxBuildDoc.initialize_options(self)
-            self.clean_docs = False
-            self.no_intersphinx = False
-            self.open_docs_in_browser = False
-            self.warnings_returncode = False
-
-        def finalize_options(self):
-            #Clear out previous sphinx builds, if requested
-            if self.clean_docs:
-                dirstorm = [os.path.join(self.source_dir, 'api')]
-                if self.build_dir is None:
-                    dirstorm.append('docs/_build')
-                else:
-                    dirstorm.append(self.build_dir)
-
-                for d in dirstorm:
-                    if os.path.isdir(d):
-                        log.info('Cleaning directory ' + d)
-                        shutil.rmtree(d)
-                    else:
-                        log.info('Not cleaning directory ' + d + ' because '
-                                 'not present or not a directory')
-
-            SphinxBuildDoc.finalize_options(self)
-
-        def run(self):
-            # TODO: Break this method up into a few more subroutines and
-            # document them better
-            import webbrowser
-
-            if PY3:
-                from urllib.request import pathname2url
-            else:
-                from urllib import pathname2url
-
-            # This is used at the very end of `run` to decide if sys.exit should
-            # be called. If it's None, it won't be.
-            retcode = None
-
-            # If possible, create the _static dir
-            if self.build_dir is not None:
-                # the _static dir should be in the same place as the _build dir
-                # for Astropy
-                basedir, subdir = os.path.split(self.build_dir)
-                if subdir == '':  # the path has a trailing /...
-                    basedir, subdir = os.path.split(basedir)
-                staticdir = os.path.join(basedir, '_static')
-                if os.path.isfile(staticdir):
-                    raise DistutilsOptionError(
-                        'Attempted to build_sphinx in a location where' +
-                        staticdir + 'is a file.  Must be a directory.')
-                self.mkpath(staticdir)
-
-            #Now make sure Astropy is built and determine where it was built
-            build_cmd = self.reinitialize_command('build')
-            build_cmd.inplace = 0
-            self.run_command('build')
-            build_cmd = self.get_finalized_command('build')
-            build_cmd_path = os.path.abspath(build_cmd.build_lib)
-
-            ah_importer = pkgutil.get_importer('astropy_helpers')
-            ah_path = os.path.abspath(ah_importer.path)
-
-            #Now generate the source for and spawn a new process that runs the
-            #command.  This is needed to get the correct imports for the built
-            #version
-            runlines, runlineno = inspect.getsourcelines(SphinxBuildDoc.run)
-            subproccode = textwrap.dedent("""
-                from sphinx.setup_command import *
-
-                os.chdir({srcdir!r})
-                sys.path.insert(0, {build_cmd_path!r})
-                sys.path.insert(0, {ah_path!r})
-
-            """).format(build_cmd_path=build_cmd_path, ah_path=ah_path,
-                        srcdir=self.source_dir)
-            #runlines[1:] removes 'def run(self)' on the first line
-            subproccode += textwrap.dedent(''.join(runlines[1:]))
-
-            # All "self.foo" in the subprocess code needs to be replaced by the
-            # values taken from the current self in *this* process
-            subproccode = AstropyBuildSphinx._self_iden_rex.split(subproccode)
-            for i in range(1, len(subproccode), 2):
-                iden = subproccode[i]
-                val = getattr(self, iden)
-                if iden.endswith('_dir'):
-                    #Directories should be absolute, because the `chdir` call
-                    #in the new process moves to a different directory
-                    subproccode[i] = repr(os.path.abspath(val))
-                else:
-                    subproccode[i] = repr(val)
-            subproccode = ''.join(subproccode)
-
-            if self.no_intersphinx:
-                #the confoverrides variable in sphinx.setup_command.BuildDoc can
-                #be used to override the conf.py ... but this could well break
-                #if future versions of sphinx change the internals of BuildDoc,
-                #so remain vigilant!
-                subproccode = subproccode.replace('confoverrides = {}',
-                    'confoverrides = {\'intersphinx_mapping\':{}}')
-
-            log.debug('Starting subprocess of {0} with python code:\n{1}\n'
-                      '[CODE END])'.format(sys.executable, subproccode))
-
-            # To return the number of warnings, we need to capture stdout. This
-            # prevents a continuous updating at the terminal, but there's no
-            # apparent way around this.
-            if self.warnings_returncode:
-                proc = subprocess.Popen([sys.executable],
-                                        stdin=subprocess.PIPE,
-                                        stdout=subprocess.PIPE,
-                                        stderr=subprocess.STDOUT)
-                stdo, stde = proc.communicate(subproccode)
-
-                print(stdo)
-
-                stdolines = stdo.split('\n')
-
-                if stdolines[-2] == 'build succeeded.':
-                    retcode = 0
-                else:
-                    retcode = 1
-
-                if retcode != 0:
-                    if os.environ.get('TRAVIS', None) == 'true':
-                        #this means we are in the travis build, so customize
-                        #the message appropriately.
-                        msg = ('The build_sphinx travis build FAILED '
-                               'because sphinx issued documentation '
-                               'warnings (scroll up to see the warnings).')
-                    else:  # standard failure message
-                        msg = ('build_sphinx returning a non-zero exit '
-                               'code because sphinx issued documentation '
-                               'warnings.')
-                    log.warn(msg)
-
-            else:
-                proc = subprocess.Popen([sys.executable], stdin=subprocess.PIPE)
-                proc.communicate(subproccode.encode('utf-8'))
-
-            if proc.returncode == 0:
-                if self.open_docs_in_browser:
-                    if self.builder == 'html':
-                        absdir = os.path.abspath(self.builder_target_dir)
-                        index_path = os.path.join(absdir, 'index.html')
-                        fileurl = 'file://' + pathname2url(index_path)
-                        webbrowser.open(fileurl)
-                    else:
-                        log.warn('open-docs-in-browser option was given, but '
-                                 'the builder is not html! Ignogring.')
-            else:
-                log.warn('Sphinx Documentation subprocess failed with return '
-                         'code ' + str(proc.returncode))
-
-            if retcode is not None:
-                # this is potentially dangerous in that there might be something
-                # after the call to `setup` in `setup.py`, and exiting here will
-                # prevent that from running.  But there's no other apparent way
-                # to signal what the return code should be.
-                sys.exit(retcode)
-
-
-def get_distutils_display_options():
-    """ Returns a set of all the distutils display options in their long and
-    short forms.  These are the setup.py arguments such as --name or --version
-    which print the project's metadata and then exit.
-
-    Returns
-    -------
-    opts : set
-        The long and short form display option arguments, including the - or --
-    """
-
-    short_display_opts = set('-' + o[1] for o in Distribution.display_options
-                             if o[1])
-    long_display_opts = set('--' + o[0] for o in Distribution.display_options)
-
-    # Include -h and --help which are not explicitly listed in
-    # Distribution.display_options (as they are handled by optparse)
-    short_display_opts.add('-h')
-    long_display_opts.add('--help')
-
-    # This isn't the greatest approach to hardcode these commands.
-    # However, there doesn't seem to be a good way to determine
-    # whether build *will be* run as part of the command at this
-    # phase.
-    display_commands = set([
-        'clean', 'register', 'setopt', 'saveopts', 'egg_info',
-        'alias'])
-
-    return short_display_opts.union(long_display_opts.union(display_commands))
-
-
-def is_distutils_display_option():
-    """ Returns True if sys.argv contains any of the distutils display options
-    such as --version or --name.
-    """
-
-    display_options = get_distutils_display_options()
-    return bool(set(sys.argv[1:]).intersection(display_options))
-
-
-def update_package_files(srcdir, extensions, package_data, packagenames,
-                         package_dirs):
-    """
-    This function is deprecated and maintained for backward compatibility
-    with affiliated packages.  Affiliated packages should update their
-    setup.py to use `get_package_info` instead.
-    """
-
-    info = get_package_info(srcdir)
-    extensions.extend(info['ext_modules'])
-    package_data.update(info['package_data'])
-    packagenames = list(set(packagenames + info['packages']))
-    package_dirs.update(info['package_dir'])
-
-
-def get_package_info(srcdir='.', exclude=()):
-    """
-    Collates all of the information for building all subpackages
-    subpackages and returns a dictionary of keyword arguments that can
-    be passed directly to `distutils.setup`.
-
-    The purpose of this function is to allow subpackages to update the
-    arguments to the package's ``setup()`` function in its setup.py
-    script, rather than having to specify all extensions/package data
-    directly in the ``setup.py``.  See Astropy's own
-    ``setup.py`` for example usage and the Astropy development docs
-    for more details.
-
-    This function obtains that information by iterating through all
-    packages in ``srcdir`` and locating a ``setup_package.py`` module.
-    This module can contain the following functions:
-    ``get_extensions()``, ``get_package_data()``,
-    ``get_build_options()``, ``get_external_libraries()``,
-    and ``requires_2to3()``.
-
-    Each of those functions take no arguments.
-
-    - ``get_extensions`` returns a list of
-      `distutils.extension.Extension` objects.
-
-    - ``get_package_data()`` returns a dict formatted as required by
-      the ``package_data`` argument to ``setup()``.
-
-    - ``get_build_options()`` returns a list of tuples describing the
-      extra build options to add.
-
-    - ``get_external_libraries()`` returns
-      a list of libraries that can optionally be built using external
-      dependencies.
-
-    - ``requires_2to3()`` should return `True` when the source code
-      requires `2to3` processing to run on Python 3.x.  If
-      ``requires_2to3()`` is missing, it is assumed to return `True`.
-
-    """
-    ext_modules = []
-    packages = []
-    package_data = {}
-    package_dir = {}
-    skip_2to3 = []
-
-    # Use the find_packages tool to locate all packages and modules
-    packages = filter_packages(find_packages(srcdir, exclude=exclude))
-
-    # For each of the setup_package.py modules, extract any
-    # information that is needed to install them.  The build options
-    # are extracted first, so that their values will be available in
-    # subsequent calls to `get_extensions`, etc.
-    for setuppkg in iter_setup_packages(srcdir, packages):
-        if hasattr(setuppkg, 'get_build_options'):
-            options = setuppkg.get_build_options()
-            for option in options:
-                add_command_option('build', *option)
-        if hasattr(setuppkg, 'get_external_libraries'):
-            libraries = setuppkg.get_external_libraries()
-            for library in libraries:
-                add_external_library(library)
-        if hasattr(setuppkg, 'requires_2to3'):
-            requires_2to3 = setuppkg.requires_2to3()
-        else:
-            requires_2to3 = True
-        if not requires_2to3:
-            skip_2to3.append(
-                os.path.dirname(setuppkg.__file__))
-
-    for setuppkg in iter_setup_packages(srcdir, packages):
-        # get_extensions must include any Cython extensions by their .pyx
-        # filename.
-        if hasattr(setuppkg, 'get_extensions'):
-            ext_modules.extend(setuppkg.get_extensions())
-        if hasattr(setuppkg, 'get_package_data'):
-            package_data.update(setuppkg.get_package_data())
-
-    # Locate any .pyx files not already specified, and add their extensions in.
-    # The default include dirs include numpy to facilitate numerical work.
-    ext_modules.extend(get_cython_extensions(srcdir, packages, ext_modules,
-                                             ['numpy']))
-
-    # Now remove extensions that have the special name 'skip_cython', as they
-    # exist Only to indicate that the cython extensions shouldn't be built
-    for i, ext in reversed(list(enumerate(ext_modules))):
-        if ext.name == 'skip_cython':
-            del ext_modules[i]
-
-    # On Microsoft compilers, we need to pass the '/MANIFEST'
-    # commandline argument.  This was the default on MSVC 9.0, but is
-    # now required on MSVC 10.0, but it doesn't seeem to hurt to add
-    # it unconditionally.
-    if get_compiler_option() == 'msvc':
-        for ext in ext_modules:
-            ext.extra_link_args.append('/MANIFEST')
-
-    return {
-        'ext_modules': ext_modules,
-        'packages': packages,
-        'package_dir': package_dir,
-        'package_data': package_data,
-        'skip_2to3': skip_2to3
-        }
-
-
-def iter_setup_packages(srcdir, packages):
-    """ A generator that finds and imports all of the ``setup_package.py``
-    modules in the source packages.
-
-    Returns
-    -------
-    modgen : generator
-        A generator that yields (modname, mod), where `mod` is the module and
-        `modname` is the module name for the ``setup_package.py`` modules.
-
-    """
-
-    for packagename in packages:
-        package_parts = packagename.split('.')
-        package_path = os.path.join(srcdir, *package_parts)
-        setup_package = os.path.relpath(
-            os.path.join(package_path, 'setup_package.py'))
-
-        if os.path.isfile(setup_package):
-            module = import_file(setup_package)
-            yield module
-
-
-def iter_pyx_files(package_dir, package_name):
-    """
-    A generator that yields Cython source files (ending in '.pyx') in the
-    source packages.
-
-    Returns
-    -------
-    pyxgen : generator
-        A generator that yields (extmod, fullfn) where `extmod` is the
-        full name of the module that the .pyx file would live in based
-        on the source directory structure, and `fullfn` is the path to
-        the .pyx file.
-    """
-    for dirpath, dirnames, filenames in walk_skip_hidden(package_dir):
-        for fn in filenames:
-            if fn.endswith('.pyx'):
-                fullfn = os.path.relpath(os.path.join(dirpath, fn))
-                # Package must match file name
-                extmod = '.'.join([package_name, fn[:-4]])
-                yield (extmod, fullfn)
-
-        break  # Don't recurse into subdirectories
-
-
-def should_build_with_cython(package, release=None):
-    """Returns the previously used Cython version (or 'unknown' if not
-    previously built) if Cython should be used to build extension modules from
-    pyx files.  If the ``release`` parameter is not specified an attempt is
-    made to determine the release flag from `astropy.version`.
-    """
-
-    try:
-        version_module = __import__(package + '.cython_version',
-                                    fromlist=['release', 'cython_version'])
-    except ImportError:
-        version_module = None
-
-    if release is None and version_module is not None:
-        try:
-            release = version_module.release
-        except AttributeError:
-            pass
-
-    try:
-        cython_version = version_module.cython_version
-    except AttributeError:
-        cython_version = 'unknown'
-
-    # Only build with Cython if, of course, Cython is installed, we're in a
-    # development version (i.e. not release) or the Cython-generated source
-    # files haven't been created yet (cython_version == 'unknown'). The latter
-    # case can happen even when release is True if checking out a release tag
-    # from the repository
-    if (_module_state['have_cython'] and
-            (not release or cython_version == 'unknown')):
-        return cython_version
-    else:
-        return False
-
-
-def get_cython_extensions(srcdir, packages, prevextensions=tuple(),
-                          extincludedirs=None):
-    """
-    Looks for Cython files and generates Extensions if needed.
-
-    Parameters
-    ----------
-    srcdir : str
-        Path to the root of the source directory to search.
-    prevextensions : list of `~distutils.core.Extension` objects
-        The extensions that are already defined.  Any .pyx files already here
-        will be ignored.
-    extincludedirs : list of str or None
-        Directories to include as the `include_dirs` argument to the generated
-        `~distutils.core.Extension` objects.
-
-    Returns
-    -------
-    exts : list of `~distutils.core.Extension` objects
-        The new extensions that are needed to compile all .pyx files (does not
-        include any already in `prevextensions`).
-    """
-
-    # Vanilla setuptools and old versions of distribute include Cython files
-    # as .c files in the sources, not .pyx, so we cannot simply look for
-    # existing .pyx sources in the previous sources, but we should also check
-    # for .c files with the same remaining filename. So we look for .pyx and
-    # .c files, and we strip the extension.
-    prevsourcepaths = []
-    ext_modules = []
-
-    for ext in prevextensions:
-        for s in ext.sources:
-            if s.endswith(('.pyx', '.c')):
-                sourcepath = os.path.realpath(os.path.splitext(s)[0])
-                prevsourcepaths.append(sourcepath)
-
-    for package_name in packages:
-        package_parts = package_name.split('.')
-        package_path = os.path.join(srcdir, *package_parts)
-
-        for extmod, pyxfn in iter_pyx_files(package_path, package_name):
-            sourcepath = os.path.realpath(os.path.splitext(pyxfn)[0])
-            if sourcepath not in prevsourcepaths:
-                ext_modules.append(Extension(extmod, [pyxfn],
-                                             include_dirs=extincludedirs))
-
-    return ext_modules
-
-
-def write_if_different(filename, data):
-    """ Write `data` to `filename`, if the content of the file is different.
-
-    Parameters
-    ----------
-    filename : str
-        The file name to be written to.
-    data : bytes
-        The data to be written to `filename`.
-    """
-    assert isinstance(data, bytes)
-
-    if os.path.exists(filename):
-        with open(filename, 'rb') as fd:
-            original_data = fd.read()
-    else:
-        original_data = None
-
-    if original_data != data:
-        with open(filename, 'wb') as fd:
-            fd.write(data)
-
-
-def get_numpy_include_path():
-    """
-    Gets the path to the numpy headers.
-    """
-    # We need to go through this nonsense in case setuptools
-    # downloaded and installed Numpy for us as part of the build or
-    # install, since Numpy may still think it's in "setup mode", when
-    # in fact we're ready to use it to build astropy now.
-
-    if sys.version_info[0] >= 3:
-        import builtins
-        if hasattr(builtins, '__NUMPY_SETUP__'):
-            del builtins.__NUMPY_SETUP__
-        import imp
-        import numpy
-        imp.reload(numpy)
-    else:
-        import __builtin__
-        if hasattr(__builtin__, '__NUMPY_SETUP__'):
-            del __builtin__.__NUMPY_SETUP__
-        import numpy
-        reload(numpy)
-
-    try:
-        numpy_include = numpy.get_include()
-    except AttributeError:
-        numpy_include = numpy.get_numpy_include()
-    return numpy_include
-
-
-def import_file(filename):
-    """
-    Imports a module from a single file as if it doesn't belong to a
-    particular package.
-    """
-    # Specifying a traditional dot-separated fully qualified name here
-    # results in a number of "Parent module 'astropy' not found while
-    # handling absolute import" warnings.  Using the same name, the
-    # namespaces of the modules get merged together.  So, this
-    # generates an underscore-separated name which is more likely to
-    # be unique, and it doesn't really matter because the name isn't
-    # used directly here anyway.
-    with open(filename, 'U') as fd:
-        name = '_'.join(
-            os.path.relpath(os.path.splitext(filename)[0]).split(os.sep)[1:])
-        return imp.load_module(name, fd, filename, ('.py', 'U', 1))
-
-
-class DistutilsExtensionArgs(collections.defaultdict):
-    """
-    A special dictionary whose default values are the empty list.
-
-    This is useful for building up a set of arguments for
-    `distutils.Extension` without worrying whether the entry is
-    already present.
-    """
-    def __init__(self, *args, **kwargs):
-        def default_factory():
-            return []
-
-        super(DistutilsExtensionArgs, self).__init__(
-            default_factory, *args, **kwargs)
-
-    def update(self, other):
-        for key, val in other.items():
-            self[key].extend(val)
-
-
-def pkg_config(packages, default_libraries, executable='pkg-config'):
-    """
-    Uses pkg-config to update a set of distutils Extension arguments
-    to include the flags necessary to link against the given packages.
-
-    If the pkg-config lookup fails, default_libraries is applied to
-    libraries.
-
-    Parameters
-    ----------
-    packages : list of str
-        A list of pkg-config packages to look up.
-
-    default_libraries : list of str
-        A list of library names to use if the pkg-config lookup fails.
-
-    Returns
-    -------
-    config : dict
-        A dictionary containing keyword arguments to
-        `distutils.Extension`.  These entries include:
-
-        - ``include_dirs``: A list of include directories
-        - ``library_dirs``: A list of library directories
-        - ``libraries``: A list of libraries
-        - ``define_macros``: A list of macro defines
-        - ``undef_macros``: A list of macros to undefine
-        - ``extra_compile_args``: A list of extra arguments to pass to
-          the compiler
-    """
-
-    flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries',
-                '-D': 'define_macros', '-U': 'undef_macros'}
-    command = "{0} --libs --cflags {1}".format(executable, ' '.join(packages)),
-
-    result = DistutilsExtensionArgs()
-
-    try:
-        pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
-        output = pipe.communicate()[0].strip()
-    except subprocess.CalledProcessError as e:
-        lines = [
-            "{0} failed.  This may cause the build to fail below.".format(executable),
-            "  command: {0}".format(e.cmd),
-            "  returncode: {0}".format(e.returncode),
-            "  output: {0}".format(e.output)
-            ]
-        log.warn('\n'.join(lines))
-        result['libraries'].extend(default_libraries)
-    else:
-        if pipe.returncode != 0:
-            lines = [
-                "pkg-config could not lookup up package(s) {0}.".format(
-                    ", ".join(packages)),
-                "This may cause the build to fail below."
-                ]
-            log.warn('\n'.join(lines))
-            result['libraries'].extend(default_libraries)
-        else:
-            for token in output.split():
-                # It's not clear what encoding the output of
-                # pkg-config will come to us in.  It will probably be
-                # some combination of pure ASCII (for the compiler
-                # flags) and the filesystem encoding (for any argument
-                # that includes directories or filenames), but this is
-                # just conjecture, as the pkg-config documentation
-                # doesn't seem to address it.
-                arg = token[:2].decode('ascii')
-                value = token[2:].decode(sys.getfilesystemencoding())
-                if arg in flag_map:
-                    if arg == '-D':
-                        value = tuple(value.split('=', 1))
-                    result[flag_map[arg]].append(value)
-                else:
-                    result['extra_compile_args'].append(value)
-
-    return result
-
-
-def add_external_library(library):
-    """
-    Add a build option for selecting the internal or system copy of a library.
-
-    Parameters
-    ----------
-    library : str
-        The name of the library.  If the library is `foo`, the build
-        option will be called `--use-system-foo`.
-    """
-
-    for command in ['build', 'build_ext', 'install']:
-        add_command_option(command, str('use-system-' + library),
-                           'Use the system {0} library'.format(library),
-                           is_bool=True)
-
-
-def use_system_library(library):
-    """
-    Returns `True` if the build configuration indicates that the given
-    library should use the system copy of the library rather than the
-    internal one.
-
-    For the given library `foo`, this will be `True` if
-    `--use-system-foo` or `--use-system-libraries` was provided at the
-    commandline or in `setup.cfg`.
-
-    Parameters
-    ----------
-    library : str
-        The name of the library
-
-    Returns
-    -------
-    use_system : bool
-        `True` if the build should use the system copy of the library.
-    """
-    return (
-        get_distutils_build_or_install_option('use_system_{0}'.format(library))
-        or get_distutils_build_or_install_option('use_system_libraries'))
-
-
-def filter_packages(packagenames):
-    """
-    Removes some packages from the package list that shouldn't be
-    installed on the current version of Python.
-    """
-
-    if PY3:
-        exclude = '_py2'
-    else:
-        exclude = '_py3'
-
-    return [x for x in packagenames if not x.endswith(exclude)]
-
-
-class FakeBuildSphinx(Command):
-    """
-    A dummy build_sphinx command that is called if Sphinx is not
-    installed and displays a relevant error message
-    """
-
-    #user options inherited from sphinx.setup_command.BuildDoc
-    user_options = [
-         ('fresh-env', 'E', '' ),
-         ('all-files', 'a', ''),
-         ('source-dir=', 's', ''),
-         ('build-dir=', None, ''),
-         ('config-dir=', 'c', ''),
-         ('builder=', 'b', ''),
-         ('project=', None, ''),
-         ('version=', None, ''),
-         ('release=', None, ''),
-         ('today=', None, ''),
-         ('link-index', 'i', ''),
-     ]
-
-    #user options appended in astropy.setup_helpers.AstropyBuildSphinx
-    user_options.append(('warnings-returncode', 'w',''))
-    user_options.append(('clean-docs', 'l', ''))
-    user_options.append(('no-intersphinx', 'n', ''))
-    user_options.append(('open-docs-in-browser', 'o',''))
-
-
-
-    def initialize_options(self):
-        try:
-            raise RuntimeError("Sphinx must be installed for build_sphinx")
-        except:
-            log.error('error : Sphinx must be installed for build_sphinx')
-            sys.exit(1)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/__init__.py
deleted file mode 100644
index e446ac0..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""
-This package contains utilities and extensions for the Astropy sphinx
-documentation.  In particular, the `astropy.sphinx.conf` should be imported by
-the sphinx ``conf.py`` file for affiliated packages that wish to make use of
-the Astropy documentation format.
-"""
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/conf.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/conf.py
deleted file mode 100644
index e32dd87..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/conf.py
+++ /dev/null
@@ -1,310 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-#
-# Astropy shared Sphinx settings.  These settings are shared between
-# astropy itself and affiliated packages.
-#
-# Note that not all possible configuration values are present in this file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import warnings
-
-from os import path
-
-
-# -- General configuration ----------------------------------------------------
-
-# The version check in Sphinx itself can only compare the major and
-# minor parts of the version number, not the micro.  To do a more
-# specific version check, call check_sphinx_version("x.y.z.") from
-# your project's conf.py
-needs_sphinx = '1.2'
-
-
-def check_sphinx_version(expected_version):
-    import sphinx
-    from distutils import version
-
-    sphinx_version = version.LooseVersion(sphinx.__version__)
-    expected_version = version.LooseVersion(expected_version)
-    if sphinx_version < expected_version:
-        raise RuntimeError(
-            "At least Sphinx version {0} is required to build this "
-            "documentation.  Found {1}.".format(
-                expected_version, sphinx_version))
-
-
-# Configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {
-    'python': ('http://docs.python.org/', None),
-    'python3': ('http://docs.python.org/3/', path.abspath(path.join(path.dirname(__file__), 'local/python3links.inv'))),
-    'numpy': ('http://docs.scipy.org/doc/numpy/', None),
-    'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
-    'matplotlib': ('http://matplotlib.sourceforge.net/', None),
-    'astropy': ('http://docs.astropy.org/en/stable/', None),
-    'h5py': ('http://docs.h5py.org/en/latest/', None)
-    }
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# Add any paths that contain templates here, relative to this directory.
-# templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents. Set to the "smart" one.
-default_role = 'obj'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# This is added to the end of RST files - a good place to put substitutions to
-# be used globally.
-rst_epilog = """
-.. _Astropy: http://astropy.org
-"""
-
-
-# -- Project information ------------------------------------------------------
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-#pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Settings for extensions and extension options ----------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
-    'sphinx.ext.autodoc',
-    'sphinx.ext.intersphinx',
-    'sphinx.ext.todo',
-    'sphinx.ext.coverage',
-    'sphinx.ext.pngmath',
-    'sphinx.ext.inheritance_diagram',
-    'astropy_helpers.sphinx.ext.numpydoc',
-    'astropy_helpers.sphinx.ext.astropyautosummary',
-    'astropy_helpers.sphinx.ext.automodsumm',
-    'astropy_helpers.sphinx.ext.automodapi',
-    'astropy_helpers.sphinx.ext.tocdepthfix',
-    'astropy_helpers.sphinx.ext.doctest',
-    'astropy_helpers.sphinx.ext.changelog_links',
-    'astropy_helpers.sphinx.ext.viewcode',  # Use patched version of viewcode
-    'astropy_helpers.sphinx.ext.smart_resolver'
-    ]
-
-# Above, we use a patched version of viewcode rather than 'sphinx.ext.viewcode'
-# This can be changed to the sphinx version once the following issue is fixed
-# in sphinx:
-# https://bitbucket.org/birkenfeld/sphinx/issue/623/
-# extension-viewcode-fails-with-function
-
-try:
-    import matplotlib.sphinxext.plot_directive
-    extensions += [matplotlib.sphinxext.plot_directive.__name__]
-# AttributeError is checked here in case matplotlib is installed but
-# Sphinx isn't.  Note that this module is imported by the config file
-# generator, even if we're not building the docs.
-except (ImportError, AttributeError):
-    warnings.warn(
-        "matplotlib's plot_directive could not be imported. " +
-        "Inline plots will not be included in the output")
-
-# Don't show summaries of the members in each class along with the
-# class' docstring
-numpydoc_show_class_members = False
-
-autosummary_generate = True
-
-automodapi_toctreedirnm = 'api'
-
-# Class documentation should contain *both* the class docstring and
-# the __init__ docstring
-autoclass_content = "both"
-
-
-# -- Options for HTML output -------------------------------------------------
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = [path.abspath(path.join(path.dirname(__file__), 'themes'))]
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'bootstrap-astropy'
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {
-    '**': ['localtoc.html'],
-    'search': [],
-    'genindex': [],
-    'py-modindex': [],
-}
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-
-# included in the bootstrap-astropy theme
-html_favicon = path.join(html_theme_path[0], html_theme, 'static',
-                         'astropy_logo.ico')
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-html_last_updated_fmt = '%d %b %Y'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# -- Options for LaTeX output ------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-latex_use_parts = True
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Additional stuff for the LaTeX preamble.
-latex_preamble = r"""
-% Use a more modern-looking monospace font
-\usepackage{inconsolata}
-
-% The enumitem package provides unlimited nesting of lists and enums.
-% Sphinx may use this in the future, in which case this can be removed.
-% See https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested
-\usepackage{enumitem}
-\setlistdepth{15}
-
-% In the parameters section, place a newline after the Parameters
-% header.  (This is stolen directly from Numpy's conf.py, since it
-% affects Numpy-style docstrings).
-\usepackage{expdlist}
-\let\latexdescription=\description
-\def\description{\latexdescription{}{} \breaklabel}
-
-% Support the superscript Unicode numbers used by the "unicode" units
-% formatter
-\DeclareUnicodeCharacter{2070}{\ensuremath{^0}}
-\DeclareUnicodeCharacter{00B9}{\ensuremath{^1}}
-\DeclareUnicodeCharacter{00B2}{\ensuremath{^2}}
-\DeclareUnicodeCharacter{00B3}{\ensuremath{^3}}
-\DeclareUnicodeCharacter{2074}{\ensuremath{^4}}
-\DeclareUnicodeCharacter{2075}{\ensuremath{^5}}
-\DeclareUnicodeCharacter{2076}{\ensuremath{^6}}
-\DeclareUnicodeCharacter{2077}{\ensuremath{^7}}
-\DeclareUnicodeCharacter{2078}{\ensuremath{^8}}
-\DeclareUnicodeCharacter{2079}{\ensuremath{^9}}
-\DeclareUnicodeCharacter{207B}{\ensuremath{^-}}
-\DeclareUnicodeCharacter{00B0}{\ensuremath{^{\circ}}}
-\DeclareUnicodeCharacter{2032}{\ensuremath{^{\prime}}}
-\DeclareUnicodeCharacter{2033}{\ensuremath{^{\prime\prime}}}
-
-% Make the "warning" and "notes" sections use a sans-serif font to
-% make them stand out more.
-\renewenvironment{notice}[2]{
-  \def\py at noticetype{#1}
-  \csname py at noticestart@#1\endcsname
-  \textsf{\textbf{#2}}
-}{\csname py at noticeend@\py at noticetype\endcsname}
-"""
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# -- Options for the linkcheck builder ----------------------------------------
-
-# A timeout value, in seconds, for the linkcheck builder
-linkcheck_timeout = 60
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/__init__.py
deleted file mode 100644
index 0fce2cf..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-from .numpydoc import setup
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/astropyautosummary.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/astropyautosummary.py
deleted file mode 100644
index 70e4051..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/astropyautosummary.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension builds off of `sphinx.ext.autosummary` to
-clean up some issues it presents in the Astropy docs.
-
-The main issue this fixes is the summary tables getting cut off before the
-end of the sentence in some cases.
-
-"""
-import re
-
-from sphinx.ext.autosummary import Autosummary
-
-# used in AstropyAutosummary.get_items
-_itemsummrex = re.compile(r'^([A-Z].*?\.(?:\s|$))')
-
-
-class AstropyAutosummary(Autosummary):
-    def get_items(self, names):
-        """Try to import the given names, and return a list of
-        ``[(name, signature, summary_string, real_name), ...]``.
-        """
-        from sphinx.ext.autosummary import (get_import_prefixes_from_env,
-            import_by_name, get_documenter, mangle_signature)
-
-        env = self.state.document.settings.env
-
-        prefixes = get_import_prefixes_from_env(env)
-
-        items = []
-
-        max_item_chars = 50
-
-        for name in names:
-            display_name = name
-            if name.startswith('~'):
-                name = name[1:]
-                display_name = name.split('.')[-1]
-
-            try:
-                import_by_name_values = import_by_name(name, prefixes=prefixes)
-            except ImportError:
-                self.warn('[astropyautosummary] failed to import %s' % name)
-                items.append((name, '', '', name))
-                continue
-
-            # to accommodate Sphinx v1.2.2 and v1.2.3
-            if len(import_by_name_values) == 3:
-                real_name, obj, parent = import_by_name_values
-            elif len(import_by_name_values) == 4:
-                real_name, obj, parent, module_name = import_by_name_values
-
-            # NB. using real_name here is important, since Documenters
-            #     handle module prefixes slightly differently
-            documenter = get_documenter(obj, parent)(self, real_name)
-            if not documenter.parse_name():
-                self.warn('[astropyautosummary] failed to parse name %s' % real_name)
-                items.append((display_name, '', '', real_name))
-                continue
-            if not documenter.import_object():
-                self.warn('[astropyautosummary] failed to import object %s' % real_name)
-                items.append((display_name, '', '', real_name))
-                continue
-
-            # -- Grab the signature
-
-            sig = documenter.format_signature()
-            if not sig:
-                sig = ''
-            else:
-                max_chars = max(10, max_item_chars - len(display_name))
-                sig = mangle_signature(sig, max_chars=max_chars)
-                sig = sig.replace('*', r'\*')
-
-            # -- Grab the summary
-
-            doc = list(documenter.process_doc(documenter.get_doc()))
-
-            while doc and not doc[0].strip():
-                doc.pop(0)
-            m = _itemsummrex.search(" ".join(doc).strip())
-            if m:
-                summary = m.group(1).strip()
-            elif doc:
-                summary = doc[0].strip()
-            else:
-                summary = ''
-
-            items.append((display_name, sig, summary, real_name))
-
-        return items
-
-
-def setup(app):
-    # need autosummary, of course
-    app.setup_extension('sphinx.ext.autosummary')
-    # this replaces the default autosummary with the astropy one
-    app.add_directive('autosummary', AstropyAutosummary)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodapi.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodapi.py
deleted file mode 100644
index d9320e9..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodapi.py
+++ /dev/null
@@ -1,350 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension adds a tools to simplify generating the API
-documentation for Astropy packages and affiliated packages.
-
-.. _automodapi:
-
-========================
-automodapi directive
-========================
-This directive takes a single argument that must be a module or package. It
-will produce a block of documentation that includes the docstring for the
-package, an :ref:`automodsumm` directive, and an :ref:`automod-diagram` if
-there are any classes in the module. If only the main docstring of the
-module/package is desired in the documentation, use `automodule`_ instead of
-`automodapi`_.
-
-It accepts the following options:
-
-    * ``:no-inheritance-diagram:``
-        If present, the inheritance diagram will not be shown even if
-        the module/package has classes.
-
-    * ``:skip: str``
-        This option results in the
-        specified object being skipped, that is the object will *not* be
-        included in the generated documentation. This option may appear
-        any number of times to skip multiple objects.
-
-    * ``:no-main-docstr:``
-        If present, the docstring for the module/package will not be generated.
-        The function and class tables will still be used, however.
-
-    * ``:headings: str``
-        Specifies the characters (in one string) used as the heading
-        levels used for the generated section. This must have at least 2
-        characters (any after 2 will be ignored). This also *must* match
-        the rest of the documentation on this page for sphinx to be
-        happy. Defaults to "-^", which matches the convention used for
-        Python's documentation, assuming the automodapi call is inside a
-        top-level section (which usually uses '=').
-
-    * ``:no-heading:``
-        If specified do not create a top level heading for the section.
-        That is, do not create a title heading with text like "packagename
-        Package".  The actual docstring for the package/module will still be
-        shown, though, unless ``:no-main-docstr:`` is given.
-
-    * ``:allowed-package-names: str``
-        Specifies the packages that functions/classes documented here are
-        allowed to be from, as comma-separated list of package names. If not
-        given, only objects that are actually in a subpackage of the package
-        currently being documented are included.
-
-This extension also adds two sphinx configuration options:
-
-* ``automodapi_toctreedirnm``
-    This must be a string that specifies the name of the directory the
-    automodsumm generated documentation ends up in. This directory path should
-    be relative to the documentation root (e.g., same place as ``index.rst``).
-    Defaults to ``'api'``.
-
-* ``automodapi_writereprocessed``
-    Should be a bool, and if `True`, will cause `automodapi`_ to write files
-    with any `automodapi`_ sections replaced with the content Sphinx
-    processes after `automodapi`_ has run.  The output files are not
-    actually used by sphinx, so this option is only for figuring out the
-    cause of sphinx warnings or other debugging.  Defaults to `False`.
-
-.. _automodule: http://sphinx-doc.org/latest/ext/autodoc.html?highlight=automodule#directive-automodule
-"""
-
-# Implementation note:
-# The 'automodapi' directive is not actually implemented as a docutils
-# directive. Instead, this extension searches for the 'automodapi' text in
-# all sphinx documents, and replaces it where necessary from a template built
-# into this extension. This is necessary because automodsumm (and autosummary)
-# use the "builder-inited" event, which comes before the directives are
-# actually built.
-
-import inspect
-import os
-import re
-import sys
-
-from .utils import find_mod_objs
-
-
-automod_templ_modheader = """
-{modname} {pkgormod}
-{modhds}{pkgormodhds}
-
-{automoduleline}
-"""
-
-automod_templ_classes = """
-Classes
-{clshds}
-
-.. automodsumm:: {modname}
-    :classes-only:
-    {clsfuncoptions}
-"""
-
-automod_templ_funcs = """
-Functions
-{funchds}
-
-.. automodsumm:: {modname}
-    :functions-only:
-    {clsfuncoptions}
-"""
-
-automod_templ_inh = """
-Class Inheritance Diagram
-{clsinhsechds}
-
-.. automod-diagram:: {modname}
-    :private-bases:
-    :parts: 1
-    {allowedpkgnms}
-"""
-
-_automodapirex = re.compile(r'^(?:\s*\.\.\s+automodapi::\s*)([A-Za-z0-9_.]+)'
-                            r'\s*$((?:\n\s+:[a-zA-Z_\-]+:.*$)*)',
-                            flags=re.MULTILINE)
-# the last group of the above regex is intended to go into finall with the below
-_automodapiargsrex = re.compile(r':([a-zA-Z_\-]+):(.*)$', flags=re.MULTILINE)
-
-
-def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
-                       warnings=True):
-    """
-    Replaces `sourcestr`'s entries of ".. automdapi::" with the
-    automodapi template form based on provided options.
-
-    This is used with the sphinx event 'source-read' to replace
-    `automodapi`_ entries before sphinx actually processes them, as
-    automodsumm needs the code to be present to generate stub
-    documentation.
-
-    Parameters
-    ----------
-    sourcestr : str
-        The string with sphinx source to be checked for automodapi
-        replacement.
-    app : `sphinx.application.Application`
-        The sphinx application.
-    dotoctree : bool
-        If `True`, a ":toctree:" option will be added in the "..
-        automodsumm::" sections of the template, pointing to the
-        appropriate "generated" directory based on the Astropy convention
-        (e.g. in ``docs/api``)
-    docname : str
-        The name of the file for this `sourcestr` (if known - if not, it
-        can be `None`). If not provided and `dotoctree` is `True`, the
-        generated files may end up in the wrong place.
-    warnings : bool
-        If `False`, all warnings that would normally be issued are
-        silenced.
-
-    Returns
-    -------
-    newstr :str
-        The string with automodapi entries replaced with the correct
-        sphinx markup.
-    """
-
-    spl = _automodapirex.split(sourcestr)
-    if len(spl) > 1:  # automodsumm is in this document
-
-        if dotoctree:
-            toctreestr = ':toctree: '
-            dirnm = app.config.automodapi_toctreedirnm
-            if not dirnm.endswith(os.sep):
-                dirnm += os.sep
-            if docname is not None:
-                toctreestr += '../' * docname.count('/') + dirnm
-            else:
-                toctreestr += dirnm
-        else:
-            toctreestr = ''
-
-        newstrs = [spl[0]]
-        for grp in range(len(spl) // 3):
-            modnm = spl[grp * 3 + 1]
-
-            # find where this is in the document for warnings
-            if docname is None:
-                location = None
-            else:
-                location = (docname, spl[0].count('\n'))
-
-            # initialize default options
-            toskip = []
-            inhdiag = maindocstr = top_head = True
-            hds = '-^'
-            allowedpkgnms = []
-
-            # look for actual options
-            unknownops = []
-            for opname, args in _automodapiargsrex.findall(spl[grp * 3 + 2]):
-                if opname == 'skip':
-                    toskip.append(args.strip())
-                elif opname == 'no-inheritance-diagram':
-                    inhdiag = False
-                elif opname == 'no-main-docstr':
-                    maindocstr = False
-                elif opname == 'headings':
-                    hds = args
-                elif opname == 'no-heading':
-                    top_head = False
-                elif opname == 'allowed-package-names':
-                    allowedpkgnms.append(args.strip())
-                else:
-                    unknownops.append(opname)
-
-            #join all the allowedpkgnms
-            if len(allowedpkgnms) == 0:
-                allowedpkgnms = ''
-                onlylocals = True
-            else:
-                allowedpkgnms = ':allowed-package-names: ' + ','.join(allowedpkgnms)
-                onlylocals = allowedpkgnms
-
-            # get the two heading chars
-            if len(hds) < 2:
-                msg = 'Not enough headings (got {0}, need 2), using default -^'
-                if warnings:
-                    app.warn(msg.format(len(hds)), location)
-                hds = '-^'
-            h1, h2 = hds.lstrip()[:2]
-
-            # tell sphinx that the remaining args are invalid.
-            if len(unknownops) > 0 and app is not None:
-                opsstrs = ','.join(unknownops)
-                msg = 'Found additional options ' + opsstrs + ' in automodapi.'
-                if warnings:
-                    app.warn(msg, location)
-
-            ispkg, hascls, hasfuncs = _mod_info(modnm, toskip, onlylocals=onlylocals)
-
-            # add automodule directive only if no-main-docstr isn't present
-            if maindocstr:
-                automodline = '.. automodule:: {modname}'.format(modname=modnm)
-            else:
-                automodline = ''
-            if top_head:
-                newstrs.append(automod_templ_modheader.format(modname=modnm,
-                    modhds=h1 * len(modnm),
-                    pkgormod='Package' if ispkg else 'Module',
-                    pkgormodhds=h1 * (8 if ispkg else 7),
-                    automoduleline=automodline))
-            else:
-                newstrs.append(automod_templ_modheader.format(
-                    modname='',
-                    modhds='',
-                    pkgormod='',
-                    pkgormodhds='',
-                    automoduleline=automodline))
-
-            #construct the options for the class/function sections
-            #start out indented at 4 spaces, but need to keep the indentation.
-            clsfuncoptions = []
-            if toctreestr:
-                clsfuncoptions.append(toctreestr)
-            if toskip:
-                clsfuncoptions.append(':skip: ' + ','.join(toskip))
-            if allowedpkgnms:
-                clsfuncoptions.append(allowedpkgnms)
-            clsfuncoptionstr = '\n    '.join(clsfuncoptions)
-
-            if hasfuncs:
-                newstrs.append(automod_templ_funcs.format(
-                    modname=modnm,
-                    funchds=h2 * 9,
-                    clsfuncoptions=clsfuncoptionstr))
-
-            if hascls:
-                newstrs.append(automod_templ_classes.format(
-                    modname=modnm,
-                    clshds=h2 * 7,
-                    clsfuncoptions=clsfuncoptionstr))
-
-            if inhdiag and hascls:
-                # add inheritance diagram if any classes are in the module
-                newstrs.append(automod_templ_inh.format(
-                    modname=modnm,
-                    clsinhsechds=h2 * 25,
-                    allowedpkgnms=allowedpkgnms))
-
-            newstrs.append(spl[grp * 3 + 3])
-
-        newsourcestr = ''.join(newstrs)
-
-        if app.config.automodapi_writereprocessed:
-            # sometimes they are unicode, sometimes not, depending on how
-            # sphinx has processed things
-            if isinstance(newsourcestr, unicode):
-                ustr = newsourcestr
-            else:
-                ustr = newsourcestr.decode(app.config.source_encoding)
-
-            if docname is None:
-                with open(os.path.join(app.srcdir, 'unknown.automodapi'), 'a') as f:
-                    f.write('\n**NEW DOC**\n\n')
-                    f.write(ustr.encode('utf8'))
-            else:
-                with open(os.path.join(app.srcdir, docname + '.automodapi'), 'w') as f:
-                    f.write(ustr.encode('utf8'))
-
-        return newsourcestr
-    else:
-        return sourcestr
-
-
-def _mod_info(modname, toskip=[], onlylocals=True):
-    """
-    Determines if a module is a module or a package and whether or not
-    it has classes or functions.
-    """
-
-    hascls = hasfunc = False
-
-    for localnm, fqnm, obj in zip(*find_mod_objs(modname, onlylocals=onlylocals)):
-        if localnm not in toskip:
-            hascls = hascls or inspect.isclass(obj)
-            hasfunc = hasfunc or inspect.isroutine(obj)
-            if hascls and hasfunc:
-                break
-
-    # find_mod_objs has already imported modname
-    pkg = sys.modules[modname]
-    ispkg = '__init__.' in os.path.split(pkg.__name__)[1]
-
-    return ispkg, hascls, hasfunc
-
-
-def process_automodapi(app, docname, source):
-    source[0] = automodapi_replace(source[0], app, True, docname)
-
-
-def setup(app):
-    # need automodsumm for automodapi
-    app.setup_extension('astropy_helpers.sphinx.ext.automodsumm')
-
-    app.connect('source-read', process_automodapi)
-
-    app.add_config_value('automodapi_toctreedirnm', 'api', True)
-    app.add_config_value('automodapi_writereprocessed', False, True)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodsumm.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodsumm.py
deleted file mode 100644
index 353680b..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/automodsumm.py
+++ /dev/null
@@ -1,581 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension adds two directives for summarizing the public
-members of a module or package.
-
-These directives are primarily for use with the `automodapi`_ extension,
-but can be used independently.
-
-.. _automodsumm:
-
-=======================
-automodsumm directive
-=======================
-
-This directive will produce an "autosummary"-style table for public
-attributes of a specified module. See the `sphinx.ext.autosummary`_ extension
-for details on this process. The main difference from the `autosummary`_
-directive is that `autosummary`_ requires manually inputting all attributes
-that appear in the table, while this captures the entries automatically.
-
-This directive requires a single argument that must be a module or
-package.
-
-It also accepts any options supported by the `autosummary`_ directive-
-see `sphinx.ext.autosummary`_ for details. It also accepts two additional
-options:
-
-    * ``:classes-only:``
-        If present, the autosummary table will only contain entries for
-        classes. This cannot be used at the same time with
-        ``:functions-only:`` .
-
-    * ``:functions-only:``
-        If present, the autosummary table will only contain entries for
-        functions. This cannot be used at the same time with
-        ``:classes-only:`` .
-
-    * ``:skip: obj1, [obj2, obj3, ...]``
-        If present, specifies that the listed objects should be skipped
-        and not have their documentation generated, nor be includded in
-        the summary table.
-
-    * ``:allowed-package-names: pkgormod1, [pkgormod2, pkgormod3, ...]``
-        Specifies the packages that functions/classes documented here are
-        allowed to be from, as comma-separated list of package names. If not
-        given, only objects that are actually in a subpackage of the package
-        currently being documented are included.
-
-This extension also adds one sphinx configuration option:
-
-* ``automodsumm_writereprocessed``
-    Should be a bool, and if True, will cause `automodsumm`_ to write files
-    with any ``automodsumm`` sections replaced with the content Sphinx
-    processes after ``automodsumm`` has run.  The output files are not
-    actually used by sphinx, so this option is only for figuring out the
-    cause of sphinx warnings or other debugging.  Defaults to `False`.
-
-.. _sphinx.ext.autosummary: http://sphinx-doc.org/latest/ext/autosummary.html
-.. _autosummary: http://sphinx-doc.org/latest/ext/autosummary.html#directive-autosummary
-
-.. _automod-diagram:
-
-===========================
-automod-diagram directive
-===========================
-
-This directive will produce an inheritance diagram like that of the
-`sphinx.ext.inheritance_diagram`_ extension.
-
-This directive requires a single argument that must be a module or
-package. It accepts no options.
-
-.. note::
-    Like 'inheritance-diagram', 'automod-diagram' requires
-    `graphviz <http://www.graphviz.org/>`_ to generate the inheritance diagram.
-
-.. _sphinx.ext.inheritance_diagram: http://sphinx-doc.org/latest/ext/inheritance.html
-"""
-
-import inspect
-import os
-import re
-
-from sphinx.ext.autosummary import Autosummary
-from sphinx.ext.inheritance_diagram import InheritanceDiagram
-from docutils.parsers.rst.directives import flag
-
-from .utils import find_mod_objs
-from .astropyautosummary import AstropyAutosummary
-
-
-def _str_list_converter(argument):
-    """
-    A directive option conversion function that converts the option into a list
-    of strings. Used for 'skip' option.
-    """
-    if argument is None:
-        return []
-    else:
-        return [s.strip() for s in argument.split(',')]
-
-
-class Automodsumm(AstropyAutosummary):
-    required_arguments = 1
-    optional_arguments = 0
-    final_argument_whitespace = False
-    has_content = False
-    option_spec = dict(Autosummary.option_spec)
-    option_spec['functions-only'] = flag
-    option_spec['classes-only'] = flag
-    option_spec['skip'] = _str_list_converter
-    option_spec['allowed-package-names'] = _str_list_converter
-
-    def run(self):
-        env = self.state.document.settings.env
-        modname = self.arguments[0]
-
-        self.warnings = []
-        nodelist = []
-
-        try:
-            localnames, fqns, objs = find_mod_objs(modname)
-        except ImportError:
-            self.warnings = []
-            self.warn("Couldn't import module " + modname)
-            return self.warnings
-
-        try:
-            # set self.content to trick the Autosummary internals.
-            # Be sure to respect functions-only and classes-only.
-            funconly = 'functions-only' in self.options
-            clsonly = 'classes-only' in self.options
-
-            skipnames = []
-            if 'skip' in self.options:
-                option_skipnames = set(self.options['skip'])
-                for lnm in localnames:
-                    if lnm in option_skipnames:
-                        option_skipnames.remove(lnm)
-                        skipnames.append(lnm)
-                if len(option_skipnames) > 0:
-                    self.warn('Tried to skip objects {objs} in module {mod}, '
-                              'but they were not present.  Ignoring.'.format(
-                              objs=option_skipnames, mod=modname))
-
-            if funconly and not clsonly:
-                cont = []
-                for nm, obj in zip(localnames, objs):
-                    if nm not in skipnames and inspect.isroutine(obj):
-                        cont.append(nm)
-            elif clsonly:
-                cont = []
-                for nm, obj in zip(localnames, objs):
-                    if nm not in skipnames and inspect.isclass(obj):
-                        cont.append(nm)
-            else:
-                if clsonly and funconly:
-                    self.warning('functions-only and classes-only both '
-                                 'defined. Skipping.')
-                cont = [nm for nm in localnames if nm not in skipnames]
-
-            self.content = cont
-
-            #for some reason, even though ``currentmodule`` is substituted in, sphinx
-            #doesn't necessarily recognize this fact.  So we just force it
-            #internally, and that seems to fix things
-            env.temp_data['py:module'] = modname
-
-            #can't use super because Sphinx/docutils has trouble
-            #return super(Autosummary,self).run()
-            nodelist.extend(Autosummary.run(self))
-            return self.warnings + nodelist
-        finally:  # has_content = False for the Automodsumm
-            self.content = []
-
-
-#<-------------------automod-diagram stuff------------------------------------>
-class Automoddiagram(InheritanceDiagram):
-
-    option_spec = dict(InheritanceDiagram.option_spec)
-    option_spec['allowed-package-names'] = _str_list_converter
-
-    def run(self):
-        try:
-            ols = self.options.get('allowed-package-names', [])
-            ols = True if len(ols) == 0 else ols  # if none are given, assume only local
-
-            nms, objs = find_mod_objs(self.arguments[0], onlylocals=ols)[1:]
-        except ImportError:
-            self.warnings = []
-            self.warn("Couldn't import module " + self.arguments[0])
-            return self.warnings
-
-        clsnms = []
-        for n, o in zip(nms, objs):
-
-            if inspect.isclass(o):
-                clsnms.append(n)
-
-        oldargs = self.arguments
-        try:
-            if len(clsnms) > 0:
-                self.arguments = [u' '.join(clsnms)]
-            return InheritanceDiagram.run(self)
-        finally:
-            self.arguments = oldargs
-
-
-#<---------------------automodsumm generation stuff--------------------------->
-def process_automodsumm_generation(app):
-    env = app.builder.env
-    ext = app.config.source_suffix
-
-    filestosearch = [x + ext for x in env.found_docs
-                     if os.path.isfile(env.doc2path(x))]\
-
-    liness = []
-    for sfn in filestosearch:
-        lines = automodsumm_to_autosummary_lines(sfn, app)
-        liness.append(lines)
-        if app.config.automodsumm_writereprocessed:
-            if lines:  # empty list means no automodsumm entry is in the file
-                outfn = os.path.join(app.srcdir, sfn) + '.automodsumm'
-                with open(outfn, 'w') as f:
-                    for l in lines:
-                        f.write(l)
-                        f.write('\n')
-
-    for sfn, lines in zip(filestosearch, liness):
-        if len(lines) > 0:
-            generate_automodsumm_docs(lines, sfn, builder=app.builder,
-                                      warn=app.warn, info=app.info,
-                                      suffix=app.config.source_suffix,
-                                      base_path=app.srcdir)
-
-#_automodsummrex = re.compile(r'^(\s*)\.\. automodsumm::\s*([A-Za-z0-9_.]+)\s*'
-#                             r'\n\1(\s*)(\S|$)', re.MULTILINE)
-_lineendrex = r'(?:\n|$)'
-_hdrex = r'^\n?(\s*)\.\. automodsumm::\s*(\S+)\s*' + _lineendrex
-_oprex1 = r'(?:\1(\s+)\S.*' + _lineendrex + ')'
-_oprex2 = r'(?:\1\4\S.*' + _lineendrex + ')'
-_automodsummrex = re.compile(_hdrex + '(' + _oprex1 + '?' + _oprex2 + '*)',
-                             re.MULTILINE)
-
-
-def automodsumm_to_autosummary_lines(fn, app):
-    """
-    Generates lines from a file with an "automodsumm" entry suitable for
-    feeding into "autosummary".
-
-    Searches the provided file for `automodsumm` directives and returns
-    a list of lines specifying the `autosummary` commands for the modules
-    requested. This does *not* return the whole file contents - just an
-    autosummary section in place of any :automodsumm: entries. Note that
-    any options given for `automodsumm` are also included in the
-    generated `autosummary` section.
-
-    Parameters
-    ----------
-    fn : str
-        The name of the file to search for `automodsumm` entries.
-    app : sphinx.application.Application
-        The sphinx Application object
-
-    Return
-    ------
-    lines : list of str
-        Lines for all `automodsumm` entries with the entries replaced by
-        `autosummary` and the module's members added.
-
-
-    """
-    fullfn = os.path.join(app.builder.env.srcdir, fn)
-
-    with open(fullfn) as fr:
-        if 'astropy_helpers.sphinx.ext.automodapi' in app._extensions:
-            from astropy_helpers.sphinx.ext.automodapi import automodapi_replace
-            # Must do the automodapi on the source to get the automodsumm
-            # that might be in there
-            filestr = automodapi_replace(fr.read(), app, True, fn, False)
-        else:
-            filestr = fr.read()
-
-    spl = _automodsummrex.split(filestr)
-    #0th entry is the stuff before the first automodsumm line
-    indent1s = spl[1::5]
-    mods = spl[2::5]
-    opssecs = spl[3::5]
-    indent2s = spl[4::5]
-    remainders = spl[5::5]
-
-    # only grab automodsumm sections and convert them to autosummary with the
-    # entries for all the public objects
-    newlines = []
-
-    #loop over all automodsumms in this document
-    for i, (i1, i2, modnm, ops, rem) in enumerate(zip(indent1s, indent2s, mods,
-                                                    opssecs, remainders)):
-        allindent = i1 + ('' if i2 is None else i2)
-
-        #filter out functions-only and classes-only options if present
-        oplines = ops.split('\n')
-        toskip = []
-        allowedpkgnms = []
-        funcsonly = clssonly = False
-        for i, ln in reversed(list(enumerate(oplines))):
-            if ':functions-only:' in ln:
-                funcsonly = True
-                del oplines[i]
-            if ':classes-only:' in ln:
-                clssonly = True
-                del oplines[i]
-            if ':skip:' in ln:
-                toskip.extend(_str_list_converter(ln.replace(':skip:', '')))
-                del oplines[i]
-            if ':allowed-package-names:' in ln:
-                allowedpkgnms.extend(_str_list_converter(ln.replace(':allowed-package-names:', '')))
-                del oplines[i]
-        if funcsonly and clssonly:
-            msg = ('Defined both functions-only and classes-only options. '
-                   'Skipping this directive.')
-            lnnum = sum([spl[j].count('\n') for j in range(i * 5 + 1)])
-            app.warn('[automodsumm]' + msg, (fn, lnnum))
-            continue
-
-        # Use the currentmodule directive so we can just put the local names
-        # in the autosummary table.  Note that this doesn't always seem to
-        # actually "take" in Sphinx's eyes, so in `Automodsumm.run`, we have to
-        # force it internally, as well.
-        newlines.extend([i1 + '.. currentmodule:: ' + modnm,
-                         '',
-                         '.. autosummary::'])
-        newlines.extend(oplines)
-
-        ols = True if len(allowedpkgnms) == 0 else allowedpkgnms
-        for nm, fqn, obj in zip(*find_mod_objs(modnm, onlylocals=ols)):
-            if nm in toskip:
-                continue
-            if funcsonly and not inspect.isroutine(obj):
-                continue
-            if clssonly and not inspect.isclass(obj):
-                continue
-            newlines.append(allindent + nm)
-
-    return newlines
-
-
-def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
-                              info=None, base_path=None, builder=None,
-                              template_dir=None):
-    """
-    This function is adapted from
-    `sphinx.ext.autosummary.generate.generate_autosummmary_docs` to
-    generate source for the automodsumm directives that should be
-    autosummarized. Unlike generate_autosummary_docs, this function is
-    called one file at a time.
-    """
-
-    from sphinx.jinja2glue import BuiltinTemplateLoader
-    from sphinx.ext.autosummary import import_by_name, get_documenter
-    from sphinx.ext.autosummary.generate import (find_autosummary_in_lines,
-                                                 _simple_info, _simple_warn)
-    from sphinx.util.osutil import ensuredir
-    from sphinx.util.inspect import safe_getattr
-    from jinja2 import FileSystemLoader, TemplateNotFound
-    from jinja2.sandbox import SandboxedEnvironment
-
-    if info is None:
-        info = _simple_info
-    if warn is None:
-        warn = _simple_warn
-
-    #info('[automodsumm] generating automodsumm for: ' + srcfn)
-
-    # Create our own templating environment - here we use Astropy's
-    # templates rather than the default autosummary templates, in order to
-    # allow docstrings to be shown for methods.
-    template_dirs = [os.path.join(os.path.dirname(__file__), 'templates'),
-                     os.path.join(base_path, '_templates')]
-    if builder is not None:
-        # allow the user to override the templates
-        template_loader = BuiltinTemplateLoader()
-        template_loader.init(builder, dirs=template_dirs)
-    else:
-        if template_dir:
-            template_dirs.insert(0, template_dir)
-        template_loader = FileSystemLoader(template_dirs)
-    template_env = SandboxedEnvironment(loader=template_loader)
-
-    # read
-    #items = find_autosummary_in_files(sources)
-    items = find_autosummary_in_lines(lines, filename=srcfn)
-    if len(items) > 0:
-        msg = '[automodsumm] {1}: found {0} automodsumm entries to generate'
-        info(msg.format(len(items), srcfn))
-
-#    gennms = [item[0] for item in items]
-#    if len(gennms) > 20:
-#        gennms = gennms[:10] + ['...'] + gennms[-10:]
-#    info('[automodsumm] generating autosummary for: ' + ', '.join(gennms))
-
-    # remove possible duplicates
-    items = dict([(item, True) for item in items]).keys()
-
-    # keep track of new files
-    new_files = []
-
-    # write
-    for name, path, template_name in sorted(items):
-        if path is None:
-            # The corresponding autosummary:: directive did not have
-            # a :toctree: option
-            continue
-
-        path = os.path.abspath(path)
-        ensuredir(path)
-
-        try:
-            import_by_name_values = import_by_name(name)
-        except ImportError as e:
-            warn('[automodsumm] failed to import %r: %s' % (name, e))
-            continue
-
-        # if block to accommodate Sphinx's v1.2.2 and v1.2.3 respectively
-        if len(import_by_name_values) == 3:
-            name, obj, parent = import_by_name_values
-        elif len(import_by_name_values) == 4:
-            name, obj, parent, module_name = import_by_name_values
-        
-        fn = os.path.join(path, name + suffix)
-
-        # skip it if it exists
-        if os.path.isfile(fn):
-            continue
-
-        new_files.append(fn)
-
-        f = open(fn, 'w')
-
-        try:
-            doc = get_documenter(obj, parent)
-
-            if template_name is not None:
-                template = template_env.get_template(template_name)
-            else:
-                tmplstr = 'autosummary/%s.rst'
-                try:
-                    template = template_env.get_template(tmplstr % doc.objtype)
-                except TemplateNotFound:
-                    template = template_env.get_template(tmplstr % 'base')
-
-            def get_members_mod(obj, typ, include_public=[]):
-                """
-                typ = None -> all
-                """
-                items = []
-                for name in dir(obj):
-                    try:
-                        documenter = get_documenter(safe_getattr(obj, name),
-                                                    obj)
-                    except AttributeError:
-                        continue
-                    if typ is None or documenter.objtype == typ:
-                        items.append(name)
-                public = [x for x in items
-                          if x in include_public or not x.startswith('_')]
-                return public, items
-
-            def get_members_class(obj, typ, include_public=[],
-                                  include_base=False):
-                """
-                typ = None -> all
-                include_base -> include attrs that are from a base class
-                """
-                items = []
-
-                # using dir gets all of the attributes, including the elements
-                # from the base class, otherwise use __slots__ or __dict__
-                if include_base:
-                    names = dir(obj)
-                else:
-                    if hasattr(obj, '__slots__'):
-                        names = tuple(getattr(obj, '__slots__'))
-                    else:
-                        names = getattr(obj, '__dict__').keys()
-
-                for name in names:
-                    try:
-                        documenter = get_documenter(safe_getattr(obj, name),
-                                                    obj)
-                    except AttributeError:
-                        continue
-                    if typ is None or documenter.objtype == typ:
-                        items.append(name)
-                public = [x for x in items
-                          if x in include_public or not x.startswith('_')]
-                return public, items
-
-            ns = {}
-
-            if doc.objtype == 'module':
-                ns['members'] = get_members_mod(obj, None)
-                ns['functions'], ns['all_functions'] = \
-                                   get_members_mod(obj, 'function')
-                ns['classes'], ns['all_classes'] = \
-                                 get_members_mod(obj, 'class')
-                ns['exceptions'], ns['all_exceptions'] = \
-                                   get_members_mod(obj, 'exception')
-            elif doc.objtype == 'class':
-                api_class_methods = ['__init__', '__call__']
-                ns['members'] = get_members_class(obj, None)
-                ns['methods'], ns['all_methods'] = \
-                                 get_members_class(obj, 'method', api_class_methods)
-                ns['attributes'], ns['all_attributes'] = \
-                                 get_members_class(obj, 'attribute')
-                ns['methods'].sort()
-                ns['attributes'].sort()
-
-            parts = name.split('.')
-            if doc.objtype in ('method', 'attribute'):
-                mod_name = '.'.join(parts[:-2])
-                cls_name = parts[-2]
-                obj_name = '.'.join(parts[-2:])
-                ns['class'] = cls_name
-            else:
-                mod_name, obj_name = '.'.join(parts[:-1]), parts[-1]
-
-            ns['fullname'] = name
-            ns['module'] = mod_name
-            ns['objname'] = obj_name
-            ns['name'] = parts[-1]
-
-            ns['objtype'] = doc.objtype
-            ns['underline'] = len(name) * '='
-
-            # We now check whether a file for reference footnotes exists for
-            # the module being documented. We first check if the
-            # current module is a file or a directory, as this will give a
-            # different path for the reference file. For example, if
-            # documenting astropy.wcs then the reference file is at
-            # ../wcs/references.txt, while if we are documenting
-            # astropy.config.logging_helper (which is at
-            # astropy/config/logging_helper.py) then the reference file is set
-            # to ../config/references.txt
-            if '.' in mod_name:
-                mod_name_dir = mod_name.replace('.', '/').split('/', 1)[1]
-            else:
-                mod_name_dir = mod_name
-            if not os.path.isdir(os.path.join(base_path, mod_name_dir)) \
-               and os.path.isdir(os.path.join(base_path, mod_name_dir.rsplit('/', 1)[0])):
-                mod_name_dir = mod_name_dir.rsplit('/', 1)[0]
-
-            # We then have to check whether it exists, and if so, we pass it
-            # to the template.
-            if os.path.exists(os.path.join(base_path, mod_name_dir, 'references.txt')):
-                # An important subtlety here is that the path we pass in has
-                # to be relative to the file being generated, so we have to
-                # figure out the right number of '..'s
-                ndirsback = path.replace(base_path, '').count('/')
-                ref_file_rel_segments = ['..'] * ndirsback
-                ref_file_rel_segments.append(mod_name_dir)
-                ref_file_rel_segments.append('references.txt')
-                ns['referencefile'] = os.path.join(*ref_file_rel_segments)
-
-            rendered = template.render(**ns)
-            f.write(rendered)
-        finally:
-            f.close()
-
-
-def setup(app):
-    # need our autosummary
-    app.setup_extension('astropy_helpers.sphinx.ext.astropyautosummary')
-    # need inheritance-diagram for automod-diagram
-    app.setup_extension('sphinx.ext.inheritance_diagram')
-
-    app.add_directive('automod-diagram', Automoddiagram)
-    app.add_directive('automodsumm', Automodsumm)
-    app.connect('builder-inited', process_automodsumm_generation)
-
-    app.add_config_value('automodsumm_writereprocessed', False, True)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/changelog_links.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/changelog_links.py
deleted file mode 100644
index f77a31d..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/changelog_links.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This sphinx extension makes the issue numbers in the changelog into links to
-GitHub issues.
-"""
-
-from __future__ import print_function
-
-import re
-
-from docutils.nodes import Text, reference
-
-BLOCK_PATTERN = re.compile('\[#.+\]', flags=re.DOTALL)
-ISSUE_PATTERN = re.compile('#[0-9]+')
-
-
-def process_changelog_links(app, doctree, docname):
-    for rex in app.changelog_links_rexes:
-        if rex.match(docname):
-            break
-    else:
-        # if the doc doesn't match any of the changelog regexes, don't process
-        return
-
-    app.info('[changelog_links] Adding changelog links to "{0}"'.format(docname))
-
-    for item in doctree.traverse():
-
-        if not isinstance(item, Text):
-            continue
-
-        # We build a new list of items to replace the current item. If
-        # a link is found, we need to use a 'reference' item.
-        children = []
-
-        # First cycle through blocks of issues (delimited by []) then
-        # iterate inside each one to find the individual issues.
-        prev_block_end = 0
-        for block in BLOCK_PATTERN.finditer(item):
-            block_start, block_end = block.start(), block.end()
-            children.append(Text(item[prev_block_end:block_start]))
-            block = item[block_start:block_end]
-            prev_end = 0
-            for m in ISSUE_PATTERN.finditer(block):
-                start, end = m.start(), m.end()
-                children.append(Text(block[prev_end:start]))
-                issue_number = block[start:end]
-                refuri = app.config.github_issues_url + issue_number[1:]
-                children.append(reference(text=issue_number,
-                                          name=issue_number,
-                                          refuri=refuri))
-                prev_end = end
-
-            prev_block_end = block_end
-
-            # If no issues were found, this adds the whole item,
-            # otherwise it adds the remaining text.
-            children.append(Text(block[prev_end:block_end]))
-
-        # If no blocks were found, this adds the whole item, otherwise
-        # it adds the remaining text.
-        children.append(Text(item[prev_block_end:]))
-
-        # Replace item by the new list of items we have generated,
-        # which may contain links.
-        item.parent.replace(item, children)
-
-
-def setup_patterns_rexes(app):
-    app.changelog_links_rexes = [re.compile(pat) for pat in
-                                 app.config.changelog_links_docpattern]
-
-
-def setup(app):
-    app.connect('doctree-resolved', process_changelog_links)
-    app.connect('builder-inited', setup_patterns_rexes)
-    app.add_config_value('github_issues_url', None, True)
-    app.add_config_value('changelog_links_docpattern', ['.*changelog.*', 'whatsnew/.*'], True)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/comment_eater.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/comment_eater.py
deleted file mode 100644
index 8cddd33..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/comment_eater.py
+++ /dev/null
@@ -1,169 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import sys
-if sys.version_info[0] >= 3:
-    from io import StringIO
-else:
-    from io import StringIO
-
-import compiler
-import inspect
-import textwrap
-import tokenize
-
-from .compiler_unparse import unparse
-
-
-class Comment(object):
-    """ A comment block.
-    """
-    is_comment = True
-    def __init__(self, start_lineno, end_lineno, text):
-        # int : The first line number in the block. 1-indexed.
-        self.start_lineno = start_lineno
-        # int : The last line number. Inclusive!
-        self.end_lineno = end_lineno
-        # str : The text block including '#' character but not any leading spaces.
-        self.text = text
-
-    def add(self, string, start, end, line):
-        """ Add a new comment line.
-        """
-        self.start_lineno = min(self.start_lineno, start[0])
-        self.end_lineno = max(self.end_lineno, end[0])
-        self.text += string
-
-    def __repr__(self):
-        return '%s(%r, %r, %r)' % (self.__class__.__name__, self.start_lineno,
-            self.end_lineno, self.text)
-
-
-class NonComment(object):
-    """ A non-comment block of code.
-    """
-    is_comment = False
-    def __init__(self, start_lineno, end_lineno):
-        self.start_lineno = start_lineno
-        self.end_lineno = end_lineno
-
-    def add(self, string, start, end, line):
-        """ Add lines to the block.
-        """
-        if string.strip():
-            # Only add if not entirely whitespace.
-            self.start_lineno = min(self.start_lineno, start[0])
-            self.end_lineno = max(self.end_lineno, end[0])
-
-    def __repr__(self):
-        return '%s(%r, %r)' % (self.__class__.__name__, self.start_lineno,
-            self.end_lineno)
-
-
-class CommentBlocker(object):
-    """ Pull out contiguous comment blocks.
-    """
-    def __init__(self):
-        # Start with a dummy.
-        self.current_block = NonComment(0, 0)
-
-        # All of the blocks seen so far.
-        self.blocks = []
-
-        # The index mapping lines of code to their associated comment blocks.
-        self.index = {}
-
-    def process_file(self, file):
-        """ Process a file object.
-        """
-        if sys.version_info[0] >= 3:
-            nxt = file.__next__
-        else:
-            nxt = file.next
-        for token in tokenize.generate_tokens(nxt):
-            self.process_token(*token)
-        self.make_index()
-
-    def process_token(self, kind, string, start, end, line):
-        """ Process a single token.
-        """
-        if self.current_block.is_comment:
-            if kind == tokenize.COMMENT:
-                self.current_block.add(string, start, end, line)
-            else:
-                self.new_noncomment(start[0], end[0])
-        else:
-            if kind == tokenize.COMMENT:
-                self.new_comment(string, start, end, line)
-            else:
-                self.current_block.add(string, start, end, line)
-
-    def new_noncomment(self, start_lineno, end_lineno):
-        """ We are transitioning from a noncomment to a comment.
-        """
-        block = NonComment(start_lineno, end_lineno)
-        self.blocks.append(block)
-        self.current_block = block
-
-    def new_comment(self, string, start, end, line):
-        """ Possibly add a new comment.
-
-        Only adds a new comment if this comment is the only thing on the line.
-        Otherwise, it extends the noncomment block.
-        """
-        prefix = line[:start[1]]
-        if prefix.strip():
-            # Oops! Trailing comment, not a comment block.
-            self.current_block.add(string, start, end, line)
-        else:
-            # A comment block.
-            block = Comment(start[0], end[0], string)
-            self.blocks.append(block)
-            self.current_block = block
-
-    def make_index(self):
-        """ Make the index mapping lines of actual code to their associated
-        prefix comments.
-        """
-        for prev, block in zip(self.blocks[:-1], self.blocks[1:]):
-            if not block.is_comment:
-                self.index[block.start_lineno] = prev
-
-    def search_for_comment(self, lineno, default=None):
-        """ Find the comment block just before the given line number.
-
-        Returns None (or the specified default) if there is no such block.
-        """
-        if not self.index:
-            self.make_index()
-        block = self.index.get(lineno, None)
-        text = getattr(block, 'text', default)
-        return text
-
-
-def strip_comment_marker(text):
-    """ Strip # markers at the front of a block of comment text.
-    """
-    lines = []
-    for line in text.splitlines():
-        lines.append(line.lstrip('#'))
-    text = textwrap.dedent('\n'.join(lines))
-    return text
-
-
-def get_class_traits(klass):
-    """ Yield all of the documentation for trait definitions on a class object.
-    """
-    # FIXME: gracefully handle errors here or in the caller?
-    source = inspect.getsource(klass)
-    cb = CommentBlocker()
-    cb.process_file(StringIO(source))
-    mod_ast = compiler.parse(source)
-    class_ast = mod_ast.node.nodes[0]
-    for node in class_ast.code.nodes:
-        # FIXME: handle other kinds of assignments?
-        if isinstance(node, compiler.ast.Assign):
-            name = node.nodes[0].name
-            rhs = unparse(node.expr).strip()
-            doc = strip_comment_marker(cb.search_for_comment(node.lineno, default=''))
-            yield name, rhs, doc
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/compiler_unparse.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/compiler_unparse.py
deleted file mode 100644
index 8933a83..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/compiler_unparse.py
+++ /dev/null
@@ -1,865 +0,0 @@
-""" Turn compiler.ast structures back into executable python code.
-
-    The unparse method takes a compiler.ast tree and transforms it back into
-    valid python code.  It is incomplete and currently only works for
-    import statements, function calls, function definitions, assignments, and
-    basic expressions.
-
-    Inspired by python-2.5-svn/Demo/parser/unparse.py
-
-    fixme: We may want to move to using _ast trees because the compiler for
-           them is about 6 times faster than compiler.compile.
-"""
-from __future__ import division, absolute_import, print_function
-
-import sys
-from compiler.ast import Const, Name, Tuple, Div, Mul, Sub, Add
-
-if sys.version_info[0] >= 3:
-    from io import StringIO
-else:
-    from StringIO import StringIO
-
-def unparse(ast, single_line_functions=False):
-    s = StringIO()
-    UnparseCompilerAst(ast, s, single_line_functions)
-    return s.getvalue().lstrip()
-
-op_precedence = { 'compiler.ast.Power':3, 'compiler.ast.Mul':2, 'compiler.ast.Div':2,
-                  'compiler.ast.Add':1, 'compiler.ast.Sub':1 }
-
-class UnparseCompilerAst:
-    """ Methods in this class recursively traverse an AST and
-        output source code for the abstract syntax; original formatting
-        is disregarged.
-    """
-
-    #########################################################################
-    # object interface.
-    #########################################################################
-
-    def __init__(self, tree, file = sys.stdout, single_line_functions=False):
-        """ Unparser(tree, file=sys.stdout) -> None.
-
-            Print the source for tree to file.
-        """
-        self.f = file
-        self._single_func = single_line_functions
-        self._do_indent = True
-        self._indent = 0
-        self._dispatch(tree)
-        self._write("\n")
-        self.f.flush()
-
-    #########################################################################
-    # Unparser private interface.
-    #########################################################################
-
-    ### format, output, and dispatch methods ################################
-
-    def _fill(self, text = ""):
-        "Indent a piece of text, according to the current indentation level"
-        if self._do_indent:
-            self._write("\n"+"    "*self._indent + text)
-        else:
-            self._write(text)
-
-    def _write(self, text):
-        "Append a piece of text to the current line."
-        self.f.write(text)
-
-    def _enter(self):
-        "Print ':', and increase the indentation."
-        self._write(": ")
-        self._indent += 1
-
-    def _leave(self):
-        "Decrease the indentation level."
-        self._indent -= 1
-
-    def _dispatch(self, tree):
-        "_dispatcher function, _dispatching tree type T to method _T."
-        if isinstance(tree, list):
-            for t in tree:
-                self._dispatch(t)
-            return
-        meth = getattr(self, "_"+tree.__class__.__name__)
-        if tree.__class__.__name__ == 'NoneType' and not self._do_indent:
-            return
-        meth(tree)
-
-
-    #########################################################################
-    # compiler.ast unparsing methods.
-    #
-    # There should be one method per concrete grammar type. They are
-    # organized in alphabetical order.
-    #########################################################################
-
-    def _Add(self, t):
-        self.__binary_op(t, '+')
-
-    def _And(self, t):
-        self._write(" (")
-        for i, node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i != len(t.nodes)-1:
-                self._write(") and (")
-        self._write(")")
-
-    def _AssAttr(self, t):
-        """ Handle assigning an attribute of an object
-        """
-        self._dispatch(t.expr)
-        self._write('.'+t.attrname)
-
-    def _Assign(self, t):
-        """ Expression Assignment such as "a = 1".
-
-            This only handles assignment in expressions.  Keyword assignment
-            is handled separately.
-        """
-        self._fill()
-        for target in t.nodes:
-            self._dispatch(target)
-            self._write(" = ")
-        self._dispatch(t.expr)
-        if not self._do_indent:
-            self._write('; ')
-
-    def _AssName(self, t):
-        """ Name on left hand side of expression.
-
-            Treat just like a name on the right side of an expression.
-        """
-        self._Name(t)
-
-    def _AssTuple(self, t):
-        """ Tuple on left hand side of an expression.
-        """
-
-        # _write each elements, separated by a comma.
-        for element in t.nodes[:-1]:
-            self._dispatch(element)
-            self._write(", ")
-
-        # Handle the last one without writing comma
-        last_element = t.nodes[-1]
-        self._dispatch(last_element)
-
-    def _AugAssign(self, t):
-        """ +=,-=,*=,/=,**=, etc. operations
-        """
-
-        self._fill()
-        self._dispatch(t.node)
-        self._write(' '+t.op+' ')
-        self._dispatch(t.expr)
-        if not self._do_indent:
-            self._write(';')
-
-    def _Bitand(self, t):
-        """ Bit and operation.
-        """
-
-        for i, node in enumerate(t.nodes):
-            self._write("(")
-            self._dispatch(node)
-            self._write(")")
-            if i != len(t.nodes)-1:
-                self._write(" & ")
-
-    def _Bitor(self, t):
-        """ Bit or operation
-        """
-
-        for i, node in enumerate(t.nodes):
-            self._write("(")
-            self._dispatch(node)
-            self._write(")")
-            if i != len(t.nodes)-1:
-                self._write(" | ")
-
-    def _CallFunc(self, t):
-        """ Function call.
-        """
-        self._dispatch(t.node)
-        self._write("(")
-        comma = False
-        for e in t.args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._dispatch(e)
-        if t.star_args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._write("*")
-            self._dispatch(t.star_args)
-        if t.dstar_args:
-            if comma: self._write(", ")
-            else: comma = True
-            self._write("**")
-            self._dispatch(t.dstar_args)
-        self._write(")")
-
-    def _Compare(self, t):
-        self._dispatch(t.expr)
-        for op, expr in t.ops:
-            self._write(" " + op + " ")
-            self._dispatch(expr)
-
-    def _Const(self, t):
-        """ A constant value such as an integer value, 3, or a string, "hello".
-        """
-        self._dispatch(t.value)
-
-    def _Decorators(self, t):
-        """ Handle function decorators (eg. @has_units)
-        """
-        for node in t.nodes:
-            self._dispatch(node)
-
-    def _Dict(self, t):
-        self._write("{")
-        for  i, (k, v) in enumerate(t.items):
-            self._dispatch(k)
-            self._write(": ")
-            self._dispatch(v)
-            if i < len(t.items)-1:
-                self._write(", ")
-        self._write("}")
-
-    def _Discard(self, t):
-        """ Node for when return value is ignored such as in "foo(a)".
-        """
-        self._fill()
-        self._dispatch(t.expr)
-
-    def _Div(self, t):
-        self.__binary_op(t, '/')
-
-    def _Ellipsis(self, t):
-        self._write("...")
-
-    def _From(self, t):
-        """ Handle "from xyz import foo, bar as baz".
-        """
-        # fixme: Are From and ImportFrom handled differently?
-        self._fill("from ")
-        self._write(t.modname)
-        self._write(" import ")
-        for i, (name,asname) in enumerate(t.names):
-            if i != 0:
-                self._write(", ")
-            self._write(name)
-            if asname is not None:
-                self._write(" as "+asname)
-
-    def _Function(self, t):
-        """ Handle function definitions
-        """
-        if t.decorators is not None:
-            self._fill("@")
-            self._dispatch(t.decorators)
-        self._fill("def "+t.name + "(")
-        defaults = [None] * (len(t.argnames) - len(t.defaults)) + list(t.defaults)
-        for i, arg in enumerate(zip(t.argnames, defaults)):
-            self._write(arg[0])
-            if arg[1] is not None:
-                self._write('=')
-                self._dispatch(arg[1])
-            if i < len(t.argnames)-1:
-                self._write(', ')
-        self._write(")")
-        if self._single_func:
-            self._do_indent = False
-        self._enter()
-        self._dispatch(t.code)
-        self._leave()
-        self._do_indent = True
-
-    def _Getattr(self, t):
-        """ Handle getting an attribute of an object
-        """
-        if isinstance(t.expr, (Div, Mul, Sub, Add)):
-            self._write('(')
-            self._dispatch(t.expr)
-            self._write(')')
-        else:
-            self._dispatch(t.expr)
-            
-        self._write('.'+t.attrname)
-        
-    def _If(self, t):
-        self._fill()
-        
-        for i, (compare,code) in enumerate(t.tests):
-            if i == 0:
-                self._write("if ")
-            else:
-                self._write("elif ")
-            self._dispatch(compare)
-            self._enter()
-            self._fill()
-            self._dispatch(code)
-            self._leave()
-            self._write("\n")
-
-        if t.else_ is not None:
-            self._write("else")
-            self._enter()
-            self._fill()
-            self._dispatch(t.else_)
-            self._leave()
-            self._write("\n")
-            
-    def _IfExp(self, t):
-        self._dispatch(t.then)
-        self._write(" if ")
-        self._dispatch(t.test)
-
-        if t.else_ is not None:
-            self._write(" else (")
-            self._dispatch(t.else_)
-            self._write(")")
-
-    def _Import(self, t):
-        """ Handle "import xyz.foo".
-        """
-        self._fill("import ")
-        
-        for i, (name,asname) in enumerate(t.names):
-            if i != 0:
-                self._write(", ")
-            self._write(name)
-            if asname is not None:
-                self._write(" as "+asname)
-
-    def _Keyword(self, t):
-        """ Keyword value assignment within function calls and definitions.
-        """
-        self._write(t.name)
-        self._write("=")
-        self._dispatch(t.expr)
-        
-    def _List(self, t):
-        self._write("[")
-        for  i,node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i < len(t.nodes)-1:
-                self._write(", ")
-        self._write("]")
-
-    def _Module(self, t):
-        if t.doc is not None:
-            self._dispatch(t.doc)
-        self._dispatch(t.node)
-
-    def _Mul(self, t):
-        self.__binary_op(t, '*')
-
-    def _Name(self, t):
-        self._write(t.name)
-
-    def _NoneType(self, t):
-        self._write("None")
-        
-    def _Not(self, t):
-        self._write('not (')
-        self._dispatch(t.expr)
-        self._write(')')
-        
-    def _Or(self, t):
-        self._write(" (")
-        for i, node in enumerate(t.nodes):
-            self._dispatch(node)
-            if i != len(t.nodes)-1:
-                self._write(") or (")
-        self._write(")")
-                
-    def _Pass(self, t):
-        self._write("pass\n")
-
-    def _Printnl(self, t):
-        self._fill("print ")
-        if t.dest:
-            self._write(">> ")
-            self._dispatch(t.dest)
-            self._write(", ")
-        comma = False
-        for node in t.nodes:
-            if comma: self._write(', ')
-            else: comma = True
-            self._dispatch(node)
-
-    def _Power(self, t):
-        self.__binary_op(t, '**')
-
-    def _Return(self, t):
-        self._fill("return ")
-        if t.value:
-            if isinstance(t.value, Tuple):
-                text = ', '.join([ name.name for name in t.value.asList() ])
-                self._write(text)
-            else:
-                self._dispatch(t.value)
-            if not self._do_indent:
-                self._write('; ')
-
-    def _Slice(self, t):
-        self._dispatch(t.expr)
-        self._write("[")
-        if t.lower:
-            self._dispatch(t.lower)
-        self._write(":")
-        if t.upper:
-            self._dispatch(t.upper)
-        #if t.step:
-        #    self._write(":")
-        #    self._dispatch(t.step)
-        self._write("]")
-
-    def _Sliceobj(self, t):
-        for i, node in enumerate(t.nodes):
-            if i != 0:
-                self._write(":")
-            if not (isinstance(node, Const) and node.value is None):
-                self._dispatch(node)
-
-    def _Stmt(self, tree):
-        for node in tree.nodes:
-            self._dispatch(node)
-
-    def _Sub(self, t):
-        self.__binary_op(t, '-')
-
-    def _Subscript(self, t):
-        self._dispatch(t.expr)
-        self._write("[")
-        for i, value in enumerate(t.subs):
-            if i != 0:
-                self._write(",")
-            self._dispatch(value)
-        self._write("]")
-
-    def _TryExcept(self, t):
-        self._fill("try")
-        self._enter()
-        self._dispatch(t.body)
-        self._leave()
-
-        for handler in t.handlers:
-            self._fill('except ')
-            self._dispatch(handler[0])
-            if handler[1] is not None:
-                self._write(', ')
-                self._dispatch(handler[1])
-            self._enter()
-            self._dispatch(handler[2])
-            self._leave()
-            
-        if t.else_:
-            self._fill("else")
-            self._enter()
-            self._dispatch(t.else_)
-            self._leave()
-
-    def _Tuple(self, t):
-
-        if not t.nodes:
-            # Empty tuple.
-            self._write("()")
-        else:
-            self._write("(")
-
-            # _write each elements, separated by a comma.
-            for element in t.nodes[:-1]:
-                self._dispatch(element)
-                self._write(", ")
-
-            # Handle the last one without writing comma
-            last_element = t.nodes[-1]
-            self._dispatch(last_element)
-
-            self._write(")")
-            
-    def _UnaryAdd(self, t):
-        self._write("+")
-        self._dispatch(t.expr)
-        
-    def _UnarySub(self, t):
-        self._write("-")
-        self._dispatch(t.expr)        
-
-    def _With(self, t):
-        self._fill('with ')
-        self._dispatch(t.expr)
-        if t.vars:
-            self._write(' as ')
-            self._dispatch(t.vars.name)
-        self._enter()
-        self._dispatch(t.body)
-        self._leave()
-        self._write('\n')
-        
-    def _int(self, t):
-        self._write(repr(t))
-
-    def __binary_op(self, t, symbol):
-        # Check if parenthesis are needed on left side and then dispatch
-        has_paren = False
-        left_class = str(t.left.__class__)
-        if (left_class in op_precedence.keys() and
-            op_precedence[left_class] < op_precedence[str(t.__class__)]):
-            has_paren = True
-        if has_paren:
-            self._write('(')
-        self._dispatch(t.left)
-        if has_paren:
-            self._write(')')
-        # Write the appropriate symbol for operator
-        self._write(symbol)
-        # Check if parenthesis are needed on the right side and then dispatch
-        has_paren = False
-        right_class = str(t.right.__class__)
-        if (right_class in op_precedence.keys() and
-            op_precedence[right_class] < op_precedence[str(t.__class__)]):
-            has_paren = True
-        if has_paren:
-            self._write('(')
-        self._dispatch(t.right)
-        if has_paren:
-            self._write(')')
-
-    def _float(self, t):
-        # if t is 0.1, str(t)->'0.1' while repr(t)->'0.1000000000001'
-        # We prefer str here.
-        self._write(str(t))
-
-    def _str(self, t):
-        self._write(repr(t))
-        
-    def _tuple(self, t):
-        self._write(str(t))
-
-    #########################################################################
-    # These are the methods from the _ast modules unparse.
-    #
-    # As our needs to handle more advanced code increase, we may want to
-    # modify some of the methods below so that they work for compiler.ast.
-    #########################################################################
-
-#    # stmt
-#    def _Expr(self, tree):
-#        self._fill()
-#        self._dispatch(tree.value)
-#
-#    def _Import(self, t):
-#        self._fill("import ")
-#        first = True
-#        for a in t.names:
-#            if first:
-#                first = False
-#            else:
-#                self._write(", ")
-#            self._write(a.name)
-#            if a.asname:
-#                self._write(" as "+a.asname)
-#
-##    def _ImportFrom(self, t):
-##        self._fill("from ")
-##        self._write(t.module)
-##        self._write(" import ")
-##        for i, a in enumerate(t.names):
-##            if i == 0:
-##                self._write(", ")
-##            self._write(a.name)
-##            if a.asname:
-##                self._write(" as "+a.asname)
-##        # XXX(jpe) what is level for?
-##
-#
-#    def _Break(self, t):
-#        self._fill("break")
-#
-#    def _Continue(self, t):
-#        self._fill("continue")
-#
-#    def _Delete(self, t):
-#        self._fill("del ")
-#        self._dispatch(t.targets)
-#
-#    def _Assert(self, t):
-#        self._fill("assert ")
-#        self._dispatch(t.test)
-#        if t.msg:
-#            self._write(", ")
-#            self._dispatch(t.msg)
-#
-#    def _Exec(self, t):
-#        self._fill("exec ")
-#        self._dispatch(t.body)
-#        if t.globals:
-#            self._write(" in ")
-#            self._dispatch(t.globals)
-#        if t.locals:
-#            self._write(", ")
-#            self._dispatch(t.locals)
-#
-#    def _Print(self, t):
-#        self._fill("print ")
-#        do_comma = False
-#        if t.dest:
-#            self._write(">>")
-#            self._dispatch(t.dest)
-#            do_comma = True
-#        for e in t.values:
-#            if do_comma:self._write(", ")
-#            else:do_comma=True
-#            self._dispatch(e)
-#        if not t.nl:
-#            self._write(",")
-#
-#    def _Global(self, t):
-#        self._fill("global")
-#        for i, n in enumerate(t.names):
-#            if i != 0:
-#                self._write(",")
-#            self._write(" " + n)
-#
-#    def _Yield(self, t):
-#        self._fill("yield")
-#        if t.value:
-#            self._write(" (")
-#            self._dispatch(t.value)
-#            self._write(")")
-#
-#    def _Raise(self, t):
-#        self._fill('raise ')
-#        if t.type:
-#            self._dispatch(t.type)
-#        if t.inst:
-#            self._write(", ")
-#            self._dispatch(t.inst)
-#        if t.tback:
-#            self._write(", ")
-#            self._dispatch(t.tback)
-#
-#
-#    def _TryFinally(self, t):
-#        self._fill("try")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#        self._fill("finally")
-#        self._enter()
-#        self._dispatch(t.finalbody)
-#        self._leave()
-#
-#    def _excepthandler(self, t):
-#        self._fill("except ")
-#        if t.type:
-#            self._dispatch(t.type)
-#        if t.name:
-#            self._write(", ")
-#            self._dispatch(t.name)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _ClassDef(self, t):
-#        self._write("\n")
-#        self._fill("class "+t.name)
-#        if t.bases:
-#            self._write("(")
-#            for a in t.bases:
-#                self._dispatch(a)
-#                self._write(", ")
-#            self._write(")")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _FunctionDef(self, t):
-#        self._write("\n")
-#        for deco in t.decorators:
-#            self._fill("@")
-#            self._dispatch(deco)
-#        self._fill("def "+t.name + "(")
-#        self._dispatch(t.args)
-#        self._write(")")
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#
-#    def _For(self, t):
-#        self._fill("for ")
-#        self._dispatch(t.target)
-#        self._write(" in ")
-#        self._dispatch(t.iter)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#        if t.orelse:
-#            self._fill("else")
-#            self._enter()
-#            self._dispatch(t.orelse)
-#            self._leave
-#
-#    def _While(self, t):
-#        self._fill("while ")
-#        self._dispatch(t.test)
-#        self._enter()
-#        self._dispatch(t.body)
-#        self._leave()
-#        if t.orelse:
-#            self._fill("else")
-#            self._enter()
-#            self._dispatch(t.orelse)
-#            self._leave
-#
-#    # expr
-#    def _Str(self, tree):
-#        self._write(repr(tree.s))
-##
-#    def _Repr(self, t):
-#        self._write("`")
-#        self._dispatch(t.value)
-#        self._write("`")
-#
-#    def _Num(self, t):
-#        self._write(repr(t.n))
-#
-#    def _ListComp(self, t):
-#        self._write("[")
-#        self._dispatch(t.elt)
-#        for gen in t.generators:
-#            self._dispatch(gen)
-#        self._write("]")
-#
-#    def _GeneratorExp(self, t):
-#        self._write("(")
-#        self._dispatch(t.elt)
-#        for gen in t.generators:
-#            self._dispatch(gen)
-#        self._write(")")
-#
-#    def _comprehension(self, t):
-#        self._write(" for ")
-#        self._dispatch(t.target)
-#        self._write(" in ")
-#        self._dispatch(t.iter)
-#        for if_clause in t.ifs:
-#            self._write(" if ")
-#            self._dispatch(if_clause)
-#
-#    def _IfExp(self, t):
-#        self._dispatch(t.body)
-#        self._write(" if ")
-#        self._dispatch(t.test)
-#        if t.orelse:
-#            self._write(" else ")
-#            self._dispatch(t.orelse)
-#
-#    unop = {"Invert":"~", "Not": "not", "UAdd":"+", "USub":"-"}
-#    def _UnaryOp(self, t):
-#        self._write(self.unop[t.op.__class__.__name__])
-#        self._write("(")
-#        self._dispatch(t.operand)
-#        self._write(")")
-#
-#    binop = { "Add":"+", "Sub":"-", "Mult":"*", "Div":"/", "Mod":"%",
-#                    "LShift":">>", "RShift":"<<", "BitOr":"|", "BitXor":"^", "BitAnd":"&",
-#                    "FloorDiv":"//", "Pow": "**"}
-#    def _BinOp(self, t):
-#        self._write("(")
-#        self._dispatch(t.left)
-#        self._write(")" + self.binop[t.op.__class__.__name__] + "(")
-#        self._dispatch(t.right)
-#        self._write(")")
-#
-#    boolops = {_ast.And: 'and', _ast.Or: 'or'}
-#    def _BoolOp(self, t):
-#        self._write("(")
-#        self._dispatch(t.values[0])
-#        for v in t.values[1:]:
-#            self._write(" %s " % self.boolops[t.op.__class__])
-#            self._dispatch(v)
-#        self._write(")")
-#
-#    def _Attribute(self,t):
-#        self._dispatch(t.value)
-#        self._write(".")
-#        self._write(t.attr)
-#
-##    def _Call(self, t):
-##        self._dispatch(t.func)
-##        self._write("(")
-##        comma = False
-##        for e in t.args:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._dispatch(e)
-##        for e in t.keywords:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._dispatch(e)
-##        if t.starargs:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._write("*")
-##            self._dispatch(t.starargs)
-##        if t.kwargs:
-##            if comma: self._write(", ")
-##            else: comma = True
-##            self._write("**")
-##            self._dispatch(t.kwargs)
-##        self._write(")")
-#
-#    # slice
-#    def _Index(self, t):
-#        self._dispatch(t.value)
-#
-#    def _ExtSlice(self, t):
-#        for i, d in enumerate(t.dims):
-#            if i != 0:
-#                self._write(': ')
-#            self._dispatch(d)
-#
-#    # others
-#    def _arguments(self, t):
-#        first = True
-#        nonDef = len(t.args)-len(t.defaults)
-#        for a in t.args[0:nonDef]:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._dispatch(a)
-#        for a,d in zip(t.args[nonDef:], t.defaults):
-#            if first:first = False
-#            else: self._write(", ")
-#            self._dispatch(a),
-#            self._write("=")
-#            self._dispatch(d)
-#        if t.vararg:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._write("*"+t.vararg)
-#        if t.kwarg:
-#            if first:first = False
-#            else: self._write(", ")
-#            self._write("**"+t.kwarg)
-#
-##    def _keyword(self, t):
-##        self._write(t.arg)
-##        self._write("=")
-##        self._dispatch(t.value)
-#
-#    def _Lambda(self, t):
-#        self._write("lambda ")
-#        self._dispatch(t.args)
-#        self._write(": ")
-#        self._dispatch(t.body)
-
-
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape.py
deleted file mode 100644
index 2b1719d..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape.py
+++ /dev/null
@@ -1,531 +0,0 @@
-"""Extract reference documentation from the NumPy source tree.
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import inspect
-import textwrap
-import re
-import pydoc
-from warnings import warn
-import collections
-import sys
-
-
-class Reader(object):
-    """A line-based string reader.
-
-    """
-    def __init__(self, data):
-        """
-        Parameters
-        ----------
-        data : str
-           String with lines separated by '\n'.
-
-        """
-        if isinstance(data,list):
-            self._str = data
-        else:
-            self._str = data.split('\n') # store string as list of lines
-
-        self.reset()
-
-    def __getitem__(self, n):
-        return self._str[n]
-
-    def reset(self):
-        self._l = 0 # current line nr
-
-    def read(self):
-        if not self.eof():
-            out = self[self._l]
-            self._l += 1
-            return out
-        else:
-            return ''
-
-    def seek_next_non_empty_line(self):
-        for l in self[self._l:]:
-            if l.strip():
-                break
-            else:
-                self._l += 1
-
-    def eof(self):
-        return self._l >= len(self._str)
-
-    def read_to_condition(self, condition_func):
-        start = self._l
-        for line in self[start:]:
-            if condition_func(line):
-                return self[start:self._l]
-            self._l += 1
-            if self.eof():
-                return self[start:self._l+1]
-        return []
-
-    def read_to_next_empty_line(self):
-        self.seek_next_non_empty_line()
-        def is_empty(line):
-            return not line.strip()
-        return self.read_to_condition(is_empty)
-
-    def read_to_next_unindented_line(self):
-        def is_unindented(line):
-            return (line.strip() and (len(line.lstrip()) == len(line)))
-        return self.read_to_condition(is_unindented)
-
-    def peek(self,n=0):
-        if self._l + n < len(self._str):
-            return self[self._l + n]
-        else:
-            return ''
-
-    def is_empty(self):
-        return not ''.join(self._str).strip()
-
-
-class NumpyDocString(object):
-    def __init__(self, docstring, config={}):
-        docstring = textwrap.dedent(docstring).split('\n')
-
-        self._doc = Reader(docstring)
-        self._parsed_data = {
-            'Signature': '',
-            'Summary': [''],
-            'Extended Summary': [],
-            'Parameters': [],
-            'Returns': [],
-            'Raises': [],
-            'Warns': [],
-            'Other Parameters': [],
-            'Attributes': [],
-            'Methods': [],
-            'See Also': [],
-            'Notes': [],
-            'Warnings': [],
-            'References': '',
-            'Examples': '',
-            'index': {}
-            }
-
-        self._parse()
-
-    def __getitem__(self,key):
-        return self._parsed_data[key]
-
-    def __setitem__(self,key,val):
-        if key not in self._parsed_data:
-            warn("Unknown section %s" % key)
-        else:
-            self._parsed_data[key] = val
-
-    def _is_at_section(self):
-        self._doc.seek_next_non_empty_line()
-
-        if self._doc.eof():
-            return False
-
-        l1 = self._doc.peek().strip()  # e.g. Parameters
-
-        if l1.startswith('.. index::'):
-            return True
-
-        l2 = self._doc.peek(1).strip() #    ---------- or ==========
-        return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))
-
-    def _strip(self,doc):
-        i = 0
-        j = 0
-        for i,line in enumerate(doc):
-            if line.strip(): break
-
-        for j,line in enumerate(doc[::-1]):
-            if line.strip(): break
-
-        return doc[i:len(doc)-j]
-
-    def _read_to_next_section(self):
-        section = self._doc.read_to_next_empty_line()
-
-        while not self._is_at_section() and not self._doc.eof():
-            if not self._doc.peek(-1).strip(): # previous line was empty
-                section += ['']
-
-            section += self._doc.read_to_next_empty_line()
-
-        return section
-
-    def _read_sections(self):
-        while not self._doc.eof():
-            data = self._read_to_next_section()
-            name = data[0].strip()
-
-            if name.startswith('..'): # index section
-                yield name, data[1:]
-            elif len(data) < 2:
-                yield StopIteration
-            else:
-                yield name, self._strip(data[2:])
-
-    def _parse_param_list(self,content):
-        r = Reader(content)
-        params = []
-        while not r.eof():
-            header = r.read().strip()
-            if ' : ' in header:
-                arg_name, arg_type = header.split(' : ')[:2]
-            else:
-                arg_name, arg_type = header, ''
-
-            desc = r.read_to_next_unindented_line()
-            desc = dedent_lines(desc)
-
-            params.append((arg_name,arg_type,desc))
-
-        return params
-
-
-    _name_rgx = re.compile(r"^\s*(:(?P<role>\w+):`(?P<name>[a-zA-Z0-9_.-]+)`|"
-                           r" (?P<name2>[a-zA-Z0-9_.-]+))\s*", re.X)
-    def _parse_see_also(self, content):
-        """
-        func_name : Descriptive text
-            continued text
-        another_func_name : Descriptive text
-        func_name1, func_name2, :meth:`func_name`, func_name3
-
-        """
-        items = []
-
-        def parse_item_name(text):
-            """Match ':role:`name`' or 'name'"""
-            m = self._name_rgx.match(text)
-            if m:
-                g = m.groups()
-                if g[1] is None:
-                    return g[3], None
-                else:
-                    return g[2], g[1]
-            raise ValueError("%s is not a item name" % text)
-
-        def push_item(name, rest):
-            if not name:
-                return
-            name, role = parse_item_name(name)
-            items.append((name, list(rest), role))
-            del rest[:]
-
-        current_func = None
-        rest = []
-
-        for line in content:
-            if not line.strip(): continue
-
-            m = self._name_rgx.match(line)
-            if m and line[m.end():].strip().startswith(':'):
-                push_item(current_func, rest)
-                current_func, line = line[:m.end()], line[m.end():]
-                rest = [line.split(':', 1)[1].strip()]
-                if not rest[0]:
-                    rest = []
-            elif not line.startswith(' '):
-                push_item(current_func, rest)
-                current_func = None
-                if ',' in line:
-                    for func in line.split(','):
-                        if func.strip():
-                            push_item(func, [])
-                elif line.strip():
-                    current_func = line
-            elif current_func is not None:
-                rest.append(line.strip())
-        push_item(current_func, rest)
-        return items
-
-    def _parse_index(self, section, content):
-        """
-        .. index: default
-           :refguide: something, else, and more
-
-        """
-        def strip_each_in(lst):
-            return [s.strip() for s in lst]
-
-        out = {}
-        section = section.split('::')
-        if len(section) > 1:
-            out['default'] = strip_each_in(section[1].split(','))[0]
-        for line in content:
-            line = line.split(':')
-            if len(line) > 2:
-                out[line[1]] = strip_each_in(line[2].split(','))
-        return out
-
-    def _parse_summary(self):
-        """Grab signature (if given) and summary"""
-        if self._is_at_section():
-            return
-
-        # If several signatures present, take the last one
-        while True:
-            summary = self._doc.read_to_next_empty_line()
-            summary_str = " ".join([s.strip() for s in summary]).strip()
-            if re.compile('^([\w., ]+=)?\s*[\w\.]+\(.*\)$').match(summary_str):
-                self['Signature'] = summary_str
-                if not self._is_at_section():
-                    continue
-            break
-
-        if summary is not None:
-            self['Summary'] = summary
-
-        if not self._is_at_section():
-            self['Extended Summary'] = self._read_to_next_section()
-
-    def _parse(self):
-        self._doc.reset()
-        self._parse_summary()
-
-        for (section,content) in self._read_sections():
-            if not section.startswith('..'):
-                section = ' '.join([s.capitalize() for s in section.split(' ')])
-            if section in ('Parameters', 'Returns', 'Raises', 'Warns',
-                           'Other Parameters', 'Attributes', 'Methods'):
-                self[section] = self._parse_param_list(content)
-            elif section.startswith('.. index::'):
-                self['index'] = self._parse_index(section, content)
-            elif section == 'See Also':
-                self['See Also'] = self._parse_see_also(content)
-            else:
-                self[section] = content
-
-    # string conversion routines
-
-    def _str_header(self, name, symbol='-'):
-        return [name, len(name)*symbol]
-
-    def _str_indent(self, doc, indent=4):
-        out = []
-        for line in doc:
-            out += [' '*indent + line]
-        return out
-
-    def _str_signature(self):
-        if self['Signature']:
-            return [self['Signature'].replace('*','\*')] + ['']
-        else:
-            return ['']
-
-    def _str_summary(self):
-        if self['Summary']:
-            return self['Summary'] + ['']
-        else:
-            return []
-
-    def _str_extended_summary(self):
-        if self['Extended Summary']:
-            return self['Extended Summary'] + ['']
-        else:
-            return []
-
-    def _str_param_list(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            for param,param_type,desc in self[name]:
-                if param_type:
-                    out += ['%s : %s' % (param, param_type)]
-                else:
-                    out += [param]
-                out += self._str_indent(desc)
-            out += ['']
-        return out
-
-    def _str_section(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            out += self[name]
-            out += ['']
-        return out
-
-    def _str_see_also(self, func_role):
-        if not self['See Also']: return []
-        out = []
-        out += self._str_header("See Also")
-        last_had_desc = True
-        for func, desc, role in self['See Also']:
-            if role:
-                link = ':%s:`%s`' % (role, func)
-            elif func_role:
-                link = ':%s:`%s`' % (func_role, func)
-            else:
-                link = "`%s`_" % func
-            if desc or last_had_desc:
-                out += ['']
-                out += [link]
-            else:
-                out[-1] += ", %s" % link
-            if desc:
-                out += self._str_indent([' '.join(desc)])
-                last_had_desc = True
-            else:
-                last_had_desc = False
-        out += ['']
-        return out
-
-    def _str_index(self):
-        idx = self['index']
-        out = []
-        out += ['.. index:: %s' % idx.get('default','')]
-        for section, references in idx.items():
-            if section == 'default':
-                continue
-            out += ['   :%s: %s' % (section, ', '.join(references))]
-        return out
-
-    def __str__(self, func_role=''):
-        out = []
-        out += self._str_signature()
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        for param_list in ('Parameters', 'Returns', 'Other Parameters',
-                           'Raises', 'Warns'):
-            out += self._str_param_list(param_list)
-        out += self._str_section('Warnings')
-        out += self._str_see_also(func_role)
-        for s in ('Notes','References','Examples'):
-            out += self._str_section(s)
-        for param_list in ('Attributes', 'Methods'):
-            out += self._str_param_list(param_list)
-        out += self._str_index()
-        return '\n'.join(out)
-
-
-def indent(str,indent=4):
-    indent_str = ' '*indent
-    if str is None:
-        return indent_str
-    lines = str.split('\n')
-    return '\n'.join(indent_str + l for l in lines)
-
-def dedent_lines(lines):
-    """Deindent a list of lines maximally"""
-    return textwrap.dedent("\n".join(lines)).split("\n")
-
-def header(text, style='-'):
-    return text + '\n' + style*len(text) + '\n'
-
-
-class FunctionDoc(NumpyDocString):
-    def __init__(self, func, role='func', doc=None, config={}):
-        self._f = func
-        self._role = role # e.g. "func" or "meth"
-
-        if doc is None:
-            if func is None:
-                raise ValueError("No function or docstring given")
-            doc = inspect.getdoc(func) or ''
-        NumpyDocString.__init__(self, doc)
-
-        if not self['Signature'] and func is not None:
-            func, func_name = self.get_func()
-            try:
-                # try to read signature
-                if sys.version_info[0] >= 3:
-                    argspec = inspect.getfullargspec(func)
-                else:
-                    argspec = inspect.getargspec(func)
-                argspec = inspect.formatargspec(*argspec)
-                argspec = argspec.replace('*','\*')
-                signature = '%s%s' % (func_name, argspec)
-            except TypeError as e:
-                signature = '%s()' % func_name
-            self['Signature'] = signature
-
-    def get_func(self):
-        func_name = getattr(self._f, '__name__', self.__class__.__name__)
-        if inspect.isclass(self._f):
-            func = getattr(self._f, '__call__', self._f.__init__)
-        else:
-            func = self._f
-        return func, func_name
-
-    def __str__(self):
-        out = ''
-
-        func, func_name = self.get_func()
-        signature = self['Signature'].replace('*', '\*')
-
-        roles = {'func': 'function',
-                 'meth': 'method'}
-
-        if self._role:
-            if self._role not in roles:
-                print("Warning: invalid role %s" % self._role)
-            out += '.. %s:: %s\n    \n\n' % (roles.get(self._role,''),
-                                             func_name)
-
-        out += super(FunctionDoc, self).__str__(func_role=self._role)
-        return out
-
-
-class ClassDoc(NumpyDocString):
-
-    extra_public_methods = ['__call__']
-
-    def __init__(self, cls, doc=None, modulename='', func_doc=FunctionDoc,
-                 config={}):
-        if not inspect.isclass(cls) and cls is not None:
-            raise ValueError("Expected a class or None, but got %r" % cls)
-        self._cls = cls
-
-        if modulename and not modulename.endswith('.'):
-            modulename += '.'
-        self._mod = modulename
-
-        if doc is None:
-            if cls is None:
-                raise ValueError("No class or documentation string given")
-            doc = pydoc.getdoc(cls)
-
-        NumpyDocString.__init__(self, doc)
-
-        if config.get('show_class_members', True):
-            def splitlines_x(s):
-                if not s:
-                    return []
-                else:
-                    return s.splitlines()
-
-            for field, items in [('Methods', self.methods),
-                                 ('Attributes', self.properties)]:
-                if not self[field]:
-                    doc_list = []
-                    for name in sorted(items):
-                         try:
-                            doc_item = pydoc.getdoc(getattr(self._cls, name))
-                            doc_list.append((name, '', splitlines_x(doc_item)))
-                         except AttributeError:
-                            pass # method doesn't exist
-                    self[field] = doc_list
-
-    @property
-    def methods(self):
-        if self._cls is None:
-            return []
-        return [name for name,func in inspect.getmembers(self._cls)
-                if ((not name.startswith('_')
-                     or name in self.extra_public_methods)
-                    and isinstance(func, collections.Callable))]
-
-    @property
-    def properties(self):
-        if self._cls is None:
-            return []
-        return [name for name,func in inspect.getmembers(self._cls)
-                if not name.startswith('_') and
-                (func is None or isinstance(func, property) or
-                 inspect.isgetsetdescriptor(func))]
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape_sphinx.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape_sphinx.py
deleted file mode 100644
index cdc2a37..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/docscrape_sphinx.py
+++ /dev/null
@@ -1,274 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import sys, re, inspect, textwrap, pydoc
-import sphinx
-import collections
-from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-class SphinxDocString(NumpyDocString):
-    def __init__(self, docstring, config={}):
-        NumpyDocString.__init__(self, docstring, config=config)
-        self.load_config(config)
-
-    def load_config(self, config):
-        self.use_plots = config.get('use_plots', False)
-        self.class_members_toctree = config.get('class_members_toctree', True)
-
-    # string conversion routines
-    def _str_header(self, name, symbol='`'):
-        return ['.. rubric:: ' + name, '']
-
-    def _str_field_list(self, name):
-        return [':' + name + ':']
-
-    def _str_indent(self, doc, indent=4):
-        out = []
-        for line in doc:
-            out += [' '*indent + line]
-        return out
-
-    def _str_signature(self):
-        return ['']
-        if self['Signature']:
-            return ['``%s``' % self['Signature']] + ['']
-        else:
-            return ['']
-
-    def _str_summary(self):
-        return self['Summary'] + ['']
-
-    def _str_extended_summary(self):
-        return self['Extended Summary'] + ['']
-
-    def _str_returns(self):
-        out = []
-        if self['Returns']:
-            out += self._str_field_list('Returns')
-            out += ['']
-            for param, param_type, desc in self['Returns']:
-                if param_type:
-                    out += self._str_indent(['**%s** : %s' % (param.strip(),
-                                                              param_type)])
-                else:
-                    out += self._str_indent([param.strip()])
-                if desc:
-                    out += ['']
-                    out += self._str_indent(desc, 8)
-                out += ['']
-        return out
-
-    def _str_param_list(self, name):
-        out = []
-        if self[name]:
-            out += self._str_field_list(name)
-            out += ['']
-            for param, param_type, desc in self[name]:
-                if param_type:
-                    out += self._str_indent(['**%s** : %s' % (param.strip(),
-                                                              param_type)])
-                else:
-                    out += self._str_indent(['**%s**' % param.strip()])
-                if desc:
-                    out += ['']
-                    out += self._str_indent(desc, 8)
-                out += ['']
-        return out
-
-    @property
-    def _obj(self):
-        if hasattr(self, '_cls'):
-            return self._cls
-        elif hasattr(self, '_f'):
-            return self._f
-        return None
-
-    def _str_member_list(self, name):
-        """
-        Generate a member listing, autosummary:: table where possible,
-        and a table where not.
-
-        """
-        out = []
-        if self[name]:
-            out += ['.. rubric:: %s' % name, '']
-            prefix = getattr(self, '_name', '')
-
-            if prefix:
-                prefix = '~%s.' % prefix
-
-            autosum = []
-            others = []
-            for param, param_type, desc in self[name]:
-                param = param.strip()
-
-                # Check if the referenced member can have a docstring or not
-                param_obj = getattr(self._obj, param, None)
-                if not (callable(param_obj)
-                        or isinstance(param_obj, property)
-                        or inspect.isgetsetdescriptor(param_obj)):
-                    param_obj = None
-
-                if param_obj and (pydoc.getdoc(param_obj) or not desc):
-                    # Referenced object has a docstring
-                    autosum += ["   %s%s" % (prefix, param)]
-                else:
-                    others.append((param, param_type, desc))
-
-            if autosum:
-                out += ['.. autosummary::']
-                if self.class_members_toctree:
-                    out += ['   :toctree:']
-                out += [''] + autosum
-
-            if others:
-                maxlen_0 = max(3, max([len(x[0]) for x in others]))
-                hdr = sixu("=")*maxlen_0 + sixu("  ") + sixu("=")*10
-                fmt = sixu('%%%ds  %%s  ') % (maxlen_0,)
-                out += ['', hdr]
-                for param, param_type, desc in others:
-                    desc = sixu(" ").join(x.strip() for x in desc).strip()
-                    if param_type:
-                        desc = "(%s) %s" % (param_type, desc)
-                    out += [fmt % (param.strip(), desc)]
-                out += [hdr]
-            out += ['']
-        return out
-
-    def _str_section(self, name):
-        out = []
-        if self[name]:
-            out += self._str_header(name)
-            out += ['']
-            content = textwrap.dedent("\n".join(self[name])).split("\n")
-            out += content
-            out += ['']
-        return out
-
-    def _str_see_also(self, func_role):
-        out = []
-        if self['See Also']:
-            see_also = super(SphinxDocString, self)._str_see_also(func_role)
-            out = ['.. seealso::', '']
-            out += self._str_indent(see_also[2:])
-        return out
-
-    def _str_warnings(self):
-        out = []
-        if self['Warnings']:
-            out = ['.. warning::', '']
-            out += self._str_indent(self['Warnings'])
-        return out
-
-    def _str_index(self):
-        idx = self['index']
-        out = []
-        if len(idx) == 0:
-            return out
-
-        out += ['.. index:: %s' % idx.get('default','')]
-        for section, references in idx.items():
-            if section == 'default':
-                continue
-            elif section == 'refguide':
-                out += ['   single: %s' % (', '.join(references))]
-            else:
-                out += ['   %s: %s' % (section, ','.join(references))]
-        return out
-
-    def _str_references(self):
-        out = []
-        if self['References']:
-            out += self._str_header('References')
-            if isinstance(self['References'], str):
-                self['References'] = [self['References']]
-            out.extend(self['References'])
-            out += ['']
-            # Latex collects all references to a separate bibliography,
-            # so we need to insert links to it
-            if sphinx.__version__ >= "0.6":
-                out += ['.. only:: latex','']
-            else:
-                out += ['.. latexonly::','']
-            items = []
-            for line in self['References']:
-                m = re.match(r'.. \[([a-z0-9._-]+)\]', line, re.I)
-                if m:
-                    items.append(m.group(1))
-            out += ['   ' + ", ".join(["[%s]_" % item for item in items]), '']
-        return out
-
-    def _str_examples(self):
-        examples_str = "\n".join(self['Examples'])
-
-        if (self.use_plots and 'import matplotlib' in examples_str
-                and 'plot::' not in examples_str):
-            out = []
-            out += self._str_header('Examples')
-            out += ['.. plot::', '']
-            out += self._str_indent(self['Examples'])
-            out += ['']
-            return out
-        else:
-            return self._str_section('Examples')
-
-    def __str__(self, indent=0, func_role="obj"):
-        out = []
-        out += self._str_signature()
-        out += self._str_index() + ['']
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        out += self._str_param_list('Parameters')
-        out += self._str_returns()
-        for param_list in ('Other Parameters', 'Raises', 'Warns'):
-            out += self._str_param_list(param_list)
-        out += self._str_warnings()
-        out += self._str_see_also(func_role)
-        out += self._str_section('Notes')
-        out += self._str_references()
-        out += self._str_examples()
-        for param_list in ('Attributes', 'Methods'):
-            out += self._str_member_list(param_list)
-        out = self._str_indent(out,indent)
-        return '\n'.join(out)
-
-class SphinxFunctionDoc(SphinxDocString, FunctionDoc):
-    def __init__(self, obj, doc=None, config={}):
-        self.load_config(config)
-        FunctionDoc.__init__(self, obj, doc=doc, config=config)
-
-class SphinxClassDoc(SphinxDocString, ClassDoc):
-    def __init__(self, obj, doc=None, func_doc=None, config={}):
-        self.load_config(config)
-        ClassDoc.__init__(self, obj, doc=doc, func_doc=None, config=config)
-
-class SphinxObjDoc(SphinxDocString):
-    def __init__(self, obj, doc=None, config={}):
-        self._f = obj
-        self.load_config(config)
-        SphinxDocString.__init__(self, doc, config=config)
-
-def get_doc_object(obj, what=None, doc=None, config={}):
-    if what is None:
-        if inspect.isclass(obj):
-            what = 'class'
-        elif inspect.ismodule(obj):
-            what = 'module'
-        elif isinstance(obj, collections.Callable):
-            what = 'function'
-        else:
-            what = 'object'
-    if what == 'class':
-        return SphinxClassDoc(obj, func_doc=SphinxFunctionDoc, doc=doc,
-                              config=config)
-    elif what in ('function', 'method'):
-        return SphinxFunctionDoc(obj, doc=doc, config=config)
-    else:
-        if doc is None:
-            doc = pydoc.getdoc(obj)
-        return SphinxObjDoc(obj, doc, config=config)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/doctest.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/doctest.py
deleted file mode 100644
index 22f0cba..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/doctest.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This is a set of three directives that allow us to insert metadata
-about doctests into the .rst files so the testing framework knows
-which tests to skip.
-
-This is quite different from the doctest extension in Sphinx itself,
-which actually does something.  For astropy, all of the testing is
-centrally managed from py.test and Sphinx is not used for running
-tests.
-"""
-from docutils.nodes import literal_block
-from sphinx.util.compat import Directive
-
-
-class DoctestSkipDirective(Directive):
-    has_content = True
-
-    def run(self):
-        code = '\n'.join(self.content)
-        return [literal_block(code, code)]
-
-
-class DoctestRequiresDirective(DoctestSkipDirective):
-    # This is silly, but we really support an unbounded number of
-    # optional arguments
-    optional_arguments = 64
-
-
-def setup(app):
-    app.add_directive('doctest-requires', DoctestRequiresDirective)
-    app.add_directive('doctest-skip', DoctestSkipDirective)
-    app.add_directive('doctest-skip-all', DoctestSkipDirective)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/edit_on_github.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/edit_on_github.py
deleted file mode 100644
index 793bf8c..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/edit_on_github.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-This extension makes it easy to edit documentation on github.
-
-It adds links associated with each docstring that go to the
-corresponding view source page on Github.  From there, the user can
-push the "Edit" button, edit the docstring, and submit a pull request.
-
-It has the following configuration options (to be set in the project's
-``conf.py``):
-
-* ``edit_on_github_project``
-    The name of the github project, in the form
-    "username/projectname".
-
-* ``edit_on_github_branch``
-    The name of the branch to edit.  If this is a released version,
-    this should be a git tag referring to that version.  For a
-    dev version, it often makes sense for it to be "master".  It
-    may also be a git hash.
-
-* ``edit_on_github_source_root``
-    The location within the source tree of the root of the
-    Python package.  Defaults to "lib".
-
-* ``edit_on_github_doc_root``
-    The location within the source tree of the root of the
-    documentation source.  Defaults to "doc", but it may make sense to
-    set it to "doc/source" if the project uses a separate source
-    directory.
-
-* ``edit_on_github_docstring_message``
-    The phrase displayed in the links to edit a docstring.  Defaults
-    to "[edit on github]".
-
-* ``edit_on_github_page_message``
-    The phrase displayed in the links to edit a RST page.  Defaults
-    to "[edit this page on github]".
-
-* ``edit_on_github_help_message``
-    The phrase displayed as a tooltip on the edit links.  Defaults to
-    "Push the Edit button on the next page"
-
-* ``edit_on_github_skip_regex``
-    When the path to the .rst file matches this regular expression,
-    no "edit this page on github" link will be added.  Defaults to
-    ``"_.*"``.
-"""
-import inspect
-import os
-import re
-import sys
-
-from docutils import nodes
-
-from sphinx import addnodes
-
-
-def import_object(modname, name):
-    """
-    Import the object given by *modname* and *name* and return it.
-    If not found, or the import fails, returns None.
-    """
-    try:
-        __import__(modname)
-        mod = sys.modules[modname]
-        obj = mod
-        for part in name.split('.'):
-            obj = getattr(obj, part)
-        return obj
-    except:
-        return None
-
-
-def get_url_base(app):
-    return  'http://github.com/%s/tree/%s/' % (
-        app.config.edit_on_github_project,
-        app.config.edit_on_github_branch)
-
-
-def doctree_read(app, doctree):
-    # Get the configuration parameters
-    if app.config.edit_on_github_project == 'REQUIRED':
-        raise ValueError(
-            "The edit_on_github_project configuration variable must be "
-            "provided in the conf.py")
-
-    source_root = app.config.edit_on_github_source_root
-    url = get_url_base(app)
-
-    docstring_message = app.config.edit_on_github_docstring_message
-
-    # Handle the docstring-editing links
-    for objnode in doctree.traverse(addnodes.desc):
-        if objnode.get('domain') != 'py':
-            continue
-        names = set()
-        for signode in objnode:
-            if not isinstance(signode, addnodes.desc_signature):
-                continue
-            modname = signode.get('module')
-            if not modname:
-                continue
-            fullname = signode.get('fullname')
-            if fullname in names:
-                # only one link per name, please
-                continue
-            names.add(fullname)
-            obj = import_object(modname, fullname)
-            anchor = None
-            if obj is not None:
-                try:
-                    lines, lineno = inspect.getsourcelines(obj)
-                except:
-                    pass
-                else:
-                    anchor = '#L%d' % lineno
-            if anchor:
-                real_modname = inspect.getmodule(obj).__name__
-                path = '%s%s%s.py%s' % (
-                    url, source_root, real_modname.replace('.', '/'), anchor)
-                onlynode = addnodes.only(expr='html')
-                onlynode += nodes.reference(
-                    reftitle=app.config.edit_on_github_help_message,
-                    refuri=path)
-                onlynode[0] += nodes.inline(
-                    '', '', nodes.raw('', ' ', format='html'),
-                    nodes.Text(docstring_message),
-                    classes=['edit-on-github', 'viewcode-link'])
-                signode += onlynode
-
-
-def html_page_context(app, pagename, templatename, context, doctree):
-    if (templatename == 'page.html' and
-        not re.match(app.config.edit_on_github_skip_regex, pagename)):
-
-        doc_root = app.config.edit_on_github_doc_root
-        if doc_root != '' and not doc_root.endswith('/'):
-            doc_root += '/'
-        doc_path = os.path.relpath(doctree.get('source'), app.builder.srcdir)
-        url = get_url_base(app)
-
-        page_message = app.config.edit_on_github_page_message
-
-        context['edit_on_github'] = url + doc_root + doc_path
-        context['edit_on_github_page_message'] = (
-            app.config.edit_on_github_page_message)
-
-
-def setup(app):
-    app.add_config_value('edit_on_github_project', 'REQUIRED', True)
-    app.add_config_value('edit_on_github_branch', 'master', True)
-    app.add_config_value('edit_on_github_source_root', 'lib', True)
-    app.add_config_value('edit_on_github_doc_root', 'doc', True)
-    app.add_config_value('edit_on_github_docstring_message',
-                         '[edit on github]', True)
-    app.add_config_value('edit_on_github_page_message',
-                         'Edit This Page on Github', True)
-    app.add_config_value('edit_on_github_help_message',
-                         'Push the Edit button on the next page', True)
-    app.add_config_value('edit_on_github_skip_regex',
-                         '_.*', True)
-
-    app.connect('doctree-read', doctree_read)
-    app.connect('html-page-context', html_page_context)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/numpydoc.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/numpydoc.py
deleted file mode 100644
index 2bc2d1e..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/numpydoc.py
+++ /dev/null
@@ -1,187 +0,0 @@
-"""
-========
-numpydoc
-========
-
-Sphinx extension that handles docstrings in the Numpy standard format. [1]
-
-It will:
-
-- Convert Parameters etc. sections to field lists.
-- Convert See Also section to a See also entry.
-- Renumber references.
-- Extract the signature from the docstring, if it can't be determined otherwise.
-
-.. [1] https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import os, sys, re, pydoc
-import sphinx
-import inspect
-import collections
-
-if sphinx.__version__ < '1.0.1':
-    raise RuntimeError("Sphinx 1.0.1 or newer is required")
-
-from .docscrape_sphinx import get_doc_object, SphinxDocString
-from sphinx.util.compat import Directive
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-def mangle_docstrings(app, what, name, obj, options, lines,
-                      reference_offset=[0]):
-
-    cfg = dict(use_plots=app.config.numpydoc_use_plots,
-               show_class_members=app.config.numpydoc_show_class_members,
-               class_members_toctree=app.config.numpydoc_class_members_toctree,
-              )
-
-    if what == 'module':
-        # Strip top title
-        title_re = re.compile(sixu('^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*'),
-                              re.I|re.S)
-        lines[:] = title_re.sub(sixu(''), sixu("\n").join(lines)).split(sixu("\n"))
-    else:
-        doc = get_doc_object(obj, what, sixu("\n").join(lines), config=cfg)
-        if sys.version_info[0] >= 3:
-            doc = str(doc)
-        else:
-            doc = unicode(doc)
-        lines[:] = doc.split(sixu("\n"))
-
-    if app.config.numpydoc_edit_link and hasattr(obj, '__name__') and \
-           obj.__name__:
-        if hasattr(obj, '__module__'):
-            v = dict(full_name=sixu("%s.%s") % (obj.__module__, obj.__name__))
-        else:
-            v = dict(full_name=obj.__name__)
-        lines += [sixu(''), sixu('.. htmlonly::'), sixu('')]
-        lines += [sixu('    %s') % x for x in
-                  (app.config.numpydoc_edit_link % v).split("\n")]
-
-    # replace reference numbers so that there are no duplicates
-    references = []
-    for line in lines:
-        line = line.strip()
-        m = re.match(sixu('^.. \\[([a-z0-9_.-])\\]'), line, re.I)
-        if m:
-            references.append(m.group(1))
-
-    # start renaming from the longest string, to avoid overwriting parts
-    references.sort(key=lambda x: -len(x))
-    if references:
-        for i, line in enumerate(lines):
-            for r in references:
-                if re.match(sixu('^\\d+$'), r):
-                    new_r = sixu("R%d") % (reference_offset[0] + int(r))
-                else:
-                    new_r = sixu("%s%d") % (r, reference_offset[0])
-                lines[i] = lines[i].replace(sixu('[%s]_') % r,
-                                            sixu('[%s]_') % new_r)
-                lines[i] = lines[i].replace(sixu('.. [%s]') % r,
-                                            sixu('.. [%s]') % new_r)
-
-    reference_offset[0] += len(references)
-
-def mangle_signature(app, what, name, obj, options, sig, retann):
-    # Do not try to inspect classes that don't define `__init__`
-    if (inspect.isclass(obj) and
-        (not hasattr(obj, '__init__') or
-        'initializes x; see ' in pydoc.getdoc(obj.__init__))):
-        return '', ''
-
-    if not (isinstance(obj, collections.Callable) or hasattr(obj, '__argspec_is_invalid_')): return
-    if not hasattr(obj, '__doc__'): return
-
-    doc = SphinxDocString(pydoc.getdoc(obj))
-    if doc['Signature']:
-        sig = re.sub(sixu("^[^(]*"), sixu(""), doc['Signature'])
-        return sig, sixu('')
-
-def setup(app, get_doc_object_=get_doc_object):
-    if not hasattr(app, 'add_config_value'):
-        return # probably called by nose, better bail out
-
-    global get_doc_object
-    get_doc_object = get_doc_object_
-
-    app.connect('autodoc-process-docstring', mangle_docstrings)
-    app.connect('autodoc-process-signature', mangle_signature)
-    app.add_config_value('numpydoc_edit_link', None, False)
-    app.add_config_value('numpydoc_use_plots', None, False)
-    app.add_config_value('numpydoc_show_class_members', True, True)
-    app.add_config_value('numpydoc_class_members_toctree', True, True)
-
-    # Extra mangling domains
-    app.add_domain(NumpyPythonDomain)
-    app.add_domain(NumpyCDomain)
-
-#------------------------------------------------------------------------------
-# Docstring-mangling domains
-#------------------------------------------------------------------------------
-
-from docutils.statemachine import ViewList
-from sphinx.domains.c import CDomain
-from sphinx.domains.python import PythonDomain
-
-class ManglingDomainBase(object):
-    directive_mangling_map = {}
-
-    def __init__(self, *a, **kw):
-        super(ManglingDomainBase, self).__init__(*a, **kw)
-        self.wrap_mangling_directives()
-
-    def wrap_mangling_directives(self):
-        for name, objtype in list(self.directive_mangling_map.items()):
-            self.directives[name] = wrap_mangling_directive(
-                self.directives[name], objtype)
-
-class NumpyPythonDomain(ManglingDomainBase, PythonDomain):
-    name = 'np'
-    directive_mangling_map = {
-        'function': 'function',
-        'class': 'class',
-        'exception': 'class',
-        'method': 'function',
-        'classmethod': 'function',
-        'staticmethod': 'function',
-        'attribute': 'attribute',
-    }
-    indices = []
-
-class NumpyCDomain(ManglingDomainBase, CDomain):
-    name = 'np-c'
-    directive_mangling_map = {
-        'function': 'function',
-        'member': 'attribute',
-        'macro': 'function',
-        'type': 'class',
-        'var': 'object',
-    }
-
-def wrap_mangling_directive(base_directive, objtype):
-    class directive(base_directive):
-        def run(self):
-            env = self.state.document.settings.env
-
-            name = None
-            if self.arguments:
-                m = re.match(r'^(.*\s+)?(.*?)(\(.*)?', self.arguments[0])
-                name = m.group(2).strip()
-
-            if not name:
-                name = self.arguments[0]
-
-            lines = list(self.content)
-            mangle_docstrings(env.app, objtype, name, None, None, lines)
-            self.content = ViewList(lines, self.content.parent)
-
-            return base_directive.run(self)
-
-    return directive
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/phantom_import.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/phantom_import.py
deleted file mode 100644
index 9a60b4a..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/phantom_import.py
+++ /dev/null
@@ -1,167 +0,0 @@
-"""
-==============
-phantom_import
-==============
-
-Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar
-extensions to use docstrings loaded from an XML file.
-
-This extension loads an XML file in the Pydocweb format [1] and
-creates a dummy module that contains the specified docstrings. This
-can be used to get the current docstrings from a Pydocweb instance
-without needing to rebuild the documented module.
-
-.. [1] http://code.google.com/p/pydocweb
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import imp, sys, compiler, types, os, inspect, re
-
-def setup(app):
-    app.connect('builder-inited', initialize)
-    app.add_config_value('phantom_import_file', None, True)
-
-def initialize(app):
-    fn = app.config.phantom_import_file
-    if (fn and os.path.isfile(fn)):
-        print("[numpydoc] Phantom importing modules from", fn, "...")
-        import_phantom_module(fn)
-
-#------------------------------------------------------------------------------
-# Creating 'phantom' modules from an XML description
-#------------------------------------------------------------------------------
-def import_phantom_module(xml_file):
-    """
-    Insert a fake Python module to sys.modules, based on a XML file.
-
-    The XML file is expected to conform to Pydocweb DTD. The fake
-    module will contain dummy objects, which guarantee the following:
-
-    - Docstrings are correct.
-    - Class inheritance relationships are correct (if present in XML).
-    - Function argspec is *NOT* correct (even if present in XML).
-      Instead, the function signature is prepended to the function docstring.
-    - Class attributes are *NOT* correct; instead, they are dummy objects.
-
-    Parameters
-    ----------
-    xml_file : str
-        Name of an XML file to read
-    
-    """
-    import lxml.etree as etree
-
-    object_cache = {}
-
-    tree = etree.parse(xml_file)
-    root = tree.getroot()
-
-    # Sort items so that
-    # - Base classes come before classes inherited from them
-    # - Modules come before their contents
-    all_nodes = dict([(n.attrib['id'], n) for n in root])
-    
-    def _get_bases(node, recurse=False):
-        bases = [x.attrib['ref'] for x in node.findall('base')]
-        if recurse:
-            j = 0
-            while True:
-                try:
-                    b = bases[j]
-                except IndexError: break
-                if b in all_nodes:
-                    bases.extend(_get_bases(all_nodes[b]))
-                j += 1
-        return bases
-
-    type_index = ['module', 'class', 'callable', 'object']
-    
-    def base_cmp(a, b):
-        x = cmp(type_index.index(a.tag), type_index.index(b.tag))
-        if x != 0: return x
-
-        if a.tag == 'class' and b.tag == 'class':
-            a_bases = _get_bases(a, recurse=True)
-            b_bases = _get_bases(b, recurse=True)
-            x = cmp(len(a_bases), len(b_bases))
-            if x != 0: return x
-            if a.attrib['id'] in b_bases: return -1
-            if b.attrib['id'] in a_bases: return 1
-        
-        return cmp(a.attrib['id'].count('.'), b.attrib['id'].count('.'))
-
-    nodes = root.getchildren()
-    nodes.sort(base_cmp)
-
-    # Create phantom items
-    for node in nodes:
-        name = node.attrib['id']
-        doc = (node.text or '').decode('string-escape') + "\n"
-        if doc == "\n": doc = ""
-
-        # create parent, if missing
-        parent = name
-        while True:
-            parent = '.'.join(parent.split('.')[:-1])
-            if not parent: break
-            if parent in object_cache: break
-            obj = imp.new_module(parent)
-            object_cache[parent] = obj
-            sys.modules[parent] = obj
-
-        # create object
-        if node.tag == 'module':
-            obj = imp.new_module(name)
-            obj.__doc__ = doc
-            sys.modules[name] = obj
-        elif node.tag == 'class':
-            bases = [object_cache[b] for b in _get_bases(node)
-                     if b in object_cache]
-            bases.append(object)
-            init = lambda self: None
-            init.__doc__ = doc
-            obj = type(name, tuple(bases), {'__doc__': doc, '__init__': init})
-            obj.__name__ = name.split('.')[-1]
-        elif node.tag == 'callable':
-            funcname = node.attrib['id'].split('.')[-1]
-            argspec = node.attrib.get('argspec')
-            if argspec:
-                argspec = re.sub('^[^(]*', '', argspec)
-                doc = "%s%s\n\n%s" % (funcname, argspec, doc)
-            obj = lambda: 0
-            obj.__argspec_is_invalid_ = True
-            if sys.version_info[0] >= 3:
-                obj.__name__ = funcname
-            else:
-                obj.func_name = funcname
-            obj.__name__ = name
-            obj.__doc__ = doc
-            if inspect.isclass(object_cache[parent]):
-                obj.__objclass__ = object_cache[parent]
-        else:
-            class Dummy(object): pass
-            obj = Dummy()
-            obj.__name__ = name
-            obj.__doc__ = doc
-            if inspect.isclass(object_cache[parent]):
-                obj.__get__ = lambda: None
-        object_cache[name] = obj
-
-        if parent:
-            if inspect.ismodule(object_cache[parent]):
-                obj.__module__ = parent
-                setattr(object_cache[parent], name.split('.')[-1], obj)
-
-    # Populate items
-    for node in root:
-        obj = object_cache.get(node.attrib['id'])
-        if obj is None: continue
-        for ref in node.findall('ref'):
-            if node.tag == 'class':
-                if ref.attrib['ref'].startswith(node.attrib['id'] + '.'):
-                    setattr(obj, ref.attrib['name'],
-                            object_cache.get(ref.attrib['ref']))
-            else:
-                setattr(obj, ref.attrib['name'],
-                        object_cache.get(ref.attrib['ref']))
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/smart_resolver.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/smart_resolver.py
deleted file mode 100644
index 2cc7164..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/smart_resolver.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-"""
-The classes in the astropy docs are documented by their API location,
-which is not necessarily where they are defined in the source.  This
-causes a problem when certain automated features of the doc build,
-such as the inheritance diagrams or the `Bases` list of a class
-reference a class by its canonical location rather than its "user"
-location.
-
-In the `autodoc-process-docstring` event, a mapping from the actual
-name to the API name is maintained.  Later, in the `missing-reference`
-enent, unresolved references are looked up in this dictionary and
-corrected if possible.
-"""
-
-from docutils.nodes import literal
-
-
-def process_docstring(app, what, name, obj, options, lines):
-    if isinstance(obj, type):
-        env = app.env
-        if not hasattr(env, 'class_name_mapping'):
-            env.class_name_mapping = {}
-        mapping = env.class_name_mapping
-        mapping[obj.__module__ + '.' + obj.__name__] = name
-
-
-def missing_reference_handler(app, env, node, contnode):
-    if not hasattr(env, 'class_name_mapping'):
-        env.class_name_mapping = {}
-    mapping = env.class_name_mapping
-    reftype = node['reftype']
-    reftarget = node['reftarget']
-    if reftype in ('obj', 'class', 'exc', 'meth'):
-        reftarget = node['reftarget']
-        suffix = ''
-        if reftarget not in mapping:
-            if '.' in reftarget:
-                front, suffix = reftarget.rsplit('.', 1)
-            else:
-                suffix = reftarget
-
-            if suffix.startswith('_') and not suffix.startswith('__'):
-                # If this is a reference to a hidden class or method,
-                # we can't link to it, but we don't want to have a
-                # nitpick warning.
-                return node[0].deepcopy()
-
-            if reftype in ('obj', 'meth') and '.' in reftarget:
-                if front in mapping:
-                    reftarget = front
-                    suffix = '.' + suffix
-
-        if reftarget in mapping:
-            newtarget = mapping[reftarget] + suffix
-            if not node['refexplicit'] and not '~' in node.rawsource:
-                contnode = literal(text=newtarget)
-            newnode = env.domains['py'].resolve_xref(
-                env, node['refdoc'], app.builder, 'class', newtarget,
-                node, contnode)
-            if newnode is not None:
-                newnode['reftitle'] = reftarget
-            return newnode
-
-
-def setup(app):
-    app.connect('autodoc-process-docstring', process_docstring)
-
-    app.connect('missing-reference', missing_reference_handler)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
deleted file mode 100644
index a58aa35..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. currentmodule:: {{ module }}
-
-.. auto{{ objtype }}:: {{ objname }}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
deleted file mode 100644
index 85105fa..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
+++ /dev/null
@@ -1,65 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
-   :show-inheritance:
-
-   {% if '__init__' in methods %}
-     {% set caught_result = methods.remove('__init__') %}
-   {% endif %}
-
-   {% block attributes_summary %}
-   {% if attributes %}
-
-   .. rubric:: Attributes Summary
-
-   .. autosummary::
-   {% for item in attributes %}
-      ~{{ name }}.{{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block methods_summary %}
-   {% if methods %}
-
-   .. rubric:: Methods Summary
-
-   .. autosummary::
-   {% for item in methods %}
-      ~{{ name }}.{{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block attributes_documentation %}
-   {% if attributes %}
-
-   .. rubric:: Attributes Documentation
-
-   {% for item in attributes %}
-   .. autoattribute:: {{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
-
-   {% block methods_documentation %}
-   {% if methods %}
-
-   .. rubric:: Methods Documentation
-
-   {% for item in methods %}
-   .. automethod:: {{ item }}
-   {%- endfor %}
-
-   {% endif %}
-   {% endblock %}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
deleted file mode 100644
index 11208a2..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-{% if referencefile %}
-.. include:: {{ referencefile }}
-{% endif %}
-
-{{ objname }}
-{{ underline }}
-
-.. automodule:: {{ fullname }}
-
-   {% block functions %}
-   {% if functions %}
-   .. rubric:: Functions
-
-   .. autosummary::
-   {% for item in functions %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
-
-   {% block classes %}
-   {% if classes %}
-   .. rubric:: Classes
-
-   .. autosummary::
-   {% for item in classes %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
-
-   {% block exceptions %}
-   {% if exceptions %}
-   .. rubric:: Exceptions
-
-   .. autosummary::
-   {% for item in exceptions %}
-      {{ item }}
-   {%- endfor %}
-   {% endif %}
-   {% endblock %}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/__init__.py
deleted file mode 100644
index 6476492..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/__init__.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import os
-import subprocess as sp
-import sys
-
-from textwrap import dedent
-
-import pytest
-
-
- at pytest.fixture
-def cython_testpackage(tmpdir, request):
-    """
-    Creates a trivial Cython package for use with tests.
-    """
-
-    test_pkg = tmpdir.mkdir('test_pkg')
-    test_pkg.mkdir('_eva_').ensure('__init__.py')
-    test_pkg.join('_eva_').join('unit02.pyx').write(dedent("""\
-        def pilot():
-            \"\"\"Returns the pilot of Eva Unit-02.\"\"\"
-
-            return True
-    """))
-
-    import astropy_helpers
-
-    test_pkg.join('setup.py').write(dedent("""\
-        import sys
-
-        sys.path.insert(0, {0!r})
-
-        from os.path import join
-        from setuptools import setup, Extension
-        from astropy_helpers.setup_helpers import register_commands
-
-        NAME = '_eva_'
-        VERSION = 0.1
-        RELEASE = True
-
-        cmdclassd = register_commands(NAME, VERSION, RELEASE)
-
-        setup(
-            name=NAME,
-            version=VERSION,
-            cmdclass=cmdclassd,
-            ext_modules=[Extension('_eva_.unit02',
-                                   [join('_eva_', 'unit02.pyx')])]
-        )
-    """.format(os.path.dirname(astropy_helpers.__path__[0]))))
-
-    test_pkg.chdir()
-    # Build the Cython module in a subprocess; otherwise strange things can
-    # happen with Cython's global module state
-    sp.call([sys.executable, 'setup.py', 'build_ext', '--inplace'])
-
-    sys.path.insert(0, str(test_pkg))
-    import _eva_.unit02
-
-    def cleanup(test_pkg=test_pkg):
-        for modname in ['_eva_', '_eva_.unit02']:
-            try:
-                del sys.modules[modname]
-            except KeyError:
-                pass
-
-        sys.path.remove(str(test_pkg))
-
-    request.addfinalizer(cleanup)
-
-    return test_pkg
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodapi.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodapi.py
deleted file mode 100644
index 07b12e4..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodapi.py
+++ /dev/null
@@ -1,346 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import os
-import sys
-
-import pytest
-
-from . import *
-from ....tests import *
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-pytest.importorskip('sphinx')  # skips these tests if sphinx not present
-
-
-class FakeConfig(object):
-    """
-    Mocks up a sphinx configuration setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        for k, v in kwargs.iteritems():
-            setattr(self, k, v)
-
-
-class FakeApp(object):
-    """
-    Mocks up a `sphinx.application.Application` object for automodapi tests
-    """
-
-    # Some default config values
-    _defaults = {
-        'automodapi_toctreedirnm': 'api',
-        'automodapi_writereprocessed': False
-    }
-
-    def __init__(self, **configs):
-        config = self._defaults.copy()
-        config.update(configs)
-        self.config = FakeConfig(**config)
-        self.info = []
-        self.warnings = []
-
-    def info(self, msg, loc):
-        self.info.append((msg, loc))
-
-    def warn(self, msg, loc):
-        self.warnings.append((msg, loc))
-
-
-am_replacer_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.tests.test_automodapi
-{options}
-
-This comes after
-"""
-
-am_replacer_basic_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
--------------------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-Class Inheritance Diagram
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automod-diagram:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :private-bases:
-    :parts: 1
-    {empty}
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-# the .format is necessary for editors that remove empty-line whitespace
-
-
-def test_am_replacer_basic():
-    """
-    Tests replacing an ".. automodapi::" with the automodapi no-option
-    template
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_str.format(options=''), fakeapp)
-
-    assert result == am_replacer_basic_expected
-
-am_replacer_noinh_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
--------------------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_noinh():
-    """
-    Tests replacing an ".. automodapi::" with no-inheritance-diagram
-    option
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    ops = ['', ':no-inheritance-diagram:']
-    ostr = '\n    '.join(ops)
-    result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
-
-    assert result == am_replacer_noinh_expected
-
-am_replacer_titleandhdrs_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.tests.test_automodapi Module
-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
-.. automodule:: astropy_helpers.sphinx.ext.tests.test_automodapi
-
-Functions
-*********
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :functions-only:
-    :toctree: api/
-
-Classes
-*******
-
-.. automodsumm:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :classes-only:
-    :toctree: api/
-
-Class Inheritance Diagram
-*************************
-
-.. automod-diagram:: astropy_helpers.sphinx.ext.tests.test_automodapi
-    :private-bases:
-    :parts: 1
-    {empty}
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_titleandhdrs():
-    """
-    Tests replacing an ".. automodapi::" entry with title-setting and header
-    character options.
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    ops = ['', ':title: A new title', ':headings: &*']
-    ostr = '\n    '.join(ops)
-    result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
-
-    assert result == am_replacer_titleandhdrs_expected
-
-
-am_replacer_nomain_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :no-main-docstr:
-
-This comes after
-"""
-
-am_replacer_nomain_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.automodapi Module
---------------------------------------------
-
-
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodapi
-    :functions-only:
-    :toctree: api/
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_nomain():
-    """
-    Tests replacing an ".. automodapi::" with "no-main-docstring" .
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_nomain_str, fakeapp)
-
-    assert result == am_replacer_nomain_expected
-
-
-am_replacer_skip_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :skip: something1
-    :skip: something2
-
-This comes after
-"""
-
-am_replacer_skip_expected = """
-This comes before
-
-astropy_helpers.sphinx.ext.automodapi Module
---------------------------------------------
-
-.. automodule:: astropy_helpers.sphinx.ext.automodapi
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodapi
-    :functions-only:
-    :toctree: api/
-    :skip: something1,something2
-
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_skip():
-    """
-    Tests using the ":skip: option in an ".. automodapi::" .
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_skip_str, fakeapp)
-
-    assert result == am_replacer_skip_expected
-
-
-am_replacer_invalidop_str = """
-This comes before
-
-.. automodapi:: astropy_helpers.sphinx.ext.automodapi
-    :invalid-option:
-
-This comes after
-"""
-
-
-def test_am_replacer_invalidop():
-    """
-    Tests that a sphinx warning is produced with an invalid option.
-    """
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    automodapi_replace(am_replacer_invalidop_str, fakeapp)
-
-    expected_warnings = [('Found additional options invalid-option in '
-                          'automodapi.', None)]
-
-    assert fakeapp.warnings == expected_warnings
-
-
-am_replacer_cython_str = """
-This comes before
-
-.. automodapi:: _eva_.unit02
-{options}
-
-This comes after
-"""
-
-am_replacer_cython_expected = """
-This comes before
-
-_eva_.unit02 Module
--------------------
-
-.. automodule:: _eva_.unit02
-
-Functions
-^^^^^^^^^
-
-.. automodsumm:: _eva_.unit02
-    :functions-only:
-    :toctree: api/
-
-This comes after
-""".format(empty='').replace('/', os.sep)
-
-
-def test_am_replacer_cython(cython_testpackage):
-    """
-    Tests replacing an ".. automodapi::" for a Cython module.
-    """
-
-    from ..automodapi import automodapi_replace
-
-    fakeapp = FakeApp()
-    result = automodapi_replace(am_replacer_cython_str.format(options=''),
-                                fakeapp)
-
-    assert result == am_replacer_cython_expected
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodsumm.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodsumm.py
deleted file mode 100644
index 74d4900..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_automodsumm.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import sys
-
-import pytest
-
-from . import *
-from ....tests import *
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-pytest.importorskip('sphinx')  # skips these tests if sphinx not present
-
-
-class FakeEnv(object):
-    """
-    Mocks up a sphinx env setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        for k, v in kwargs.iteritems():
-            setattr(self, k, v)
-
-
-class FakeBuilder(object):
-    """
-    Mocks up a sphinx builder setting construct for automodapi tests
-    """
-    def __init__(self, **kwargs):
-        self.env = FakeEnv(**kwargs)
-
-
-class FakeApp(object):
-    """
-    Mocks up a `sphinx.application.Application` object for automodapi tests
-    """
-    def __init__(self, srcdir, automodapipresent=True):
-        self.builder = FakeBuilder(srcdir=srcdir)
-        self.info = []
-        self.warnings = []
-        self._extensions = []
-        if automodapipresent:
-            self._extensions.append('astropy_helpers.sphinx.ext.automodapi')
-
-    def info(self, msg, loc):
-        self.info.append((msg, loc))
-
-    def warn(self, msg, loc):
-        self.warnings.append((msg, loc))
-
-
-ams_to_asmry_str = """
-Before
-
-.. automodsumm:: astropy_helpers.sphinx.ext.automodsumm
-    :p:
-
-And After
-"""
-
-ams_to_asmry_expected = """\
-.. currentmodule:: astropy_helpers.sphinx.ext.automodsumm
-
-.. autosummary::
-    :p:
-
-    Automoddiagram
-    Automodsumm
-    automodsumm_to_autosummary_lines
-    generate_automodsumm_docs
-    process_automodsumm_generation
-    setup"""
-
-
-def test_ams_to_asmry(tmpdir):
-    from ..automodsumm import automodsumm_to_autosummary_lines
-
-    fi = tmpdir.join('automodsumm.rst')
-    fi.write(ams_to_asmry_str)
-
-    fakeapp = FakeApp(srcdir='')
-    resultlines = automodsumm_to_autosummary_lines(str(fi), fakeapp)
-
-    assert '\n'.join(resultlines) == ams_to_asmry_expected
-
-
-ams_cython_str = """
-Before
-
-.. automodsumm:: _eva_.unit02
-    :functions-only:
-    :p:
-
-And After
-"""
-
-ams_cython_expected = """\
-.. currentmodule:: _eva_.unit02
-
-.. autosummary::
-    :p:
-
-    pilot"""
-
-
-def test_ams_cython(tmpdir, cython_testpackage):
-    from ..automodsumm import automodsumm_to_autosummary_lines
-
-    fi = tmpdir.join('automodsumm.rst')
-    fi.write(ams_cython_str)
-
-    fakeapp = FakeApp(srcdir='')
-    resultlines = automodsumm_to_autosummary_lines(str(fi), fakeapp)
-
-    assert '\n'.join(resultlines) == ams_cython_expected
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_docscrape.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_docscrape.py
deleted file mode 100644
index 1cefd43..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_docscrape.py
+++ /dev/null
@@ -1,762 +0,0 @@
-# -*- encoding:utf-8 -*-
-from __future__ import division, absolute_import, print_function
-
-import sys, textwrap
-
-from ..docscrape import NumpyDocString, FunctionDoc, ClassDoc
-from ..docscrape_sphinx import SphinxDocString, SphinxClassDoc
-
-if sys.version_info[0] >= 3:
-    sixu = lambda s: s
-else:
-    sixu = lambda s: unicode(s, 'unicode_escape')
-
-
-doc_txt = '''\
-  numpy.multivariate_normal(mean, cov, shape=None, spam=None)
-
-  Draw values from a multivariate normal distribution with specified
-  mean and covariance.
-
-  The multivariate normal or Gaussian distribution is a generalisation
-  of the one-dimensional normal distribution to higher dimensions.
-
-  Parameters
-  ----------
-  mean : (N,) ndarray
-      Mean of the N-dimensional distribution.
-
-      .. math::
-
-         (1+2+3)/3
-
-  cov : (N, N) ndarray
-      Covariance matrix of the distribution.
-  shape : tuple of ints
-      Given a shape of, for example, (m,n,k), m*n*k samples are
-      generated, and packed in an m-by-n-by-k arrangement.  Because
-      each sample is N-dimensional, the output shape is (m,n,k,N).
-
-  Returns
-  -------
-  out : ndarray
-      The drawn samples, arranged according to `shape`.  If the
-      shape given is (m,n,...), then the shape of `out` is is
-      (m,n,...,N).
-
-      In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-      value drawn from the distribution.
-  list of str
-      This is not a real return value.  It exists to test
-      anonymous return values.
-
-  Other Parameters
-  ----------------
-  spam : parrot
-      A parrot off its mortal coil.
-
-  Raises
-  ------
-  RuntimeError
-      Some error
-
-  Warns
-  -----
-  RuntimeWarning
-      Some warning
-
-  Warnings
-  --------
-  Certain warnings apply.
-
-  Notes
-  -----
-  Instead of specifying the full covariance matrix, popular
-  approximations include:
-
-    - Spherical covariance (`cov` is a multiple of the identity matrix)
-    - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-  This geometrical property can be seen in two dimensions by plotting
-  generated data-points:
-
-  >>> mean = [0,0]
-  >>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
-  >>> x,y = multivariate_normal(mean,cov,5000).T
-  >>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-  Note that the covariance matrix must be symmetric and non-negative
-  definite.
-
-  References
-  ----------
-  .. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-         Processes," 3rd ed., McGraw-Hill Companies, 1991
-  .. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-         2nd ed., Wiley, 2001.
-
-  See Also
-  --------
-  some, other, funcs
-  otherfunc : relationship
-
-  Examples
-  --------
-  >>> mean = (1,2)
-  >>> cov = [[1,0],[1,0]]
-  >>> x = multivariate_normal(mean,cov,(3,3))
-  >>> print x.shape
-  (3, 3, 2)
-
-  The following is probably true, given that 0.6 is roughly twice the
-  standard deviation:
-
-  >>> print list( (x[0,0,:] - mean) < 0.6 )
-  [True, True]
-
-  .. index:: random
-     :refguide: random;distributions, random;gauss
-
-  '''
-doc = NumpyDocString(doc_txt)
-
-
-def test_signature():
-    assert doc['Signature'].startswith('numpy.multivariate_normal(')
-    assert doc['Signature'].endswith('spam=None)')
-
-def test_summary():
-    assert doc['Summary'][0].startswith('Draw values')
-    assert doc['Summary'][-1].endswith('covariance.')
-
-def test_extended_summary():
-    assert doc['Extended Summary'][0].startswith('The multivariate normal')
-
-def test_parameters():
-    assert len(doc['Parameters']) == 3
-    assert [n for n,_,_ in doc['Parameters']] == ['mean','cov','shape']
-
-    arg, arg_type, desc = doc['Parameters'][1]
-    assert arg_type == '(N, N) ndarray'
-    assert desc[0].startswith('Covariance matrix')
-    assert doc['Parameters'][0][-1][-2] == '   (1+2+3)/3'
-
-def test_other_parameters():
-    assert len(doc['Other Parameters']) == 1
-    assert [n for n,_,_ in doc['Other Parameters']] == ['spam']
-    arg, arg_type, desc = doc['Other Parameters'][0]
-    assert arg_type == 'parrot'
-    assert desc[0].startswith('A parrot off its mortal coil')
-
-def test_returns():
-    assert len(doc['Returns']) == 2
-    arg, arg_type, desc = doc['Returns'][0]
-    assert arg == 'out'
-    assert arg_type == 'ndarray'
-    assert desc[0].startswith('The drawn samples')
-    assert desc[-1].endswith('distribution.')
-
-    arg, arg_type, desc = doc['Returns'][1]
-    assert arg == 'list of str'
-    assert arg_type == ''
-    assert desc[0].startswith('This is not a real')
-    assert desc[-1].endswith('anonymous return values.')
-
-def test_notes():
-    assert doc['Notes'][0].startswith('Instead')
-    assert doc['Notes'][-1].endswith('definite.')
-    assert len(doc['Notes']) == 17
-
-def test_references():
-    assert doc['References'][0].startswith('..')
-    assert doc['References'][-1].endswith('2001.')
-
-def test_examples():
-    assert doc['Examples'][0].startswith('>>>')
-    assert doc['Examples'][-1].endswith('True]')
-
-def test_index():
-    assert doc['index']['default'] == 'random'
-    assert len(doc['index']) == 2
-    assert len(doc['index']['refguide']) == 2
-
-def non_blank_line_by_line_compare(a,b):
-    a = textwrap.dedent(a)
-    b = textwrap.dedent(b)
-    a = [l.rstrip() for l in a.split('\n') if l.strip()]
-    b = [l.rstrip() for l in b.split('\n') if l.strip()]
-    for n,line in enumerate(a):
-        if not line == b[n]:
-            raise AssertionError("Lines %s of a and b differ: "
-                                 "\n>>> %s\n<<< %s\n" %
-                                 (n,line,b[n]))
-def test_str():
-    non_blank_line_by_line_compare(str(doc),
-"""numpy.multivariate_normal(mean, cov, shape=None, spam=None)
-
-Draw values from a multivariate normal distribution with specified
-mean and covariance.
-
-The multivariate normal or Gaussian distribution is a generalisation
-of the one-dimensional normal distribution to higher dimensions.
-
-Parameters
-----------
-mean : (N,) ndarray
-    Mean of the N-dimensional distribution.
-
-    .. math::
-
-       (1+2+3)/3
-
-cov : (N, N) ndarray
-    Covariance matrix of the distribution.
-shape : tuple of ints
-    Given a shape of, for example, (m,n,k), m*n*k samples are
-    generated, and packed in an m-by-n-by-k arrangement.  Because
-    each sample is N-dimensional, the output shape is (m,n,k,N).
-
-Returns
--------
-out : ndarray
-    The drawn samples, arranged according to `shape`.  If the
-    shape given is (m,n,...), then the shape of `out` is is
-    (m,n,...,N).
-
-    In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-    value drawn from the distribution.
-list of str
-    This is not a real return value.  It exists to test
-    anonymous return values.
-
-Other Parameters
-----------------
-spam : parrot
-    A parrot off its mortal coil.
-
-Raises
-------
-RuntimeError
-    Some error
-
-Warns
------
-RuntimeWarning
-    Some warning
-
-Warnings
---------
-Certain warnings apply.
-
-See Also
---------
-`some`_, `other`_, `funcs`_
-
-`otherfunc`_
-    relationship
-
-Notes
------
-Instead of specifying the full covariance matrix, popular
-approximations include:
-
-  - Spherical covariance (`cov` is a multiple of the identity matrix)
-  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-This geometrical property can be seen in two dimensions by plotting
-generated data-points:
-
->>> mean = [0,0]
->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
->>> x,y = multivariate_normal(mean,cov,5000).T
->>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-Note that the covariance matrix must be symmetric and non-negative
-definite.
-
-References
-----------
-.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-       Processes," 3rd ed., McGraw-Hill Companies, 1991
-.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-       2nd ed., Wiley, 2001.
-
-Examples
---------
->>> mean = (1,2)
->>> cov = [[1,0],[1,0]]
->>> x = multivariate_normal(mean,cov,(3,3))
->>> print x.shape
-(3, 3, 2)
-
-The following is probably true, given that 0.6 is roughly twice the
-standard deviation:
-
->>> print list( (x[0,0,:] - mean) < 0.6 )
-[True, True]
-
-.. index:: random
-   :refguide: random;distributions, random;gauss""")
-
-
-def test_sphinx_str():
-    sphinx_doc = SphinxDocString(doc_txt)
-    non_blank_line_by_line_compare(str(sphinx_doc),
-"""
-.. index:: random
-   single: random;distributions, random;gauss
-
-Draw values from a multivariate normal distribution with specified
-mean and covariance.
-
-The multivariate normal or Gaussian distribution is a generalisation
-of the one-dimensional normal distribution to higher dimensions.
-
-:Parameters:
-
-    **mean** : (N,) ndarray
-
-        Mean of the N-dimensional distribution.
-
-        .. math::
-
-           (1+2+3)/3
-
-    **cov** : (N, N) ndarray
-
-        Covariance matrix of the distribution.
-
-    **shape** : tuple of ints
-
-        Given a shape of, for example, (m,n,k), m*n*k samples are
-        generated, and packed in an m-by-n-by-k arrangement.  Because
-        each sample is N-dimensional, the output shape is (m,n,k,N).
-
-:Returns:
-
-    **out** : ndarray
-
-        The drawn samples, arranged according to `shape`.  If the
-        shape given is (m,n,...), then the shape of `out` is is
-        (m,n,...,N).
-
-        In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
-        value drawn from the distribution.
-
-    list of str
-
-        This is not a real return value.  It exists to test
-        anonymous return values.
-
-:Other Parameters:
-
-    **spam** : parrot
-
-        A parrot off its mortal coil.
-
-:Raises:
-
-    **RuntimeError**
-
-        Some error
-
-:Warns:
-
-    **RuntimeWarning**
-
-        Some warning
-
-.. warning::
-
-    Certain warnings apply.
-
-.. seealso::
-
-    :obj:`some`, :obj:`other`, :obj:`funcs`
-
-    :obj:`otherfunc`
-        relationship
-
-.. rubric:: Notes
-
-Instead of specifying the full covariance matrix, popular
-approximations include:
-
-  - Spherical covariance (`cov` is a multiple of the identity matrix)
-  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)
-
-This geometrical property can be seen in two dimensions by plotting
-generated data-points:
-
->>> mean = [0,0]
->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
-
->>> x,y = multivariate_normal(mean,cov,5000).T
->>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
-
-Note that the covariance matrix must be symmetric and non-negative
-definite.
-
-.. rubric:: References
-
-.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
-       Processes," 3rd ed., McGraw-Hill Companies, 1991
-.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
-       2nd ed., Wiley, 2001.
-
-.. only:: latex
-
-   [1]_, [2]_
-
-.. rubric:: Examples
-
->>> mean = (1,2)
->>> cov = [[1,0],[1,0]]
->>> x = multivariate_normal(mean,cov,(3,3))
->>> print x.shape
-(3, 3, 2)
-
-The following is probably true, given that 0.6 is roughly twice the
-standard deviation:
-
->>> print list( (x[0,0,:] - mean) < 0.6 )
-[True, True]
-""")
-
-
-doc2 = NumpyDocString("""
-    Returns array of indices of the maximum values of along the given axis.
-
-    Parameters
-    ----------
-    a : {array_like}
-        Array to look in.
-    axis : {None, integer}
-        If None, the index is into the flattened array, otherwise along
-        the specified axis""")
-
-def test_parameters_without_extended_description():
-    assert len(doc2['Parameters']) == 2
-
-doc3 = NumpyDocString("""
-    my_signature(*params, **kwds)
-
-    Return this and that.
-    """)
-
-def test_escape_stars():
-    signature = str(doc3).split('\n')[0]
-    signature == 'my_signature(\*params, \*\*kwds)'
-
-doc4 = NumpyDocString(
-    """a.conj()
-
-    Return an array with all complex-valued elements conjugated.""")
-
-def test_empty_extended_summary():
-    assert doc4['Extended Summary'] == []
-
-doc5 = NumpyDocString(
-    """
-    a.something()
-
-    Raises
-    ------
-    LinAlgException
-        If array is singular.
-
-    Warns
-    -----
-    SomeWarning
-        If needed
-    """)
-
-def test_raises():
-    assert len(doc5['Raises']) == 1
-    name,_,desc = doc5['Raises'][0]
-    assert name == 'LinAlgException'
-    assert desc == ['If array is singular.']
-
-def test_warns():
-    assert len(doc5['Warns']) == 1
-    name,_,desc = doc5['Warns'][0]
-    assert name == 'SomeWarning'
-    assert desc == ['If needed']
-
-def test_see_also():
-    doc6 = NumpyDocString(
-    """
-    z(x,theta)
-
-    See Also
-    --------
-    func_a, func_b, func_c
-    func_d : some equivalent func
-    foo.func_e : some other func over
-             multiple lines
-    func_f, func_g, :meth:`func_h`, func_j,
-    func_k
-    :obj:`baz.obj_q`
-    :class:`class_j`: fubar
-        foobar
-    """)
-
-    assert len(doc6['See Also']) == 12
-    for func, desc, role in doc6['See Also']:
-        if func in ('func_a', 'func_b', 'func_c', 'func_f',
-                    'func_g', 'func_h', 'func_j', 'func_k', 'baz.obj_q'):
-            assert(not desc)
-        else:
-            assert(desc)
-
-        if func == 'func_h':
-            assert role == 'meth'
-        elif func == 'baz.obj_q':
-            assert role == 'obj'
-        elif func == 'class_j':
-            assert role == 'class'
-        else:
-            assert role is None
-
-        if func == 'func_d':
-            assert desc == ['some equivalent func']
-        elif func == 'foo.func_e':
-            assert desc == ['some other func over', 'multiple lines']
-        elif func == 'class_j':
-            assert desc == ['fubar', 'foobar']
-
-def test_see_also_print():
-    class Dummy(object):
-        """
-        See Also
-        --------
-        func_a, func_b
-        func_c : some relationship
-                 goes here
-        func_d
-        """
-        pass
-
-    obj = Dummy()
-    s = str(FunctionDoc(obj, role='func'))
-    assert(':func:`func_a`, :func:`func_b`' in s)
-    assert('    some relationship' in s)
-    assert(':func:`func_d`' in s)
-
-doc7 = NumpyDocString("""
-
-        Doc starts on second line.
-
-        """)
-
-def test_empty_first_line():
-    assert doc7['Summary'][0].startswith('Doc starts')
-
-
-def test_no_summary():
-    str(SphinxDocString("""
-    Parameters
-    ----------"""))
-
-
-def test_unicode():
-    doc = SphinxDocString("""
-    öäöäöäöäöåååå
-
-    öäöäöäööäååå
-
-    Parameters
-    ----------
-    ååå : äää
-        ööö
-
-    Returns
-    -------
-    ååå : ööö
-        äää
-
-    """)
-    assert isinstance(doc['Summary'][0], str)
-    assert doc['Summary'][0] == 'öäöäöäöäöåååå'
-
-def test_plot_examples():
-    cfg = dict(use_plots=True)
-
-    doc = SphinxDocString("""
-    Examples
-    --------
-    >>> import matplotlib.pyplot as plt
-    >>> plt.plot([1,2,3],[4,5,6])
-    >>> plt.show()
-    """, config=cfg)
-    assert 'plot::' in str(doc), str(doc)
-
-    doc = SphinxDocString("""
-    Examples
-    --------
-    .. plot::
-
-       import matplotlib.pyplot as plt
-       plt.plot([1,2,3],[4,5,6])
-       plt.show()
-    """, config=cfg)
-    assert str(doc).count('plot::') == 1, str(doc)
-
-def test_class_members():
-
-    class Dummy(object):
-        """
-        Dummy class.
-
-        """
-        def spam(self, a, b):
-            """Spam\n\nSpam spam."""
-            pass
-        def ham(self, c, d):
-            """Cheese\n\nNo cheese."""
-            pass
-        @property
-        def spammity(self):
-            """Spammity index"""
-            return 0.95
-
-        class Ignorable(object):
-            """local class, to be ignored"""
-            pass
-
-    for cls in (ClassDoc, SphinxClassDoc):
-        doc = cls(Dummy, config=dict(show_class_members=False))
-        assert 'Methods' not in str(doc), (cls, str(doc))
-        assert 'spam' not in str(doc), (cls, str(doc))
-        assert 'ham' not in str(doc), (cls, str(doc))
-        assert 'spammity' not in str(doc), (cls, str(doc))
-        assert 'Spammity index' not in str(doc), (cls, str(doc))
-
-        doc = cls(Dummy, config=dict(show_class_members=True))
-        assert 'Methods' in str(doc), (cls, str(doc))
-        assert 'spam' in str(doc), (cls, str(doc))
-        assert 'ham' in str(doc), (cls, str(doc))
-        assert 'spammity' in str(doc), (cls, str(doc))
-
-        if cls is SphinxClassDoc:
-            assert '.. autosummary::' in str(doc), str(doc)
-        else:
-            assert 'Spammity index' in str(doc), str(doc)
-
-def test_duplicate_signature():
-    # Duplicate function signatures occur e.g. in ufuncs, when the
-    # automatic mechanism adds one, and a more detailed comes from the
-    # docstring itself.
-
-    doc = NumpyDocString(
-    """
-    z(x1, x2)
-
-    z(a, theta)
-    """)
-
-    assert doc['Signature'].strip() == 'z(a, theta)'
-
-
-class_doc_txt = """
-    Foo
-
-    Parameters
-    ----------
-    f : callable ``f(t, y, *f_args)``
-        Aaa.
-    jac : callable ``jac(t, y, *jac_args)``
-        Bbb.
-
-    Attributes
-    ----------
-    t : float
-        Current time.
-    y : ndarray
-        Current variable values.
-
-    Methods
-    -------
-    a
-    b
-    c
-
-    Examples
-    --------
-    For usage examples, see `ode`.
-"""
-
-def test_class_members_doc():
-    doc = ClassDoc(None, class_doc_txt)
-    non_blank_line_by_line_compare(str(doc),
-    """
-    Foo
-
-    Parameters
-    ----------
-    f : callable ``f(t, y, *f_args)``
-        Aaa.
-    jac : callable ``jac(t, y, *jac_args)``
-        Bbb.
-
-    Examples
-    --------
-    For usage examples, see `ode`.
-
-    Attributes
-    ----------
-    t : float
-        Current time.
-    y : ndarray
-        Current variable values.
-
-    Methods
-    -------
-    a
-
-    b
-
-    c
-
-    .. index::
-
-    """)
-
-def test_class_members_doc_sphinx():
-    doc = SphinxClassDoc(None, class_doc_txt)
-    non_blank_line_by_line_compare(str(doc),
-    """
-    Foo
-
-    :Parameters:
-
-        **f** : callable ``f(t, y, *f_args)``
-
-            Aaa.
-
-        **jac** : callable ``jac(t, y, *jac_args)``
-
-            Bbb.
-
-    .. rubric:: Examples
-
-    For usage examples, see `ode`.
-
-    .. rubric:: Attributes
-
-    ===  ==========
-      t  (float) Current time.
-      y  (ndarray) Current variable values.
-    ===  ==========
-
-    .. rubric:: Methods
-
-    ===  ==========
-      a
-      b
-      c
-    ===  ==========
-
-    """)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_utils.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_utils.py
deleted file mode 100644
index 8f1a9dd..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tests/test_utils.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#namedtuple is needed for find_mod_objs so it can have a non-local module
-
-import sys
-from collections import namedtuple
-
-import pytest
-
-from ..utils import find_mod_objs
-
-PY3 = sys.version_info[0] >= 3
-pytestmark = pytest.mark.skipif("PY3")
-
-
-def test_find_mod_objs():
-    lnms, fqns, objs = find_mod_objs('astropy_helpers')
-
-    # this import  is after the above call intentionally to make sure
-    # find_mod_objs properly imports astropy on its own
-    import astropy_helpers
-
-    # just check for astropy.test ... other things might be added, so we
-    # shouldn't check that it's the only thing
-    assert lnms == []
-
-    lnms, fqns, objs = find_mod_objs(
-        'astropy_helpers.sphinx.ext.tests.test_utils', onlylocals=False)
-
-    assert namedtuple in objs
-
-    lnms, fqns, objs = find_mod_objs(
-        'astropy_helpers.sphinx.ext.tests.test_utils', onlylocals=True)
-    assert 'namedtuple' not in lnms
-    assert 'collections.namedtuple' not in fqns
-    assert namedtuple not in objs
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tocdepthfix.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tocdepthfix.py
deleted file mode 100644
index be29478..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/tocdepthfix.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from sphinx import addnodes
-
-
-def fix_toc_entries(app, doctree):
-    # Get the docname; I don't know why this isn't just passed in to the
-    # callback
-    # This seems a bit unreliable as it's undocumented, but it's not "private"
-    # either:
-    docname = app.builder.env.temp_data['docname']
-    if app.builder.env.metadata[docname].get('tocdepth', 0) != 0:
-        # We need to reprocess any TOC nodes in the doctree and make sure all
-        # the files listed in any TOCs are noted
-        for treenode in doctree.traverse(addnodes.toctree):
-            app.builder.env.note_toctree(docname, treenode)
-
-
-def setup(app):
-    app.connect('doctree-read', fix_toc_entries)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/traitsdoc.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/traitsdoc.py
deleted file mode 100644
index 596c54e..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/traitsdoc.py
+++ /dev/null
@@ -1,142 +0,0 @@
-"""
-=========
-traitsdoc
-=========
-
-Sphinx extension that handles docstrings in the Numpy standard format, [1]
-and support Traits [2].
-
-This extension can be used as a replacement for ``numpydoc`` when support
-for Traits is required.
-
-.. [1] http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
-.. [2] http://code.enthought.com/projects/traits/
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import inspect
-import os
-import pydoc
-import collections
-
-from . import docscrape
-from . import docscrape_sphinx
-from .docscrape_sphinx import SphinxClassDoc, SphinxFunctionDoc, SphinxDocString
-
-from . import numpydoc
-
-from . import comment_eater
-
-class SphinxTraitsDoc(SphinxClassDoc):
-    def __init__(self, cls, modulename='', func_doc=SphinxFunctionDoc):
-        if not inspect.isclass(cls):
-            raise ValueError("Initialise using a class. Got %r" % cls)
-        self._cls = cls
-
-        if modulename and not modulename.endswith('.'):
-            modulename += '.'
-        self._mod = modulename
-        self._name = cls.__name__
-        self._func_doc = func_doc
-
-        docstring = pydoc.getdoc(cls)
-        docstring = docstring.split('\n')
-
-        # De-indent paragraph
-        try:
-            indent = min(len(s) - len(s.lstrip()) for s in docstring
-                         if s.strip())
-        except ValueError:
-            indent = 0
-
-        for n,line in enumerate(docstring):
-            docstring[n] = docstring[n][indent:]
-
-        self._doc = docscrape.Reader(docstring)
-        self._parsed_data = {
-            'Signature': '',
-            'Summary': '',
-            'Description': [],
-            'Extended Summary': [],
-            'Parameters': [],
-            'Returns': [],
-            'Raises': [],
-            'Warns': [],
-            'Other Parameters': [],
-            'Traits': [],
-            'Methods': [],
-            'See Also': [],
-            'Notes': [],
-            'References': '',
-            'Example': '',
-            'Examples': '',
-            'index': {}
-            }
-
-        self._parse()
-
-    def _str_summary(self):
-        return self['Summary'] + ['']
-
-    def _str_extended_summary(self):
-        return self['Description'] + self['Extended Summary'] + ['']
-
-    def __str__(self, indent=0, func_role="func"):
-        out = []
-        out += self._str_signature()
-        out += self._str_index() + ['']
-        out += self._str_summary()
-        out += self._str_extended_summary()
-        for param_list in ('Parameters', 'Traits', 'Methods',
-                           'Returns','Raises'):
-            out += self._str_param_list(param_list)
-        out += self._str_see_also("obj")
-        out += self._str_section('Notes')
-        out += self._str_references()
-        out += self._str_section('Example')
-        out += self._str_section('Examples')
-        out = self._str_indent(out,indent)
-        return '\n'.join(out)
-
-def looks_like_issubclass(obj, classname):
-    """ Return True if the object has a class or superclass with the given class
-    name.
-
-    Ignores old-style classes.
-    """
-    t = obj
-    if t.__name__ == classname:
-        return True
-    for klass in t.__mro__:
-        if klass.__name__ == classname:
-            return True
-    return False
-
-def get_doc_object(obj, what=None, config=None):
-    if what is None:
-        if inspect.isclass(obj):
-            what = 'class'
-        elif inspect.ismodule(obj):
-            what = 'module'
-        elif isinstance(obj, collections.Callable):
-            what = 'function'
-        else:
-            what = 'object'
-    if what == 'class':
-        doc = SphinxTraitsDoc(obj, '', func_doc=SphinxFunctionDoc, config=config)
-        if looks_like_issubclass(obj, 'HasTraits'):
-            for name, trait, comment in comment_eater.get_class_traits(obj):
-                # Exclude private traits.
-                if not name.startswith('_'):
-                    doc['Traits'].append((name, trait, comment.splitlines()))
-        return doc
-    elif what in ('function', 'method'):
-        return SphinxFunctionDoc(obj, '', config=config)
-    else:
-        return SphinxDocString(pydoc.getdoc(obj), config=config)
-
-def setup(app):
-    # init numpydoc
-    numpydoc.setup(app, get_doc_object)
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/utils.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/utils.py
deleted file mode 100644
index 2a06c83..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/utils.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import inspect
-import sys
-
-
-def find_mod_objs(modname, onlylocals=False):
-    """ Returns all the public attributes of a module referenced by name.
-
-    .. note::
-        The returned list *not* include subpackages or modules of
-        `modname`,nor does it include private attributes (those that
-        beginwith '_' or are not in `__all__`).
-
-    Parameters
-    ----------
-    modname : str
-        The name of the module to search.
-    onlylocals : bool
-        If True, only attributes that are either members of `modname` OR one of
-        its modules or subpackages will be included.
-
-    Returns
-    -------
-    localnames : list of str
-        A list of the names of the attributes as they are named in the
-        module `modname` .
-    fqnames : list of str
-        A list of the full qualified names of the attributes (e.g.,
-        ``astropy.utils.misc.find_mod_objs``). For attributes that are
-        simple variables, this is based on the local name, but for
-        functions or classes it can be different if they are actually
-        defined elsewhere and just referenced in `modname`.
-    objs : list of objects
-        A list of the actual attributes themselves (in the same order as
-        the other arguments)
-
-    """
-
-    __import__(modname)
-    mod = sys.modules[modname]
-
-    if hasattr(mod, '__all__'):
-        pkgitems = [(k, mod.__dict__[k]) for k in mod.__all__]
-    else:
-        pkgitems = [(k, mod.__dict__[k]) for k in dir(mod) if k[0] != '_']
-
-    # filter out modules and pull the names and objs out
-    ismodule = inspect.ismodule
-    localnames = [k for k, v in pkgitems if not ismodule(v)]
-    objs = [v for k, v in pkgitems if not ismodule(v)]
-
-    # fully qualified names can be determined from the object's module
-    fqnames = []
-    for obj, lnm in zip(objs, localnames):
-        if hasattr(obj, '__module__') and hasattr(obj, '__name__'):
-            fqnames.append(obj.__module__ + '.' + obj.__name__)
-        else:
-            fqnames.append(modname + '.' + lnm)
-
-    if onlylocals:
-        valids = [fqn.startswith(modname) for fqn in fqnames]
-        localnames = [e for i, e in enumerate(localnames) if valids[i]]
-        fqnames = [e for i, e in enumerate(fqnames) if valids[i]]
-        objs = [e for i, e in enumerate(objs) if valids[i]]
-
-    return localnames, fqnames, objs
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/viewcode.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/viewcode.py
deleted file mode 100644
index 1d657b8..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/ext/viewcode.py
+++ /dev/null
@@ -1,216 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    sphinx.ext.viewcode
-    ~~~~~~~~~~~~~~~~~~~
-
-    Add links to module code in Python object descriptions.
-
-    :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
-    :license: BSD, see LICENSE for details.
-
-    Patched using patch in https://bitbucket.org/birkenfeld/sphinx/issue/623/extension-viewcode-fails-with-function on 21 Aug 2013 by Kyle H Barbary
-"""
-
-from docutils import nodes
-
-from sphinx import addnodes
-from sphinx.locale import _
-from sphinx.pycode import ModuleAnalyzer
-from sphinx.util.nodes import make_refnode
-
-import sys
-import traceback
-
-if sys.version < '3':
-    text_type = unicode
-else:
-    text_type = str
-
-def doctree_read(app, doctree):
-    env = app.builder.env
-    if not hasattr(env, '_viewcode_modules'):
-        env._viewcode_modules = {}
- 
-    def get_full_modname(modname, attribute):
-        try:
-            __import__(modname)
-        except Exception as error:
-            if not app.quiet:
-                app.info(traceback.format_exc().rstrip())
-            app.warn('viewcode can\'t import %s, failed with error "%s"' %
-                (modname, error))
-            return None
-        module = sys.modules[modname]
-        try:
-            # Allow an attribute to have multiple parts and incidentially allow
-            # repeated .s in the attribute.
-            attr = attribute.split('.')
-            value = module
-            for attr in attribute.split('.'):
-                if attr:
-                    value = getattr(value, attr)
-        except AttributeError:
-            app.warn('Didn\'t find %s in %s' % (attribute, module.__name__))
-            return None
-        else:
-            return getattr(value, '__module__', None)
-
-
-    def has_tag(modname, fullname, docname, refname):
-        entry = env._viewcode_modules.get(modname, None)
-        if entry is None:
-            try:
-                analyzer = ModuleAnalyzer.for_module(modname)
-            except Exception:
-                env._viewcode_modules[modname] = False
-                return
-            analyzer.find_tags()
-            if not isinstance(analyzer.code, text_type):
-                code = analyzer.code.decode(analyzer.encoding)
-            else:
-                code = analyzer.code
-            entry = code, analyzer.tags, {}, refname
-            env._viewcode_modules[modname] = entry
-        elif entry is False:
-            return
-        _, tags, used, _ = entry
-        if fullname in tags:
-            used[fullname] = docname
-            return True
-
-
-    for objnode in doctree.traverse(addnodes.desc):
-        if objnode.get('domain') != 'py':
-            continue
-        names = set()
-        for signode in objnode:
-            if not isinstance(signode, addnodes.desc_signature):
-                continue
-            modname = signode.get('module')
-            fullname = signode.get('fullname')
-            refname = modname
-            if env.config.viewcode_import:
-                modname = get_full_modname(modname, fullname)
-            if not modname:
-                continue
-            if not has_tag(modname, fullname, env.docname, refname):
-                continue
-            if fullname in names:
-                # only one link per name, please
-                continue
-            names.add(fullname)
-            pagename = '_modules/' + modname.replace('.', '/')
-            onlynode = addnodes.only(expr='html')
-            onlynode += addnodes.pending_xref(
-                '', reftype='viewcode', refdomain='std', refexplicit=False,
-                reftarget=pagename, refid=fullname,
-                refdoc=env.docname)
-            onlynode[0] += nodes.inline('', _('[source]'),
-                                        classes=['viewcode-link'])
-            signode += onlynode
-
-
-def missing_reference(app, env, node, contnode):
-    # resolve our "viewcode" reference nodes -- they need special treatment
-    if node['reftype'] == 'viewcode':
-        return make_refnode(app.builder, node['refdoc'], node['reftarget'],
-                            node['refid'], contnode)
-
-
-def collect_pages(app):
-    env = app.builder.env
-    if not hasattr(env, '_viewcode_modules'):
-        return
-    highlighter = app.builder.highlighter
-    urito = app.builder.get_relative_uri
-
-    modnames = set(env._viewcode_modules)
-
-    app.builder.info(' (%d module code pages)' %
-                     len(env._viewcode_modules), nonl=1)
-
-    for modname, entry in env._viewcode_modules.iteritems():
-        if not entry:
-            continue
-        code, tags, used, refname = entry
-        # construct a page name for the highlighted source
-        pagename = '_modules/' + modname.replace('.', '/')
-        # highlight the source using the builder's highlighter
-        highlighted = highlighter.highlight_block(code, 'python', linenos=False)
-        # split the code into lines
-        lines = highlighted.splitlines()
-        # split off wrap markup from the first line of the actual code
-        before, after = lines[0].split('<pre>')
-        lines[0:1] = [before + '<pre>', after]
-        # nothing to do for the last line; it always starts with </pre> anyway
-        # now that we have code lines (starting at index 1), insert anchors for
-        # the collected tags (HACK: this only works if the tag boundaries are
-        # properly nested!)
-        maxindex = len(lines) - 1
-        for name, docname in used.iteritems():
-            type, start, end = tags[name]
-            backlink = urito(pagename, docname) + '#' + refname + '.' + name
-            lines[start] = (
-                '<div class="viewcode-block" id="%s"><a class="viewcode-back" '
-                'href="%s">%s</a>' % (name, backlink, _('[docs]'))
-                + lines[start])
-            lines[min(end - 1, maxindex)] += '</div>'
-        # try to find parents (for submodules)
-        parents = []
-        parent = modname
-        while '.' in parent:
-            parent = parent.rsplit('.', 1)[0]
-            if parent in modnames:
-                parents.append({
-                    'link': urito(pagename, '_modules/' +
-                                  parent.replace('.', '/')),
-                    'title': parent})
-        parents.append({'link': urito(pagename, '_modules/index'),
-                        'title': _('Module code')})
-        parents.reverse()
-        # putting it all together
-        context = {
-            'parents': parents,
-            'title': modname,
-            'body': _('<h1>Source code for %s</h1>') % modname + \
-                    '\n'.join(lines)
-        }
-        yield (pagename, context, 'page.html')
-
-    if not modnames:
-        return
-
-    app.builder.info(' _modules/index')
-    html = ['\n']
-    # the stack logic is needed for using nested lists for submodules
-    stack = ['']
-    for modname in sorted(modnames):
-        if modname.startswith(stack[-1]):
-            stack.append(modname + '.')
-            html.append('<ul>')
-        else:
-            stack.pop()
-            while not modname.startswith(stack[-1]):
-                stack.pop()
-                html.append('</ul>')
-            stack.append(modname + '.')
-        html.append('<li><a href="%s">%s</a></li>\n' % (
-            urito('_modules/index', '_modules/' + modname.replace('.', '/')),
-            modname))
-    html.append('</ul>' * (len(stack) - 1))
-    context = {
-        'title': _('Overview: module code'),
-        'body': _('<h1>All modules for which code is available</h1>') + \
-            ''.join(html),
-    }
-
-    yield ('_modules/index', context, 'page.html')
-
-
-def setup(app):
-    app.add_config_value('viewcode_import', True, False)
-    app.connect('doctree-read', doctree_read)
-    app.connect('html-collect-pages', collect_pages)
-    app.connect('missing-reference', missing_reference)
-    #app.add_config_value('viewcode_include_modules', [], 'env')
-    #app.add_config_value('viewcode_exclude_modules', [], 'env')
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/local/python3links.inv b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/local/python3links.inv
deleted file mode 100644
index c9cbcd4..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/local/python3links.inv
+++ /dev/null
@@ -1,7 +0,0 @@
-# Sphinx inventory version 2
-# Project: Python
-# Version: 3.4
-# The remainder of this file is compressed using zlib.
-x�����0
��{
-/z،W�x���Yflص	��0� 	��-����
�O��\��T9��Sb�
3쎟�W%�f�V�{U�cJ
Qh54��8�BR��	�66��yJ���-F�#
-���I�G׀]k���j� �vV3"XR#xu	{�:��-��!{\�3i
�i
�?�"F)��2�۰F��}P�Q)�,�'�>����7
\ No newline at end of file
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/setup_package.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/setup_package.py
deleted file mode 100644
index f9d0579..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/setup_package.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-def get_package_data():
-    # Install the theme files
-    return {
-        'astropy_helpers.sphinx': [
-            'ext/templates/*/*',
-            'local/*.inv',
-            'themes/bootstrap-astropy/*.*',
-            'themes/bootstrap-astropy/static/*.*']}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
deleted file mode 100644
index 3bd8404..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>Table of Contents</h3>
-{{ toctree(maxdepth=-1, titles_only=true) }}
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
deleted file mode 100644
index 40b0da4..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
+++ /dev/null
@@ -1,96 +0,0 @@
-{% extends "basic/layout.html" %}
-
-{# Collapsible sidebar script from default/layout.html in Sphinx #}
-{% set script_files = script_files + ['_static/sidebar.js'] %}
-
-{# Add the google webfonts needed for the logo #}
-{% block extrahead %}
-<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600' rel='stylesheet' type='text/css'>
-{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
-
-{% endblock %}
-
-
-{% block header %}
-<div class="topbar">
-  <a class="brand" title="{{ _('Documentation Home') }}" href="{{ pathto(master_doc) }}"><span id="logotext1">{{ theme_logotext1 }}</span><span id="logotext2">{{ theme_logotext2 }}</span><span id="logotext3">{{ theme_logotext3 }}</span></a>
-  <ul>
-    <li><a class="homelink" title="Astropy Homepage" href="http://www.astropy.org"></a></li>
-    <li><a title="{{ _('General Index') }}" href="{{ pathto('genindex') }}">Index</a></li>
-    <li><a title="{{ _('Module Index') }}" href="{{ pathto('py-modindex') }}">Modules</a></li>
-    <li>
-      {% block sidebarsearch %}
-      {% include "searchbox.html" %}
-      {% endblock %}
-    </li>
-  </ul>
-</div>
-{% endblock %}
-
-{% block relbar1 %}
-<div class="related">
-    <h3>{{ _('Navigation') }}</h3>
-    <ul>
-      {%- if next %}
-      <li class="right">
-	<a href="{{ next.link|e }}" title="{{ next.title|striptags|e }}">
-	  next {{ "»"|safe }}
-	</a>
-      </li>
-      {%- endif %}
-      {%- if prev %}
-      <li class="right">
-	<a href="{{ prev.link|e }}" title="{{ prev.title|striptags|e }}">
-	  {{ "«"|safe }} previous
-	</a>
-	{% if next %}{{ reldelim2 }}{% endif %}
-      </li>
-      {%- endif %}
-      {%- block rootrellink %}
-      <li>
-	<a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
-	{{ reldelim1 }}
-      </li>
-      {%- endblock %}
-      {%- for parent in parents %}
-      <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
-      {%- endfor %}
-      {# Don't put the title in the relbar for the first (index) page. #}
-      {% if prev %}<li>{{ title }}</li>{% endif %}
-      {%- block relbaritems %} {% endblock %}
-    </ul>
-</div>
-{% endblock %}
-
-{# Silence the bottom relbar. #}
-{% block relbar2 %}{% endblock %}
-
-
-{%- block footer %}
-<footer class="footer">
-  <p class="pull-right">
-    {%- if edit_on_github %}
-    <a href="{{ edit_on_github }}">{{ edit_on_github_page_message }}</a>  
-    {%- endif %}
-    {%- if show_source and has_source and sourcename %}
-    <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
-       rel="nofollow">{{ _('Page Source') }}</a>
-    {%- endif %}  
-    <a href="#">Back to Top</a></p>
-  <p>
-    {%- if show_copyright %}
-    {%- if hasdoc('copyright') %}
-    {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
-    {%- else %}
-    {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}<br/>
-    {%- endif %}
-    {%- endif %}
-    {%- if show_sphinx %}
-    {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}  
-    {%- endif %}
-    {%- if last_updated %}
-    {% trans last_updated=last_updated|e %}Last built {{ last_updated }}.{% endtrans %} <br/>
-    {%- endif %}
-  </p>
-</footer>
-{%- endblock %}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
deleted file mode 100644
index 0a21ad0..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>Page Contents</h3>
-{{ toc }}
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
deleted file mode 100644
index 0d17cc1..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{%- if pagename != "search" %}
-<form action="{{ pathto('search') }}" method="get">
-  <input type="text" name="q" placeholder="Search" />
-  <input type="hidden" name="check_keywords" value="yes" />
-  <input type="hidden" name="area" value="default" />
-</form>
-{%- endif %}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
deleted file mode 100644
index 4322679..0000000
Binary files a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png and /dev/null differ
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
deleted file mode 100644
index c2bca3a..0000000
Binary files a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico and /dev/null differ
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
deleted file mode 100644
index fc3d930..0000000
Binary files a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png and /dev/null differ
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
deleted file mode 100644
index ba7fded..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
+++ /dev/null
@@ -1,585 +0,0 @@
-/*!
- * Bootstrap v1.4.0
- *
- * Copyright 2011 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Heavily modified by Kyle Barbary for the AstroPy Project for use with Sphinx.
- */
-
- at import url("basic.css");
-
-body {
-  background-color: #ffffff;
-  margin: 0;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-  color: #404040;
-}
-
-/* Hyperlinks ----------------------------------------------------------------*/
-
-a {
-  color: #0069d6;
-  text-decoration: none;
-  line-height: inherit;
-  font-weight: inherit;
-}
-
-a:hover {
-  color: #00438a;
-  text-decoration: underline;
-}
-
-/* Typography ----------------------------------------------------------------*/
-
-h1,h2,h3,h4,h5,h6 {
-  color: #404040;
-  margin: 0.7em 0 0 0;
-  line-height: 1.5em;
-}
-h1 {
-  font-size: 24px;
-  margin: 0;
-}
-h2 {
-  font-size: 21px;
-  line-height: 1.2em;
-  margin: 1em 0 0.5em 0;
-  border-bottom: 1px solid #404040;
-}
-h3 {
-  font-size: 18px;
-}
-h4 {
-  font-size: 16px;
-}
-h5 {
-  font-size: 14px;
-}
-h6 {
-  font-size: 13px;
-  text-transform: uppercase;
-}
-
-p {
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-  margin-top: 0px;
-  margin-bottom: 9px;
-}
-
-ul, ol {
-  margin-left: 0;
-  padding: 0 0 0 25px;
-}
-ul ul, ul ol, ol ol, ol ul {
-  margin-bottom: 0;
-}
-ul {
-  list-style: disc;
-}
-ol {
-  list-style: decimal;
-}
-li {
-  line-height: 18px;
-  color: #404040;
-}
-ul.unstyled {
-  list-style: none;
-  margin-left: 0;
-}
-dl {
-  margin-bottom: 18px;
-}
-dl dt, dl dd {
-  line-height: 18px;
-}
-dl dd {
-  margin-left: 9px;
-}
-hr {
-  margin: 20px 0 19px;
-  border: 0;
-  border-bottom: 1px solid #eee;
-}
-strong {
-  font-style: inherit;
-  font-weight: bold;
-}
-em {
-  font-style: italic;
-  font-weight: inherit;
-  line-height: inherit;
-}
-.muted {
-  color: #bfbfbf;
-}
-
-address {
-  display: block;
-  line-height: 18px;
-  margin-bottom: 18px;
-}
-code, pre {
-  padding: 0 3px 2px;
-  font-family: monospace;
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-}
-tt {
-  font-family: monospace;
-}
-code {
-  color: rgba(0, 0, 0, 0.75);
-  padding: 1px 3px;
-}
-pre {
-  display: block;
-  padding: 8.5px;
-  margin: 0 0 18px;
-  line-height: 18px;
-  border: 1px solid #ddd;
-  border: 1px solid rgba(0, 0, 0, 0.12);
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-  white-space: pre;
-  white-space: pre-wrap;
-  word-wrap: break-word;
-}
-
-img {
-  margin: 9px 0;
-}
-
-/* format inline code with a rounded box */
-tt {
-    margin: 0 2px;
-    padding: 0 5px;
-    border: 1px solid #ddd;
-    border: 1px solid rgba(0, 0, 0, 0.12);
-    border-radius: 3px;
-}
-
-/* all code has same box background color, even in headers */
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt, pre, code, tt {
-  background-color: #f8f8f8;
-}
-
-/* override box for links & other sphinx-specifc stuff */
-tt.xref, a tt, tt.descname, tt.descclassname {
-  padding: 0 1px 0 1px;
-  border: none;
-}
-
-/* override box for related bar at the top of the page */
-.related tt {
-  border: none;
-  padding: 0 1px 0 1px;
-  background-color: transparent;
-  font-weight: bold;
-}
-
-th {
-    background-color: #dddddd;
-}
-
-.viewcode-back {
-    font-family: sans-serif;
-}
-
-div.viewcode-block:target {
-    background-color: #f4debf;
-    border-top: 1px solid #ac9;
-    border-bottom: 1px solid #ac9;
-}
-
-table.docutils {
-    border-spacing: 5px;
-    border-collapse: separate;
-}
-
-/* Topbar --------------------------------------------------------------------*/
-
-div.topbar {
-  height: 40px;
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  z-index: 10000;
-  padding: 0px 10px;
-  background-color: #222;
-  background-color: #222222;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));
-  background-image: -moz-linear-gradient(top, #333333, #222222);
-  background-image: -ms-linear-gradient(top, #333333, #222222);
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));
-  background-image: -webkit-linear-gradient(top, #333333, #222222);
-  background-image: -o-linear-gradient(top, #333333, #222222);
-  background-image: linear-gradient(top, #333333, #222222);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
-}
-
-div.topbar a.brand {
-  font-family: 'Source Sans Pro', sans-serif;
-  font-size: 26px;
-  color: #ffffff;
-  font-weight: 600;
-  text-decoration: none;
-  float: left;
-  display: block;
-  height: 32px;
-  padding: 8px 12px 0px 45px;
-  margin-left: -10px;
-  background: transparent url("astropy_logo_32.png") no-repeat 10px 4px;
-}
-
-#logotext1 {
-}
-
-#logotext2 {
-    font-weight:200;
-    color: #ff5000;
-}
-#logotext3 {
-    font-weight:200;
-}
-
-div.topbar .brand:hover, div.topbar ul li a.homelink:hover {
-  background-color: #333;
-  background-color: rgba(255, 255, 255, 0.05);
-}
-
-div.topbar ul {
-    font-size: 110%;
-    list-style: none;
-    margin: 0;
-    padding: 0 0 0 10px;
-    float: right;
-    color: #bfbfbf;
-    text-align: center;
-    text-decoration: none;
-    height: 100%;
-}
-div.topbar ul li {
-    float: left;
-    display: inline;
-    height: 30px;
-    margin: 5px;
-    padding: 0px;
-}
-
-div.topbar ul li a {
-  color: #bfbfbf;
-  text-decoration: none;
-  padding: 5px;
-  display: block;
-  height: auto;
-  text-align: center;
-  vertical-align: middle;
-  border-radius: 4px;
-}
-
-div.topbar ul li a:hover {
-  color: #ffffff;
-  text-decoration: none;
-}
-
-div.topbar ul li a.homelink {
-  width: 112px;
-  display: block;
-  height: 20px;
-  padding: 5px 0px;
-  background: transparent url("astropy_linkout_20.png") no-repeat 10px 5px;
-}
-
-div.topbar form {
-  text-align: left;
-  margin: 0 0 0 5px;
-  position: relative;
-  filter: alpha(opacity=100);
-  -khtml-opacity: 1;
-  -moz-opacity: 1;
-  opacity: 1;
-}
-
-div.topbar input {
-  background-color: #444;
-  background-color: rgba(255, 255, 255, 0.3);
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: normal;
-  font-weight: 13px;
-  line-height: 1;
-  padding: 4px 9px;
-  color: #ffffff;
-  color: rgba(255, 255, 255, 0.75);
-  border: 1px solid #111;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
-  -webkit-transition: none;
-  -moz-transition: none;
-  -ms-transition: none;
-  -o-transition: none;
-  transition: none;
-}
-div.topbar input:-moz-placeholder {
-  color: #e6e6e6;
-}
-div.topbar input::-webkit-input-placeholder {
-  color: #e6e6e6;
-}
-div.topbar input:hover {
-  background-color: #bfbfbf;
-  background-color: rgba(255, 255, 255, 0.5);
-  color: #ffffff;
-}
-div.topbar input:focus, div.topbar input.focused {
-  outline: 0;
-  background-color: #ffffff;
-  color: #404040;
-  text-shadow: 0 1px 0 #ffffff;
-  border: 0;
-  padding: 5px 10px;
-  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-  -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-}
-
-
-/* Relation bar (breadcrumbs, prev, next) ------------------------------------*/
-
-div.related {
-    height: 21px;
-    width: auto;
-    margin: 0 10px;
-    position: absolute;
-    top: 42px;
-    clear: both;
-    left: 0;
-    right: 0;
-    z-index: 10000;
-    font-size: 100%;
-    vertical-align: middle;
-    background-color: #fff;
-    border-bottom: 1px solid #bbb;
-}
-div.related ul {
-    padding: 0;
-    margin: 0;
-}
-
-
-/* Footer --------------------------------------------------------------------*/
-
-footer {
-  display: block;
-  margin: 10px 10px 0px;
-  padding: 10px 0 0 0;
-  border-top: 1px solid #bbb;
-}
-.pull-right {
-  float: right;
-  width: 30em;
-  text-align: right;
-}
-
-
-/* Sphinx sidebar ------------------------------------------------------------*/
-
-div.sphinxsidebar {
-    font-size: inherit;
-    border-radius: 3px;
-    background-color: #eee;
-    border: 1px solid #bbb;
-}
-
-div.sphinxsidebarwrapper {
-    padding: 0px 0px 0px 5px;
-}
-
-div.sphinxsidebar h3 {
-    font-family: 'Trebuchet MS', sans-serif;
-    font-size: 1.4em;
-    font-weight: normal;
-    margin: 5px 0px 0px 5px;
-    padding: 0;
-    line-height: 1.6em;
-}
-div.sphinxsidebar h4 {
-    font-family: 'Trebuchet MS', sans-serif;
-    font-size: 1.3em;
-    font-weight: normal;
-    margin: 5px 0 0 0;
-    padding: 0;
-}
-div.sphinxsidebar p {
-}
-div.sphinxsidebar p.topless {
-    margin: 5px 10px 10px 10px;
-}
-div.sphinxsidebar ul {
-    margin: 0px 0px 0px 5px;
-    padding: 0;
-}
-
-div.sphinxsidebar ul ul {
-    margin-left: 15px;
-    list-style-type: disc;
-}
-
-/* If showing the global TOC (toctree),
-   color the current page differently */
-div.sphinxsidebar a.current {
-    color: #404040;
-}
-div.sphinxsidebar a.current:hover {
-    color: #404040;
-}
-
-
-/* document, documentwrapper, body, bodywrapper ----------------------------- */
-
-div.document {
-    margin-top: 72px;
-    margin-left: 10px;
-    margin-right: 10px;
-}
-
-div.documentwrapper {
-    float: left;
-    width: 100%;
-}
-
-div.body {
-    background-color: #ffffff;
-    padding: 0 0 0px 20px;
-}
-
-div.bodywrapper {
-    margin: 0 0 0 230px;
-    max-width: 55em;
-}
-
-
-/* Header links ------------------------------------------------------------- */
-
-a.headerlink {
-    font-size: 0.8em;
-    padding: 0 4px 0 4px;
-    text-decoration: none;
-}
-
-a.headerlink:hover {
-    background-color: #0069d6;
-    color: white;
-    text-docoration: none;
-}
-
-
-/* Admonitions and warnings ------------------------------------------------- */
-
-/* Shared by admonitions and warnings */
-div.admonition,
-div.warning {
-    padding: 0px;
-    border-radius: 3px;
-    -moz-border-radius: 3px;
-    -webkit-border-radius: 3px;
-}
-div.admonition p,
-div.warning p {
-    margin: 0.5em 1em 0.5em 1em;
-    padding: 0;
-}
-div.admonition pre,
-div.warning pre {
-    margin: 0.4em 1em 0.4em 1em;
-}
-div.admonition p.admonition-title,
-div.warning p.admonition-title {
-    margin: 0;
-    padding: 0.1em 0 0.1em 0.5em;
-    color: white;
-    font-weight: bold;
-    font-size: 1.1em;
-}
-div.admonition ul, div.admonition ol,
-div.warning ul, div.warning ol {
-    margin: 0.1em 0.5em 0.5em 3em;
-    padding: 0;
-}
-
-/* Admonitions only */
-div.admonition {
-    border: 1px solid #609060;
-    background-color: #e9ffe9;
-}
-div.admonition p.admonition-title {
-    background-color: #70A070;
-}
-
-/* Warnings only */
-div.warning {
-    border: 1px solid #900000;
-    background-color: #ffe9e9;
-}
-div.warning p.admonition-title {
-    background-color: #b04040;
-}
-
-
-/* Figures ------------------------------------------------------------------ */
-
-.figure.align-center {
-    clear: none;
-}
-
-/* This is a div for containing multiple figures side-by-side, for use with
- * .. container:: figures */
-div.figures {
-    border: 1px solid #CCCCCC;
-    background-color: #F8F8F8;
-    margin: 1em;
-    text-align: center;
-}
-
-div.figures .figure {
-    clear: none;
-    float: none;
-    display: inline-block;
-    border: none;
-    margin-left: 0.5em;
-    margin-right: 0.5em;
-}
-
-.field-list th {
-    white-space: nowrap;
-}
-
-table.field-list {
-    border-spacing: 0px;
-    margin-left: 1px;
-    border-left: 5px solid rgb(238, 238, 238) !important;
-}
-
-table.field-list th.field-name {
-    display: inline-block;
-    padding: 1px 8px 1px 5px;
-    white-space: nowrap;
-    background-color: rgb(238, 238, 238);
-    border-radius: 0 3px 3px 0;
-    -webkit-border-radius: 0 3px 3px 0;
-}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
deleted file mode 100644
index 5d82c67..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
+++ /dev/null
@@ -1,57 +0,0 @@
-$(document).ready(function() {
-    /* Add a [>>>] button on the top-right corner of code samples to hide
-     * the >>> and ... prompts and the output and thus make the code
-     * copyable. */
-    var div = $('.highlight-python .highlight,' +
-                '.highlight-python3 .highlight')
-    var pre = div.find('pre');
-
-    // get the styles from the current theme
-    pre.parent().parent().css('position', 'relative');
-    var hide_text = 'Hide the prompts and output';
-    var show_text = 'Show the prompts and output';
-    var border_width = pre.css('border-top-width');
-    var border_style = pre.css('border-top-style');
-    var border_color = pre.css('border-top-color');
-    var button_styles = {
-        'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
-        'border-color': border_color, 'border-style': border_style,
-        'border-width': border_width, 'color': border_color, 'text-size': '75%',
-        'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
-        'border-radius': '0 3px 0 0'
-    }
-
-    // create and add the button to all the code blocks that contain >>>
-    div.each(function(index) {
-        var jthis = $(this);
-        if (jthis.find('.gp').length > 0) {
-            var button = $('<span class="copybutton">>>></span>');
-            button.css(button_styles)
-            button.attr('title', hide_text);
-            jthis.prepend(button);
-        }
-        // tracebacks (.gt) contain bare text elements that need to be
-        // wrapped in a span to work with .nextUntil() (see later)
-        jthis.find('pre:has(.gt)').contents().filter(function() {
-            return ((this.nodeType == 3) && (this.data.trim().length > 0));
-        }).wrap('<span>');
-    });
-
-    // define the behavior of the button when it's clicked
-    $('.copybutton').toggle(
-        function() {
-            var button = $(this);
-            button.parent().find('.go, .gp, .gt').hide();
-            button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
-            button.css('text-decoration', 'line-through');
-            button.attr('title', show_text);
-        },
-        function() {
-            var button = $(this);
-            button.parent().find('.go, .gp, .gt').show();
-            button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
-            button.css('text-decoration', 'none');
-            button.attr('title', hide_text);
-        });
-});
-
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
deleted file mode 100644
index 15d87f3..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * sidebar.js
- * ~~~~~~~~~~
- *
- * This script makes the Sphinx sidebar collapsible.
- *
- * .sphinxsidebar contains .sphinxsidebarwrapper.  This script adds
- * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
- * used to collapse and expand the sidebar.
- *
- * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
- * and the width of the sidebar and the margin-left of the document
- * are decreased. When the sidebar is expanded the opposite happens.
- * This script saves a per-browser/per-session cookie used to
- * remember the position of the sidebar among the pages.
- * Once the browser is closed the cookie is deleted and the position
- * reset to the default (expanded).
- *
- * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-$(function() {
-  // global elements used by the functions.
-  // the 'sidebarbutton' element is defined as global after its
-  // creation, in the add_sidebar_button function
-  var bodywrapper = $('.bodywrapper');
-  var sidebar = $('.sphinxsidebar');
-  var sidebarwrapper = $('.sphinxsidebarwrapper');
-
-  // for some reason, the document has no sidebar; do not run into errors
-  if (!sidebar.length) return;
-
-  // original margin-left of the bodywrapper and width of the sidebar
-  // with the sidebar expanded
-  var bw_margin_expanded = bodywrapper.css('margin-left');
-  var ssb_width_expanded = sidebar.width();
-
-  // margin-left of the bodywrapper and width of the sidebar
-  // with the sidebar collapsed
-  var bw_margin_collapsed = 12;
-  var ssb_width_collapsed = 12;
-
-  // custom colors
-  var dark_color = '#404040';
-  var light_color = '#505050';
-
-  function sidebar_is_collapsed() {
-    return sidebarwrapper.is(':not(:visible)');
-  }
-
-  function toggle_sidebar() {
-    if (sidebar_is_collapsed())
-      expand_sidebar();
-    else
-      collapse_sidebar();
-  }
-
-  function collapse_sidebar() {
-    sidebarwrapper.hide();
-    sidebar.css('width', ssb_width_collapsed);
-    bodywrapper.css('margin-left', bw_margin_collapsed);
-    sidebarbutton.css({
-        'margin-left': '-1px',
-        'height': bodywrapper.height(),
-	'border-radius': '3px'
-    });
-    sidebarbutton.find('span').text('»');
-    sidebarbutton.attr('title', _('Expand sidebar'));
-    document.cookie = 'sidebar=collapsed';
-  }
-
-  function expand_sidebar() {
-    bodywrapper.css('margin-left', bw_margin_expanded);
-    sidebar.css('width', ssb_width_expanded);
-    sidebarwrapper.show();
-    sidebarbutton.css({
-        'margin-left': ssb_width_expanded - 12,
-        'height': bodywrapper.height(),
-	'border-radius': '0px 3px 3px 0px'
-    });
-    sidebarbutton.find('span').text('«');
-    sidebarbutton.attr('title', _('Collapse sidebar'));
-    document.cookie = 'sidebar=expanded';
-  }
-
-  function add_sidebar_button() {
-    sidebarwrapper.css({
-        'float': 'left',
-        'margin-right': '0',
-        'width': ssb_width_expanded - 18
-    });
-    // create the button
-    sidebar.append('<div id="sidebarbutton"><span>«</span></div>');
-    var sidebarbutton = $('#sidebarbutton');
-
-    // find the height of the viewport to center the '<<' in the page
-    var viewport_height;
-    if (window.innerHeight)
- 	  viewport_height = window.innerHeight;
-    else
-	  viewport_height = $(window).height();
-    var sidebar_offset = sidebar.offset().top;
-    var sidebar_height = Math.max(bodywrapper.height(), sidebar.height());
-    sidebarbutton.find('span').css({
-        'font-family': '"Lucida Grande",Arial,sans-serif', 
-	'display': 'block',
-	'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10,
-	'width': 12,
-	'position': 'fixed',
-	'text-align': 'center'
-    });
-
-    sidebarbutton.click(toggle_sidebar);
-    sidebarbutton.attr('title', _('Collapse sidebar'));
-    sidebarbutton.css({
-        'color': '#FFFFFF',
-	'background-color': light_color,
-	'border': '1px solid ' + light_color,
-        'border-radius': '0px 3px 3px 0px',
-        'font-size': '1.2em',
-        'cursor': 'pointer',
-        'height': sidebar_height,
-        'padding-top': '1px',
-	'margin': '-1px',
-        'margin-left': ssb_width_expanded - 12
-    });
-
-    sidebarbutton.hover(
-      function () {
-          $(this).css('background-color', dark_color);
-      },
-      function () {
-          $(this).css('background-color', light_color);
-      }
-    );
-  }
-
-  function set_position_from_cookie() {
-    if (!document.cookie)
-      return;
-    var items = document.cookie.split(';');
-    for(var k=0; k<items.length; k++) {
-      var key_val = items[k].split('=');
-      var key = key_val[0];
-      if (key == 'sidebar') {
-        var value = key_val[1];
-        if ((value == 'collapsed') && (!sidebar_is_collapsed()))
-          collapse_sidebar();
-        else if ((value == 'expanded') && (sidebar_is_collapsed()))
-          expand_sidebar();
-      }
-    }
-  }
-
-  add_sidebar_button();
-  var sidebarbutton = $('#sidebarbutton');
-  set_position_from_cookie();
-});
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
deleted file mode 100644
index ff1e5c7..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# AstroPy theme based on Twitter Bootstrap CSS
-[theme]
-inherit = basic
-stylesheet = bootstrap-astropy.css
-pygments_style = sphinx
-
-[options]
-logotext1 = astro
-logotext2 = py
-logotext3 = :docs
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/__init__.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/compiler.c b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/compiler.c
deleted file mode 100644
index 75500ca..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/compiler.c
+++ /dev/null
@@ -1,129 +0,0 @@
-#include <Python.h>
-
-/***************************************************************************
- * Macros for determining the compiler version.
- *
- * These are borrowed from boost, and majorly abridged to include only
- * the compilers we care about.
- ***************************************************************************/
-
-#ifndef PY3K
-#if PY_MAJOR_VERSION >= 3
-#define PY3K 1
-#else
-#define PY3K 0
-#endif
-#endif
-
-
-#define STRINGIZE(X) DO_STRINGIZE(X)
-#define DO_STRINGIZE(X) #X
-
-#if defined __clang__
-/*  Clang C++ emulates GCC, so it has to appear early. */
-#    define COMPILER "Clang version " __clang_version__
-
-#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
-/* Intel */
-#    if defined(__INTEL_COMPILER)
-#        define INTEL_VERSION __INTEL_COMPILER
-#    elif defined(__ICL)
-#        define INTEL_VERSION __ICL
-#    elif defined(__ICC)
-#        define INTEL_VERSION __ICC
-#    elif defined(__ECC)
-#        define INTEL_VERSION __ECC
-#    endif
-#    define COMPILER "Intel C compiler version " STRINGIZE(INTEL_VERSION)
-
-#elif defined(__GNUC__)
-/* gcc */
-#    define COMPILER "GCC version " __VERSION__
-
-#elif defined(__SUNPRO_CC)
-/* Sun Workshop Compiler */
-#    define COMPILER "Sun compiler version " STRINGIZE(__SUNPRO_CC)
-
-#elif defined(_MSC_VER)
-/* Microsoft Visual C/C++
-   Must be last since other compilers define _MSC_VER for compatibility as well */
-#    if _MSC_VER < 1200
-#        define COMPILER_VERSION 5.0
-#    elif _MSC_VER < 1300
-#        define COMPILER_VERSION 6.0
-#    elif _MSC_VER == 1300
-#        define COMPILER_VERSION 7.0
-#    elif _MSC_VER == 1310
-#        define COMPILER_VERSION 7.1
-#    elif _MSC_VER == 1400
-#        define COMPILER_VERSION 8.0
-#    elif _MSC_VER == 1500
-#        define COMPILER_VERSION 9.0
-#    elif _MSC_VER == 1600
-#        define COMPILER_VERSION 10.0
-#    else
-#        define COMPILER_VERSION _MSC_VER
-#    endif
-#    define COMPILER "Microsoft Visual C++ version " STRINGIZE(COMPILER_VERSION)
-
-#else
-/* Fallback */
-#    define COMPILER "Unknown compiler"
-
-#endif
-
-
-/***************************************************************************
- * Module-level
- ***************************************************************************/
-
-struct module_state {
-/* The Sun compiler can't handle empty structs */
-#if defined(__SUNPRO_C) || defined(_MSC_VER)
-    int _dummy;
-#endif
-};
-
-#if PY3K
-    static struct PyModuleDef moduledef = {
-        PyModuleDef_HEAD_INIT,
-        "_compiler",
-        NULL,
-        sizeof(struct module_state),
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NULL
-    };
-
-    #define INITERROR return NULL
-
-    PyMODINIT_FUNC
-    PyInit__compiler(void)
-
-#else
-    #define INITERROR return
-
-    PyMODINIT_FUNC
-    init_compiler(void)
-#endif
-
-{
-  PyObject* m;
-
-#if PY3K
-  m = PyModule_Create(&moduledef);
-#else
-  m = Py_InitModule3("_compiler", NULL, NULL);
-#endif
-
-  if (m == NULL)
-    INITERROR;
-
-  PyModule_AddStringConstant(m, "compiler", COMPILER);
-
-#if PY3K
-  return m;
-#endif
-}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/setup_package.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/setup_package.py
deleted file mode 100644
index f750125..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/src/setup_package.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def get_package_data():
-    return {'astropy_helpers.src': ['compiler.c']}
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/test_helpers.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/test_helpers.py
deleted file mode 100644
index dfe91ce..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/test_helpers.py
+++ /dev/null
@@ -1,207 +0,0 @@
-from __future__ import (absolute_import, division, print_function,
-                        unicode_literals)
-import os
-import shutil
-import subprocess
-import sys
-import tempfile
-
-from distutils.core import Command
-
-from .compat import _fix_user_options
-
-
-PY3 = sys.version_info[0] == 3
-
-
-class AstropyTest(Command, object):
-    description = 'Run the tests for this package'
-
-    user_options = [
-        ('package=', 'P',
-         "The name of a specific package to test, e.g. 'io.fits' or 'utils'.  "
-         "If nothing is specified, all default tests are run."),
-        ('test-path=', 't',
-         'Specify a test location by path.  If a relative path to a  .py file, '
-         'it is relative to the built package, so e.g., a  leading "astropy/" '
-         'is necessary.  If a relative  path to a .rst file, it is relative to '
-         'the directory *below* the --docs-path directory, so a leading '
-         '"docs/" is usually necessary.  May also be an absolute path.'),
-        ('verbose-results', 'V',
-         'Turn on verbose output from pytest.'),
-        ('plugins=', 'p',
-         'Plugins to enable when running pytest.'),
-        ('pastebin=', 'b',
-         "Enable pytest pastebin output. Either 'all' or 'failed'."),
-        ('args=', 'a',
-         'Additional arguments to be passed to pytest.'),
-        ('remote-data', 'R', 'Run tests that download remote data.'),
-        ('pep8', '8',
-         'Enable PEP8 checking and disable regular tests. '
-         'Requires the pytest-pep8 plugin.'),
-        ('pdb', 'd',
-         'Start the interactive Python debugger on errors.'),
-        ('coverage', 'c',
-         'Create a coverage report. Requires the coverage package.'),
-        ('open-files', 'o', 'Fail if any tests leave files open.'),
-        ('parallel=', 'j',
-         'Run the tests in parallel on the specified number of '
-         'CPUs.  If negative, all the cores on the machine will be '
-         'used.  Requires the pytest-xdist plugin.'),
-        ('docs-path=', None,
-         'The path to the documentation .rst files.  If not provided, and '
-         'the current directory contains a directory called "docs", that '
-         'will be used.'),
-        ('skip-docs', None,
-         "Don't test the documentation .rst files.")
-    ]
-
-    user_options = _fix_user_options(user_options)
-
-    package_name = ''
-
-    def initialize_options(self):
-        self.package = None
-        self.test_path = None
-        self.verbose_results = False
-        self.plugins = None
-        self.pastebin = None
-        self.args = None
-        self.remote_data = False
-        self.pep8 = False
-        self.pdb = False
-        self.coverage = False
-        self.open_files = False
-        self.parallel = 0
-        self.docs_path = None
-        self.skip_docs = False
-
-    def finalize_options(self):
-        # Normally we would validate the options here, but that's handled in
-        # run_tests
-        pass
-
-    def run(self):
-        try:
-            import astropy
-        except ImportError:
-            raise ImportError(
-                "The 'test' command requires the astropy package to be "
-                "installed and importable.")
-
-        self.reinitialize_command('build', inplace=False)
-        self.run_command('build')
-        build_cmd = self.get_finalized_command('build')
-        new_path = os.path.abspath(build_cmd.build_lib)
-
-        if self.docs_path is None:
-            if os.path.exists('docs'):
-                self.docs_path = os.path.abspath('docs')
-        else:
-            self.docs_path = os.path.abspath(self.docs_path)
-
-        # Copy the build to a temporary directory for the purposes of testing
-        # - this avoids creating pyc and __pycache__ directories inside the
-        # build directory
-        tmp_dir = tempfile.mkdtemp(prefix=self.package_name + '-test-')
-        testing_path = os.path.join(tmp_dir, os.path.basename(new_path))
-        shutil.copytree(new_path, testing_path)
-        shutil.copy('setup.cfg', testing_path)
-
-        cmd_pre = ''
-        cmd_post = ''
-
-        try:
-            if self.coverage:
-                if self.parallel != 0:
-                    raise ValueError(
-                        "--coverage can not be used with --parallel")
-
-                try:
-                    import coverage
-                except ImportError:
-                    raise ImportError(
-                        "--coverage requires that the coverage package is "
-                        "installed.")
-
-                # Don't use get_pkg_data_filename here, because it
-                # requires importing astropy.config and thus screwing
-                # up coverage results for those packages.
-                coveragerc = os.path.join(
-                    testing_path, self.package_name, 'tests', 'coveragerc')
-
-                # We create a coveragerc that is specific to the version
-                # of Python we're running, so that we can mark branches
-                # as being specifically for Python 2 or Python 3
-                with open(coveragerc, 'r') as fd:
-                    coveragerc_content = fd.read()
-                if PY3:
-                    ignore_python_version = '2'
-                else:
-                    ignore_python_version = '3'
-                coveragerc_content = coveragerc_content.replace(
-                    "{ignore_python_version}", ignore_python_version).replace(
-                        "{packagename}", self.package_name)
-                tmp_coveragerc = os.path.join(tmp_dir, 'coveragerc')
-                with open(tmp_coveragerc, 'wb') as tmp:
-                    tmp.write(coveragerc_content.encode('utf-8'))
-
-                cmd_pre = (
-                    'import coverage; '
-                    'cov = coverage.coverage(data_file="{0}", config_file="{1}"); '
-                    'cov.start();'.format(
-                        os.path.abspath(".coverage"), tmp_coveragerc))
-                cmd_post = (
-                    'cov.stop(); '
-                    'from astropy.tests.helper import _save_coverage; '
-                    '_save_coverage(cov, result, "{0}", "{1}");'.format(
-                        os.path.abspath('.'), testing_path))
-
-            if PY3:
-                set_flag = "import builtins; builtins._ASTROPY_TEST_ = True"
-            else:
-                set_flag = "import __builtin__; __builtin__._ASTROPY_TEST_ = True"
-
-            cmd = ('{cmd_pre}{0}; import {1.package_name}, sys; result = ('
-                   '{1.package_name}.test('
-                   'package={1.package!r}, '
-                   'test_path={1.test_path!r}, '
-                   'args={1.args!r}, '
-                   'plugins={1.plugins!r}, '
-                   'verbose={1.verbose_results!r}, '
-                   'pastebin={1.pastebin!r}, '
-                   'remote_data={1.remote_data!r}, '
-                   'pep8={1.pep8!r}, '
-                   'pdb={1.pdb!r}, '
-                   'open_files={1.open_files!r}, '
-                   'parallel={1.parallel!r}, '
-                   'docs_path={1.docs_path!r}, '
-                   'skip_docs={1.skip_docs!r})); '
-                   '{cmd_post}'
-                   'sys.exit(result)')
-            cmd = cmd.format(set_flag, self, cmd_pre=cmd_pre, cmd_post=cmd_post)
-
-            # Run the tests in a subprocess--this is necessary since
-            # new extension modules may have appeared, and this is the
-            # easiest way to set up a new environment
-
-            # Remove temporary directory
-            # On Python 3.x prior to 3.3, the creation of .pyc files
-            # is not atomic.  py.test jumps through some hoops to make
-            # this work by parsing import statements and carefully
-            # importing files atomically.  However, it can't detect
-            # when __import__ is used, so its carefulness still fails.
-            # The solution here (admittedly a bit of a hack), is to
-            # turn off the generation of .pyc files altogether by
-            # passing the `-B` switch to `python`.  This does mean
-            # that each core will have to compile .py file to bytecode
-            # itself, rather than getting lucky and borrowing the work
-            # already done by another core.  Compilation is an
-            # insignificant fraction of total testing time, though, so
-            # it's probably not worth worrying about.
-            retcode = subprocess.call([sys.executable, '-B', '-c', cmd],
-                                      cwd=testing_path, close_fds=False)
-        finally:
-            shutil.rmtree(tmp_dir)
-
-        raise SystemExit(retcode)
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/utils.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/utils.py
deleted file mode 100644
index bb05fb8..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/utils.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import contextlib
-import imp
-import os
-import sys
-
-
-# Python 3.3's importlib caches filesystem reads for faster imports in the
-# general case. But sometimes it's necessary to manually invalidate those
-# caches so that the import system can pick up new generated files.  See
-# https://github.com/astropy/astropy/issues/820
-if sys.version_info[:2] >= (3, 3):
-    from importlib import invalidate_caches
-else:
-    invalidate_caches = lambda: None
-
-
-class _DummyFile(object):
-    """A noop writeable object."""
-
-    errors = ''  # Required for Python 3.x
-
-    def write(self, s):
-        pass
-
-    def flush(self):
-        pass
-
-
- at contextlib.contextmanager
-def silence():
-    """A context manager that silences sys.stdout and sys.stderr."""
-
-    old_stdout = sys.stdout
-    old_stderr = sys.stderr
-    sys.stdout = _DummyFile()
-    sys.stderr = _DummyFile()
-    exception_occurred = False
-    try:
-        yield
-    except:
-        exception_occurred = True
-        # Go ahead and clean up so that exception handling can work normally
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-        raise
-
-    if not exception_occurred:
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-
-
-if sys.platform == 'win32':
-    import ctypes
-
-    def _has_hidden_attribute(filepath):
-        """
-        Returns True if the given filepath has the hidden attribute on
-        MS-Windows.  Based on a post here:
-        http://stackoverflow.com/questions/284115/cross-platform-hidden-file-detection
-        """
-        if isinstance(filepath, bytes):
-            filepath = filepath.decode(sys.getfilesystemencoding())
-        try:
-            attrs = ctypes.windll.kernel32.GetFileAttributesW(filepath)
-            assert attrs != -1
-            result = bool(attrs & 2)
-        except (AttributeError, AssertionError):
-            result = False
-        return result
-else:
-    def _has_hidden_attribute(filepath):
-        return False
-
-
-def is_path_hidden(filepath):
-    """
-    Determines if a given file or directory is hidden.
-
-    Parameters
-    ----------
-    filepath : str
-        The path to a file or directory
-
-    Returns
-    -------
-    hidden : bool
-        Returns `True` if the file is hidden
-    """
-
-    name = os.path.basename(os.path.abspath(filepath))
-    if isinstance(name, bytes):
-        is_dotted = name.startswith(b'.')
-    else:
-        is_dotted = name.startswith('.')
-    return is_dotted or _has_hidden_attribute(filepath)
-
-
-def walk_skip_hidden(top, onerror=None, followlinks=False):
-    """
-    A wrapper for `os.walk` that skips hidden files and directories.
-
-    This function does not have the parameter `topdown` from
-    `os.walk`: the directories must always be recursed top-down when
-    using this function.
-
-    See also
-    --------
-    os.walk : For a description of the parameters
-    """
-
-    for root, dirs, files in os.walk(
-            top, topdown=True, onerror=onerror,
-            followlinks=followlinks):
-        # These lists must be updated in-place so os.walk will skip
-        # hidden directories
-        dirs[:] = [d for d in dirs if not is_path_hidden(d)]
-        files[:] = [f for f in files if not is_path_hidden(f)]
-        yield root, dirs, files
-
-
-def write_if_different(filename, data):
-    """Write `data` to `filename`, if the content of the file is different.
-
-    Parameters
-    ----------
-    filename : str
-        The file name to be written to.
-    data : bytes
-        The data to be written to `filename`.
-    """
-
-    assert isinstance(data, bytes)
-
-    if os.path.exists(filename):
-        with open(filename, 'rb') as fd:
-            original_data = fd.read()
-    else:
-        original_data = None
-
-    if original_data != data:
-        with open(filename, 'wb') as fd:
-            fd.write(data)
-
-
-def import_file(filename):
-    """
-    Imports a module from a single file as if it doesn't belong to a
-    particular package.
-    """
-    # Specifying a traditional dot-separated fully qualified name here
-    # results in a number of "Parent module 'astropy' not found while
-    # handling absolute import" warnings.  Using the same name, the
-    # namespaces of the modules get merged together.  So, this
-    # generates an underscore-separated name which is more likely to
-    # be unique, and it doesn't really matter because the name isn't
-    # used directly here anyway.
-    with open(filename, 'U') as fd:
-        name = '_'.join(
-            os.path.relpath(os.path.splitext(filename)[0]).split(os.sep)[1:])
-        return imp.load_module(name, fd, filename, ('.py', 'U', 1))
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version.py
deleted file mode 100644
index 2cf23ca..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version.py
+++ /dev/null
@@ -1,169 +0,0 @@
-# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2014-09-16 18:05:48.195649
-
-
-import locale
-import os
-import subprocess
-import warnings
-
-
-def _decode_stdio(stream):
-    try:
-        stdio_encoding = locale.getdefaultlocale()[1] or 'utf-8'
-    except ValueError:
-        stdio_encoding = 'utf-8'
-
-    try:
-        text = stream.decode(stdio_encoding)
-    except UnicodeDecodeError:
-        # Final fallback
-        text = stream.decode('latin1')
-
-    return text
-
-
-def update_git_devstr(version, path=None):
-    """
-    Updates the git revision string if and only if the path is being imported
-    directly from a git working copy.  This ensures that the revision number in
-    the version string is accurate.
-    """
-
-    try:
-        # Quick way to determine if we're in git or not - returns '' if not
-        devstr = get_git_devstr(sha=True, show_warning=False, path=path)
-    except OSError:
-        return version
-
-    if not devstr:
-        # Probably not in git so just pass silently
-        return version
-
-    if 'dev' in version:  # update to the current git revision
-        version_base = version.split('.dev', 1)[0]
-        devstr = get_git_devstr(sha=False, show_warning=False, path=path)
-
-        return version_base + '.dev' + devstr
-    else:
-        #otherwise it's already the true/release version
-        return version
-
-
-def get_git_devstr(sha=False, show_warning=True, path=None):
-    """
-    Determines the number of revisions in this repository.
-
-    Parameters
-    ----------
-    sha : bool
-        If True, the full SHA1 hash will be returned. Otherwise, the total
-        count of commits in the repository will be used as a "revision
-        number".
-
-    show_warning : bool
-        If True, issue a warning if git returns an error code, otherwise errors
-        pass silently.
-
-    path : str or None
-        If a string, specifies the directory to look in to find the git
-        repository.  If `None`, the current working directory is used.
-        If given a filename it uses the directory containing that file.
-
-    Returns
-    -------
-    devversion : str
-        Either a string with the revsion number (if `sha` is False), the
-        SHA1 hash of the current commit (if `sha` is True), or an empty string
-        if git version info could not be identified.
-
-    """
-
-    if path is None:
-        path = os.getcwd()
-
-    if not os.path.isdir(path):
-        path = os.path.abspath(os.path.dirname(path))
-
-    if not os.path.exists(os.path.join(path, '.git')):
-        return ''
-
-    if sha:
-        # Faster for getting just the hash of HEAD
-        cmd = ['rev-parse', 'HEAD']
-    else:
-        cmd = ['rev-list', '--count', 'HEAD']
-
-    def run_git(cmd):
-        try:
-            p = subprocess.Popen(['git'] + cmd, cwd=path,
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE,
-                                 stdin=subprocess.PIPE)
-            stdout, stderr = p.communicate()
-        except OSError as e:
-            if show_warning:
-                warnings.warn('Error running git: ' + str(e))
-            return (None, '', '')
-
-        if p.returncode == 128:
-            if show_warning:
-                warnings.warn('No git repository present at {0!r}! Using '
-                              'default dev version.'.format(path))
-            return (p.returncode, '', '')
-        if p.returncode == 129:
-            if show_warning:
-                warnings.warn('Your git looks old (does it support {0}?); ' 
-                              'consider upgrading to v1.7.2 or '
-                              'later.'.format(cmd[0]))
-            return (p.returncode, stdout, stderr)
-        elif p.returncode != 0:
-            if show_warning:
-                warnings.warn('Git failed while determining revision '
-                              'count: {0}'.format(_decode_stdio(stderr)))
-            return (p.returncode, stdout, stderr)
-
-        return p.returncode, stdout, stderr
-
-    returncode, stdout, stderr = run_git(cmd)
-
-    if not sha and returncode == 129:
-        # git returns 129 if a command option failed to parse; in
-        # particualr this could happen in git versions older than 1.7.2
-        # where the --count option is not supported
-        # Also use --abbrev-commit and --abbrev=0 to display the minimum
-        # number of characters needed per-commit (rather than the full hash)
-        cmd = ['rev-list', '--abbrev-commit', '--abbrev=0', 'HEAD']
-        returncode, stdout, stderr = run_git(cmd)
-        # Fall back on the old method of getting all revisions and counting
-        # the lines
-        if returncode == 0:
-            return str(stdout.count(b'\n'))
-        else:
-            return ''
-    elif sha:
-        return _decode_stdio(stdout)[:40]
-    else:
-        return _decode_stdio(stdout).strip()
-
-_last_generated_version = '0.4.2'
-
-version = update_git_devstr(_last_generated_version)
-githash = get_git_devstr(sha=True, show_warning=False)
-
-
-major = 0
-minor = 4
-bugfix = 2
-
-release = True
-debug = False
-
-try:
-    from ._compiler import compiler
-except ImportError:
-    compiler = "unknown"
-
-try:
-    from .cython_version import cython_version
-except ImportError:
-    cython_version = "unknown"
diff --git a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version_helpers.py b/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version_helpers.py
deleted file mode 100644
index cd35c25..0000000
--- a/astropy_helpers/build/lib.linux-x86_64-2.7/astropy_helpers/version_helpers.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-"""
-Utilities for generating the version string for Astropy (or an affiliated
-package) and the version.py module, which contains version info for the
-package.
-
-Within the generated astropy.version module, the `major`, `minor`, and `bugfix`
-variables hold the respective parts of the version number (bugfix is '0' if
-absent). The `release` variable is True if this is a release, and False if this
-is a development version of astropy. For the actual version string, use::
-
-    from astropy.version import version
-
-or::
-
-    from astropy import __version__
-
-"""
-
-from __future__ import division
-
-import datetime
-import imp
-import os
-import pkgutil
-import sys
-
-from distutils import log
-
-from . import git_helpers
-from .setup_helpers import is_distutils_display_option, get_pkg_version_module
-from .utils import invalidate_caches
-
-PY3 = sys.version_info[0] == 3
-
-
-
-def _version_split(version):
-    """
-    Split a version string into major, minor, and bugfix numbers (with bugfix
-    optional, defaulting to 0).
-    """
-
-    for prerel in ('.dev', 'a', 'b', 'rc'):
-        if prerel in version:
-            version = version.split(prerel)[0]
-
-    versplit = version.split('.')
-    major = int(versplit[0])
-    minor = int(versplit[1])
-    bugfix = 0 if len(versplit) < 3 else int(versplit[2])
-    return major, minor, bugfix
-
-
-# This is used by setup.py to create a new version.py - see that file for
-# details. Note that the imports have to be absolute, since this is also used
-# by affiliated packages.
-_FROZEN_VERSION_PY_TEMPLATE = """
-# Autogenerated by {packagename}'s setup.py on {timestamp}
-
-{header}
-
-major = {major}
-minor = {minor}
-bugfix = {bugfix}
-
-release = {rel}
-debug = {debug}
-
-try:
-    from ._compiler import compiler
-except ImportError:
-    compiler = "unknown"
-
-try:
-    from .cython_version import cython_version
-except ImportError:
-    cython_version = "unknown"
-"""[1:]
-
-
-_FROZEN_VERSION_PY_WITH_GIT_HEADER = """
-{git_helpers}
-
-_last_generated_version = {verstr!r}
-
-version = update_git_devstr(_last_generated_version)
-githash = get_git_devstr(sha=True, show_warning=False)
-"""[1:]
-
-
-def _get_version_py_str(packagename, version, release, debug, uses_git=True):
-    timestamp = str(datetime.datetime.now())
-    major, minor, bugfix = _version_split(version)
-
-    if packagename.lower() == 'astropy':
-        packagename = 'Astropy'
-    else:
-        packagename = 'Astropy-affiliated package ' + packagename
-
-    if uses_git:
-        loader = pkgutil.get_loader(git_helpers)
-        source = loader.get_source(git_helpers.__name__) or ''
-        source_lines = source.splitlines()
-        if not source_lines:
-            log.warn('Cannot get source code for astropy_helpers.git_helpers; '
-                     'git support disabled.')
-            return _get_version_py_str(packagename, version, release, debug,
-                                       uses_git=False)
-        idx = 0
-        for idx, line in enumerate(source_lines):
-            if line.startswith('# BEGIN'):
-                break
-        git_helpers_py = '\n'.join(source_lines[idx + 1:])
-
-        if PY3:
-            verstr = version
-        else:
-            # In Python 2 don't pass in a unicode string; otherwise verstr will
-            # be represented with u'' syntax which breaks on Python 3.x with x
-            # < 3.  This is only an issue when developing on multiple Python
-            # versions at once
-            verstr = version.encode('utf8')
-
-        header = _FROZEN_VERSION_PY_WITH_GIT_HEADER.format(
-                git_helpers=git_helpers_py,
-                verstr=verstr)
-    else:
-        header = 'version = {0!r}'.format(version)
-
-    return _FROZEN_VERSION_PY_TEMPLATE.format(packagename=packagename,
-                                              timestamp=timestamp,
-                                              header=header,
-                                              major=major,
-                                              minor=minor,
-                                              bugfix=bugfix,
-                                              rel=release, debug=debug)
-
-
-def generate_version_py(packagename, version, release=None, debug=None,
-                        uses_git=True):
-    """Regenerate the version.py module if necessary."""
-
-    try:
-        version_module = get_pkg_version_module(packagename)
-
-        try:
-            last_generated_version = version_module._last_generated_version
-        except AttributeError:
-            last_generated_version = version_module.version
-
-        current_release = version_module.release
-        current_debug = version_module.debug
-    except ImportError:
-        version_module = None
-        last_generated_version = None
-        current_release = None
-        current_debug = None
-
-    if release is None:
-        # Keep whatever the current value is, if it exists
-        release = bool(current_release)
-
-    if debug is None:
-        # Likewise, keep whatever the current value is, if it exists
-        debug = bool(current_debug)
-
-    version_py = os.path.join(packagename, 'version.py')
-
-    if (last_generated_version != version or current_release != release or
-        current_debug != debug):
-        if '-q' not in sys.argv and '--quiet' not in sys.argv:
-            log.set_threshold(log.INFO)
-
-        if is_distutils_display_option():
-            # Always silence unnecessary log messages when display options are
-            # being used
-            log.set_threshold(log.WARN)
-
-        log.info('Freezing version number to {0}'.format(version_py))
-
-        with open(version_py, 'w') as f:
-            # This overwrites the actual version.py
-            f.write(_get_version_py_str(packagename, version, release, debug,
-                                        uses_git=uses_git))
-
-        invalidate_caches()
-
-        if version_module:
-            imp.reload(version_module)
diff --git a/astropy_helpers/dist/astropy_helpers-0.4.2-py2.7.egg b/astropy_helpers/dist/astropy_helpers-0.4.2-py2.7.egg
deleted file mode 100644
index 02da4f8..0000000
Binary files a/astropy_helpers/dist/astropy_helpers-0.4.2-py2.7.egg and /dev/null differ
diff --git a/astropy_helpers/ez_setup.py b/astropy_helpers/ez_setup.py
deleted file mode 100644
index 9dc2c87..0000000
--- a/astropy_helpers/ez_setup.py
+++ /dev/null
@@ -1,382 +0,0 @@
-#!python
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
-    from ez_setup import use_setuptools
-    use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import os
-import shutil
-import sys
-import tempfile
-import tarfile
-import optparse
-import subprocess
-import platform
-
-from distutils import log
-
-try:
-    from site import USER_SITE
-except ImportError:
-    USER_SITE = None
-
-DEFAULT_VERSION = "1.4.2"
-DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
-
-def _python_cmd(*args):
-    args = (sys.executable,) + args
-    return subprocess.call(args) == 0
-
-def _check_call_py24(cmd, *args, **kwargs):
-    res = subprocess.call(cmd, *args, **kwargs)
-    class CalledProcessError(Exception):
-        pass
-    if not res == 0:
-        msg = "Command '%s' return non-zero exit status %d" % (cmd, res)
-        raise CalledProcessError(msg)
-vars(subprocess).setdefault('check_call', _check_call_py24)
-
-def _install(tarball, install_args=()):
-    # extracting the tarball
-    tmpdir = tempfile.mkdtemp()
-    log.warn('Extracting in %s', tmpdir)
-    old_wd = os.getcwd()
-    try:
-        os.chdir(tmpdir)
-        tar = tarfile.open(tarball)
-        _extractall(tar)
-        tar.close()
-
-        # going in the directory
-        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
-        os.chdir(subdir)
-        log.warn('Now working in %s', subdir)
-
-        # installing
-        log.warn('Installing Setuptools')
-        if not _python_cmd('setup.py', 'install', *install_args):
-            log.warn('Something went wrong during the installation.')
-            log.warn('See the error message above.')
-            # exitcode will be 2
-            return 2
-    finally:
-        os.chdir(old_wd)
-        shutil.rmtree(tmpdir)
-
-
-def _build_egg(egg, tarball, to_dir):
-    # extracting the tarball
-    tmpdir = tempfile.mkdtemp()
-    log.warn('Extracting in %s', tmpdir)
-    old_wd = os.getcwd()
-    try:
-        os.chdir(tmpdir)
-        tar = tarfile.open(tarball)
-        _extractall(tar)
-        tar.close()
-
-        # going in the directory
-        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
-        os.chdir(subdir)
-        log.warn('Now working in %s', subdir)
-
-        # building an egg
-        log.warn('Building a Setuptools egg in %s', to_dir)
-        _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
-
-    finally:
-        os.chdir(old_wd)
-        shutil.rmtree(tmpdir)
-    # returning the result
-    log.warn(egg)
-    if not os.path.exists(egg):
-        raise IOError('Could not build the egg.')
-
-
-def _do_download(version, download_base, to_dir, download_delay):
-    egg = os.path.join(to_dir, 'setuptools-%s-py%d.%d.egg'
-                       % (version, sys.version_info[0], sys.version_info[1]))
-    if not os.path.exists(egg):
-        tarball = download_setuptools(version, download_base,
-                                      to_dir, download_delay)
-        _build_egg(egg, tarball, to_dir)
-    sys.path.insert(0, egg)
-
-    # Remove previously-imported pkg_resources if present (see
-    # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details).
-    if 'pkg_resources' in sys.modules:
-        del sys.modules['pkg_resources']
-
-    import setuptools
-    setuptools.bootstrap_install_from = egg
-
-
-def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
-                   to_dir=os.curdir, download_delay=15):
-    # making sure we use the absolute path
-    to_dir = os.path.abspath(to_dir)
-    was_imported = 'pkg_resources' in sys.modules or \
-        'setuptools' in sys.modules
-    try:
-        import pkg_resources
-    except ImportError:
-        return _do_download(version, download_base, to_dir, download_delay)
-    try:
-        pkg_resources.require("setuptools>=" + version)
-        return
-    except pkg_resources.VersionConflict:
-        e = sys.exc_info()[1]
-        if was_imported:
-            sys.stderr.write(
-            "The required version of setuptools (>=%s) is not available,\n"
-            "and can't be installed while this script is running. Please\n"
-            "install a more recent version first, using\n"
-            "'easy_install -U setuptools'."
-            "\n\n(Currently using %r)\n" % (version, e.args[0]))
-            sys.exit(2)
-        else:
-            del pkg_resources, sys.modules['pkg_resources']    # reload ok
-            return _do_download(version, download_base, to_dir,
-                                download_delay)
-    except pkg_resources.DistributionNotFound:
-        return _do_download(version, download_base, to_dir,
-                            download_delay)
-
-def _clean_check(cmd, target):
-    """
-    Run the command to download target. If the command fails, clean up before
-    re-raising the error.
-    """
-    try:
-        subprocess.check_call(cmd)
-    except subprocess.CalledProcessError:
-        if os.access(target, os.F_OK):
-            os.unlink(target)
-        raise
-
-def download_file_powershell(url, target):
-    """
-    Download the file at url to target using Powershell (which will validate
-    trust). Raise an exception if the command cannot complete.
-    """
-    target = os.path.abspath(target)
-    cmd = [
-        'powershell',
-        '-Command',
-        "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars(),
-    ]
-    _clean_check(cmd, target)
-
-def has_powershell():
-    if platform.system() != 'Windows':
-        return False
-    cmd = ['powershell', '-Command', 'echo test']
-    devnull = open(os.path.devnull, 'wb')
-    try:
-        try:
-            subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
-        except:
-            return False
-    finally:
-        devnull.close()
-    return True
-
-download_file_powershell.viable = has_powershell
-
-def download_file_curl(url, target):
-    cmd = ['curl', url, '--silent', '--output', target]
-    _clean_check(cmd, target)
-
-def has_curl():
-    cmd = ['curl', '--version']
-    devnull = open(os.path.devnull, 'wb')
-    try:
-        try:
-            subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
-        except:
-            return False
-    finally:
-        devnull.close()
-    return True
-
-download_file_curl.viable = has_curl
-
-def download_file_wget(url, target):
-    cmd = ['wget', url, '--quiet', '--output-document', target]
-    _clean_check(cmd, target)
-
-def has_wget():
-    cmd = ['wget', '--version']
-    devnull = open(os.path.devnull, 'wb')
-    try:
-        try:
-            subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
-        except:
-            return False
-    finally:
-        devnull.close()
-    return True
-
-download_file_wget.viable = has_wget
-
-def download_file_insecure(url, target):
-    """
-    Use Python to download the file, even though it cannot authenticate the
-    connection.
-    """
-    try:
-        from urllib.request import urlopen
-    except ImportError:
-        from urllib2 import urlopen
-    src = dst = None
-    try:
-        src = urlopen(url)
-        # Read/write all in one block, so we don't create a corrupt file
-        # if the download is interrupted.
-        data = src.read()
-        dst = open(target, "wb")
-        dst.write(data)
-    finally:
-        if src:
-            src.close()
-        if dst:
-            dst.close()
-
-download_file_insecure.viable = lambda: True
-
-def get_best_downloader():
-    downloaders = [
-        download_file_powershell,
-        download_file_curl,
-        download_file_wget,
-        download_file_insecure,
-    ]
-
-    for dl in downloaders:
-        if dl.viable():
-            return dl
-
-def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
-                        to_dir=os.curdir, delay=15,
-                        downloader_factory=get_best_downloader):
-    """Download setuptools from a specified location and return its filename
-
-    `version` should be a valid setuptools version number that is available
-    as an egg for download under the `download_base` URL (which should end
-    with a '/'). `to_dir` is the directory where the egg will be downloaded.
-    `delay` is the number of seconds to pause before an actual download
-    attempt.
-
-    ``downloader_factory`` should be a function taking no arguments and
-    returning a function for downloading a URL to a target.
-    """
-    # making sure we use the absolute path
-    to_dir = os.path.abspath(to_dir)
-    tgz_name = "setuptools-%s.tar.gz" % version
-    url = download_base + tgz_name
-    saveto = os.path.join(to_dir, tgz_name)
-    if not os.path.exists(saveto):  # Avoid repeated downloads
-        log.warn("Downloading %s", url)
-        downloader = downloader_factory()
-        downloader(url, saveto)
-    return os.path.realpath(saveto)
-
-
-def _extractall(self, path=".", members=None):
-    """Extract all members from the archive to the current working
-       directory and set owner, modification time and permissions on
-       directories afterwards. `path' specifies a different directory
-       to extract to. `members' is optional and must be a subset of the
-       list returned by getmembers().
-    """
-    import copy
-    import operator
-    from tarfile import ExtractError
-    directories = []
-
-    if members is None:
-        members = self
-
-    for tarinfo in members:
-        if tarinfo.isdir():
-            # Extract directories with a safe mode.
-            directories.append(tarinfo)
-            tarinfo = copy.copy(tarinfo)
-            tarinfo.mode = 448  # decimal for oct 0700
-        self.extract(tarinfo, path)
-
-    # Reverse sort directories.
-    if sys.version_info < (2, 4):
-        def sorter(dir1, dir2):
-            return cmp(dir1.name, dir2.name)
-        directories.sort(sorter)
-        directories.reverse()
-    else:
-        directories.sort(key=operator.attrgetter('name'), reverse=True)
-
-    # Set correct owner, mtime and filemode on directories.
-    for tarinfo in directories:
-        dirpath = os.path.join(path, tarinfo.name)
-        try:
-            self.chown(tarinfo, dirpath)
-            self.utime(tarinfo, dirpath)
-            self.chmod(tarinfo, dirpath)
-        except ExtractError:
-            e = sys.exc_info()[1]
-            if self.errorlevel > 1:
-                raise
-            else:
-                self._dbg(1, "tarfile: %s" % e)
-
-
-def _build_install_args(options):
-    """
-    Build the arguments to 'python setup.py install' on the setuptools package
-    """
-    install_args = []
-    if options.user_install:
-        if sys.version_info < (2, 6):
-            log.warn("--user requires Python 2.6 or later")
-            raise SystemExit(1)
-        install_args.append('--user')
-    return install_args
-
-def _parse_args():
-    """
-    Parse the command line for options
-    """
-    parser = optparse.OptionParser()
-    parser.add_option(
-        '--user', dest='user_install', action='store_true', default=False,
-        help='install in user site package (requires Python 2.6 or later)')
-    parser.add_option(
-        '--download-base', dest='download_base', metavar="URL",
-        default=DEFAULT_URL,
-        help='alternative URL from where to download the setuptools package')
-    parser.add_option(
-        '--insecure', dest='downloader_factory', action='store_const',
-        const=lambda: download_file_insecure, default=get_best_downloader,
-        help='Use internal, non-validating downloader'
-    )
-    options, args = parser.parse_args()
-    # positional arguments are ignored
-    return options
-
-def main(version=DEFAULT_VERSION):
-    """Install or upgrade setuptools and EasyInstall"""
-    options = _parse_args()
-    tarball = download_setuptools(download_base=options.download_base,
-        downloader_factory=options.downloader_factory)
-    return _install(tarball, _build_install_args(options))
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/astropy_helpers/licenses/LICENSE_COPYBUTTON.rst b/astropy_helpers/licenses/LICENSE_COPYBUTTON.rst
deleted file mode 100644
index 7b52bf4..0000000
--- a/astropy_helpers/licenses/LICENSE_COPYBUTTON.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-Copyright 2014 Python Software Foundation
-License: PSF
- PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
- --------------------------------------------
- .
- 1. This LICENSE AGREEMENT is between the Python Software Foundation
- ("PSF"), and the Individual or Organization ("Licensee") accessing and
- otherwise using this software ("Python") in source or binary form and
- its associated documentation.
- .
- 2. Subject to the terms and conditions of this License Agreement, PSF
- hereby grants Licensee a nonexclusive, royalty-free, world-wide
- license to reproduce, analyze, test, perform and/or display publicly,
- prepare derivative works, distribute, and otherwise use Python
- alone or in any derivative version, provided, however, that PSF's
- License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
- 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
- Reserved" are retained in Python alone or in any derivative version
- prepared by Licensee.
- .
- 3. In the event Licensee prepares a derivative work that is based on
- or incorporates Python or any part thereof, and wants to make
- the derivative work available to others as provided herein, then
- Licensee hereby agrees to include in any such work a brief summary of
- the changes made to Python.
- .
- 4. PSF is making Python available to Licensee on an "AS IS"
- basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
- DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
- FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
- INFRINGE ANY THIRD PARTY RIGHTS.
- .
- 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
- FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
- A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
- OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
- .
- 6. This License Agreement will automatically terminate upon a material
- breach of its terms and conditions.
- .
- 7. Nothing in this License Agreement shall be deemed to create any
- relationship of agency, partnership, or joint venture between PSF and
- Licensee.  This License Agreement does not grant permission to use PSF
- trademarks or trade name in a trademark sense to endorse or promote
- products or services of Licensee, or any third party.
- .
- 8. By copying, installing or otherwise using Python, Licensee
- agrees to be bound by the terms and conditions of this License
- Agreement.
diff --git a/astropy_helpers/licenses/LICENSE_NUMPYDOC.rst b/astropy_helpers/licenses/LICENSE_NUMPYDOC.rst
deleted file mode 100644
index b15c699..0000000
--- a/astropy_helpers/licenses/LICENSE_NUMPYDOC.rst
+++ /dev/null
@@ -1,94 +0,0 @@
--------------------------------------------------------------------------------
-    The files
-    - numpydoc.py
-    - docscrape.py
-    - docscrape_sphinx.py
-    - phantom_import.py
-    have the following license:
-
-Copyright (C) 2008 Stefan van der Walt <stefan at mentat.za.net>, Pauli Virtanen <pav at iki.fi>
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
--------------------------------------------------------------------------------
-    The files
-    - compiler_unparse.py
-    - comment_eater.py
-    - traitsdoc.py
-    have the following license:
-
-This software is OSI Certified Open Source Software.
-OSI Certified is a certification mark of the Open Source Initiative.
-
-Copyright (c) 2006, Enthought, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of Enthought, Inc. nor the names of its contributors may
-   be used to endorse or promote products derived from this software without
-   specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
--------------------------------------------------------------------------------
-    The file
-    - plot_directive.py
-    originates from Matplotlib (http://matplotlib.sf.net/) which has
-    the following license:
-
-Copyright (c) 2002-2008 John D. Hunter; All Rights Reserved.
-
-1. This LICENSE AGREEMENT is between John D. Hunter (“JDH”), and the Individual or Organization (“Licensee”) accessing and otherwise using matplotlib software in source or binary form and its associated documentation.
-
-2. Subject to the terms and conditions of this License Agreement, JDH hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 0.98.3 alone or in any derivative version, provided, however, that JDH’s License Agreement and JDH’s notice of copyright, i.e., “Copyright (c) 2002-2008 John D. Hunter; All Rights Reserved” are retained in matplotlib 0.98 [...]
-
-3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 0.98.3 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 0.98.3.
-
-4. JDH is making matplotlib 0.98.3 available to Licensee on an “AS IS” basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.98.3 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
-
-5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 0.98.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 0.98.3, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-
-6. This License Agreement will automatically terminate upon a material breach of its terms and conditions.
-
-7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between JDH and Licensee. This License Agreement does not grant permission to use JDH trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party.
-
-8. By copying, installing or otherwise using matplotlib 0.98.3, Licensee agrees to be bound by the terms and conditions of this License Agreement.
-
diff --git a/astropy_helpers/setup.cfg b/astropy_helpers/setup.cfg
deleted file mode 100644
index 780a828..0000000
--- a/astropy_helpers/setup.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-[pytest]
-norecursedirs =
-    .tox
-    astropy_helpers/tests/package_template
-python_functions = test_
diff --git a/astropy_helpers/setup.py b/astropy_helpers/setup.py
deleted file mode 100755
index 0c4059d..0000000
--- a/astropy_helpers/setup.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# Licensed under a 3-clause BSD style license - see LICENSE.rst
-
-import ah_bootstrap
-import pkg_resources
-from setuptools import setup
-from astropy_helpers.setup_helpers import register_commands, get_package_info
-from astropy_helpers.version_helpers import generate_version_py
-
-NAME = 'astropy_helpers'
-VERSION = '0.4.2'
-RELEASE = 'dev' not in VERSION
-DOWNLOAD_BASE_URL = 'http://pypi.python.org/packages/source/a/astropy-helpers'
-
-generate_version_py(NAME, VERSION, RELEASE, False)
-
-# Use the updated version including the git rev count
-from astropy_helpers.version import version as VERSION
-
-cmdclass = register_commands(NAME, VERSION, RELEASE)
-# This package actually doesn't use the Astropy test command
-del cmdclass['test']
-
-setup(
-    name=pkg_resources.safe_name(NAME),  # astropy_helpers -> astropy-helpers
-    version=VERSION,
-    description='Utilities for building and installing Astropy, Astropy '
-                'affiliated packages, and their respective documentation.',
-    author='The Astropy Developers',
-    author_email='astropy.team at gmail.com',
-    license='BSD',
-    url='http://astropy.org',
-    long_description=open('README.rst').read(),
-    download_url='{0}/astropy-helpers-{1}.tar.gz'.format(DOWNLOAD_BASE_URL,
-                                                         VERSION),
-    classifiers=[
-        'Development Status :: 5 - Production/Stable',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: BSD License',
-        'Operating System :: OS Independent',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3',
-        'Topic :: Software Development :: Build Tools',
-        'Topic :: Software Development :: Libraries :: Python Modules',
-        'Topic :: System :: Archiving :: Packaging'
-    ],
-    cmdclass=cmdclass,
-    zip_safe=False,
-    **get_package_info(exclude=['astropy_helpers.tests'])
-)
diff --git a/astropy_helpers/tox.ini b/astropy_helpers/tox.ini
deleted file mode 100644
index 61b359d..0000000
--- a/astropy_helpers/tox.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[tox]
-envlist = py26,py27,py32,py33,py34
-
-[testenv]
-deps =
-    pytest
-    numpy
-    Cython
-    Sphinx
-# Note: Sphinx is required to run the sphinx.ext tests
-commands = py.test {posargs}
-sitepackages = False
diff --git a/docs/_pkgtemplate.rst b/docs/_pkgtemplate.rst
index f9ec534..ac432f0 100644
--- a/docs/_pkgtemplate.rst
+++ b/docs/_pkgtemplate.rst
@@ -2,7 +2,7 @@
 A description of the package (`astropy.packagename`)
 ****************************************************
 
-When creating a new subpackage's docuementation, this file should be
+When creating a new subpackage's documentation, this file should be
 copied to a file "index.rst" in a directory corresponding to the name of
 the package. E.g., ``docs/packagename/index.rst``. And don't forget to
 delete this paragraph.
diff --git a/docs/coordinates/formatting.rst b/docs/coordinates/formatting.rst
index 1e3d25d..b1e68fb 100644
--- a/docs/coordinates/formatting.rst
+++ b/docs/coordinates/formatting.rst
@@ -3,7 +3,7 @@ Formatting Coordinate Strings
 
 .. todo: @taldcroft should change this to start with a discussion of SkyCoord's capabilities
 
-Getting a string representation of a coordinate is most powerfuly
+Getting a string representation of a coordinate is most powerfully
 approached by treating the components (e.g., RA and Dec) separately.
 For example::
 
diff --git a/docs/coordinates/frames.rst b/docs/coordinates/frames.rst
index dc1d69f..170ddce 100644
--- a/docs/coordinates/frames.rst
+++ b/docs/coordinates/frames.rst
@@ -114,7 +114,7 @@ itself which represents a point in 3d space.
     >>> from astropy.coordinates import CartesianRepresentation
     >>> icrs.representation = CartesianRepresentation
     >>> icrs  # doctest: +FLOAT_CMP
-    <ICRS Coordinate: x=0.999238614955 , y=0.0174417749028 , z=0.0348994967025 >
+    <ICRS Coordinate: x=0.999238614955, y=0.0174417749028, z=0.0348994967025>
     >>> icrs.x  # doctest: +FLOAT_CMP
     <Quantity 0.9992386149554826>
 
diff --git a/docs/coordinates/index.rst b/docs/coordinates/index.rst
index 5a0d148..8f4bc72 100644
--- a/docs/coordinates/index.rst
+++ b/docs/coordinates/index.rst
@@ -109,7 +109,7 @@ which accepts a frame name, frame class, or frame instance::
 
     >>> from astropy.coordinates import FK5
     >>> c_icrs.galactic  # doctest: +FLOAT_CMP
-    <SkyCoord (Galactic): l=121.174302631 deg, b=-21.5728000618 deg>
+    <SkyCoord (Galactic): l=121.174241811 deg, b=-21.5728855724 deg>
     >>> c_fk5 = c_icrs.transform_to('fk5')  # c_icrs.fk5 does the same thing
     >>> c_fk5  # doctest: +FLOAT_CMP
     <SkyCoord (FK5): equinox=J2000.000, ra=10.6845915393 deg, dec=41.2691714591 deg>
@@ -224,7 +224,7 @@ This background information is not necessary for simply using
 `~astropy.coordinates`, particularly if you use the |skycoord| high-
 level class, but it is helpful for more advanced usage, particularly
 creating your own frame, transformations, or representations. Another
-useful piece of background infromation are some
+useful piece of background information are some
 :ref:`astropy-coordinates-definitions` as they are used in
 `~astropy.coordinates`.
 
diff --git a/docs/coordinates/representations.rst b/docs/coordinates/representations.rst
index e0421b3..71cb1dc 100644
--- a/docs/coordinates/representations.rst
+++ b/docs/coordinates/representations.rst
@@ -30,6 +30,11 @@ so on. The built-in representation classes are:
   cylindrical polar coordinates, represented by a cylindrical radius
   (``rho``), azimuthal angle (``phi``), and height (``z``).
 
+.. Note::
+   For information about using and changing the representation of
+   `~astropy.coordinates.SkyCoord` objects, see the
+   :ref:`astropy-skycoord-representations` section.
+
 Instantiating and converting
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -70,7 +75,7 @@ removed, and the points are still located on a unit sphere:
 
     >>> sph_unit = car.represent_as(UnitSphericalRepresentation)
     >>> sph_unit.represent_as(CartesianRepresentation)
-    <CartesianRepresentation x=0.4242... , y=0.7071... , z=0.5656... >
+    <CartesianRepresentation x=0.4242..., y=0.7071..., z=0.5656...>
 
 Array values
 ^^^^^^^^^^^^
diff --git a/docs/coordinates/skycoord.rst b/docs/coordinates/skycoord.rst
index ad61cf6..cae82bc 100644
--- a/docs/coordinates/skycoord.rst
+++ b/docs/coordinates/skycoord.rst
@@ -26,7 +26,7 @@ The key distinctions between |SkyCoord| and the low-level classes
   all attributes, such a round-trip transformation will return to the same
   coordinate object.
 
-- The |SkyCoord| class is more flexible with inputs to accomodate a wide
+- The |SkyCoord| class is more flexible with inputs to accommodate a wide
   variety of user preferences and available data formats.
 
 - The |SkyCoord| class has a number of convenience methods that are useful
@@ -201,7 +201,7 @@ to astropy are `~astropy.coordinates.ICRS`, `~astropy.coordinates.FK5`,
 The string aliases are simply lower-case versions of the class name.
 
 If the frame is not supplied then you will see a special ``ICRS``
-identifer.  This indicates that the frame is unspecified and operations
+identifier.  This indicates that the frame is unspecified and operations
 that require comparing coordinates (even within that object) are not allowed.
 
 **unit=UNIT**
@@ -331,13 +331,13 @@ new |SkyCoord| object in the requested frame::
 
   >>> sc_gal = sc.galactic
   >>> sc_gal  # doctest: +FLOAT_CMP
-  <SkyCoord (Galactic): l=99.6379436471 deg, b=-58.7096055983 deg>
+  <SkyCoord (Galactic): l=99.6378552814 deg, b=-58.7096929334 deg>
 
 Other attributes you should recognize are ``distance``, ``equinox``,
 ``obstime``, ``shape``.
 
 Digger deeper
-"""""""""""""""
+"""""""""""""
 *[Casual users can skip this section]*
 
 After transforming to Galactic the longitude and latitude values are now
@@ -411,8 +411,8 @@ much bother (duck typing!).
 The lowest layer in the stack is the abstract
 `~astropy.coordinates.UnitSphericalRepresentation` object:
 
-  >>> sc_gal.frame.data
-  <UnitSphericalRepresentation lon=1.739010... rad, lat=-1.024675... rad>
+  >>> sc_gal.frame.data  # doctest: +FLOAT_CMP
+  <UnitSphericalRepresentation lon=1.73900863429 rad, lat=-1.02467744452 rad>
 
 Transformations
 ^^^^^^^^^^^^^^^^^
@@ -431,7 +431,7 @@ name, frame class, frame instance, or |SkyCoord|::
   >>> from astropy.coordinates import FK5
   >>> sc = SkyCoord(1, 2, 'icrs', unit='deg')
   >>> sc.galactic  # doctest: +FLOAT_CMP
-  <SkyCoord (Galactic): l=99.6379436471 deg, b=-58.7096055983 deg>
+  <SkyCoord (Galactic): l=99.6378552814 deg, b=-58.7096929334 deg>
 
   >>> sc.transform_to('fk5')  # Same as sc.fk5 and sc.transform_to(FK5)  # doctest: +FLOAT_CMP
   <SkyCoord (FK5): equinox=J2000.000, ra=1.00000655566 deg, dec=2.00000243092 deg>
@@ -476,7 +476,7 @@ supplying the corresponding components for that representation::
 Other variations include::
 
     >>> SkyCoord(1, 2*u.deg, 3, representation='cylindrical')
-    <SkyCoord (ICRS): rho=1.0 , phi=2.0 deg, z=3.0 >
+    <SkyCoord (ICRS): rho=1.0, phi=2.0 deg, z=3.0>
 
     >>> SkyCoord(rho=1*u.km, phi=2*u.deg, z=3*u.m, representation='cylindrical')
     <SkyCoord (ICRS): rho=1.0 km, phi=2.0 deg, z=3.0 m>
@@ -485,7 +485,7 @@ Other variations include::
     <SkyCoord (ICRS): rho=1.0 km, phi=2.0 deg, z=3.0 m>
 
     >>> SkyCoord(1, 2, 3, unit=(None, u.deg, None), representation='cylindrical')
-    <SkyCoord (ICRS): rho=1.0 , phi=2.0 deg, z=3.0 >
+    <SkyCoord (ICRS): rho=1.0, phi=2.0 deg, z=3.0>
 
 In general terms, the allowed syntax is as follows::
 
@@ -665,6 +665,211 @@ state of the |SkyCoord| object, you should instead use the
     <class 'astropy.coordinates.representation.SphericalRepresentation'>
 
 
+Example 1: Plotting random data in Aitoff projection
+====================================================
+
+This is an example how to make a plot in the Aitoff projection using data 
+in a |SkyCoord| object. Here a randomly generated data set will be used.
+
+First we need to import the required packages. We use 
+`matplotlib <http://www.matplotlib.org/>`_ here for
+plotting and `numpy <http://www.numpy.org/>`_  to get the value of pi and to 
+generate our random data.
+
+.. doctest-requires:: matplotlib
+
+    >>> from astropy import units as u
+    >>> from astropy.coordinates import SkyCoord
+    >>> import matplotlib.pyplot as plt
+    >>> import numpy as np
+
+We now generate random data for visualisation. For RA this is done in the range
+of 0 and 360 degrees (``ra_random``), for DEC between -90 and +90 degrees
+(``dec_random``). Finally, we multiply these values by degrees to get an 
+`~astropy.units.Quantity` with units of degrees.
+
+.. doctest-requires:: matplotlib
+
+    >>> ra_random = np.random.rand(100)*360.0 * u.degree
+    >>> dec_random = (np.random.rand(100)*180.0-90.0) * u.degree
+
+As next step, those coordinates are transformed into an astropy.coordinates
+|SkyCoord| object.
+
+.. doctest-requires:: matplotlib
+
+    >>> c = SkyCoord(ra=ra_random, dec=dec_random, frame='icrs')
+
+Because matplotlib needs the coordinates in radians and between :math:`-\pi`
+and :math:`\pi`, not 0 and :math:`2\pi`, we have to convert them. 
+For this purpose the `astropy.coordinates.Angle` object provides a special method,
+which we use here to wrap at 180:
+
+.. doctest-requires:: matplotlib
+
+    >>> ra_rad = c.ra.wrap_at(180 * u.deg).radian
+    >>> dec_rad = c.dec.radian
+
+As last step we set up the plotting environment with matplotlib using the
+Aitoff projection with a specific title, a grid, filled circles as markers with
+a markersize of 2 and an alpha value of 0.3. We use a figure with an x-y ratio 
+that is well suited for such a projection and we move the title upwards from 
+its usual position to avoid overlap with the axis labels.
+
+.. doctest-requires:: matplotlib
+
+    >>> plt.figure(figsize=(8,4.2))
+    >>> plt.subplot(111, projection="aitoff")
+    >>> plt.title("Aitoff projection of our random data")
+    >>> plt.grid(True)
+    >>> plt.plot(ra_rad, dec_rad, 'o', markersize=2, alpha=0.3)
+    >>> plt.subplots_adjust(top=0.95,bottom=0.0) 
+    >>> plt.show()
+
+
+.. plot::
+
+    # This is an example how to make a plot in the Aitoff projection using data 
+    # in a SkyCoord object. Here a randomly generated data set will be used. The
+    # final script can be found below.
+
+    # First we need to import the required packages. We use 
+    # `matplotlib <http://www.matplotlib.org/>`_ here for
+    # plotting and `numpy <http://www.numpy.org/>`_  to get the value of pi and to 
+    # generate our random data.
+    from astropy import units as u
+    from astropy.coordinates import SkyCoord
+    import matplotlib.pyplot as plt
+    import numpy as np
+
+    # We now generate random data for visualisation. For RA this is done in the range
+    # of 0 and 360 degrees (``ra_random``), for DEC between -90 and +90 degrees
+    # (``dec_random``). Finally, we multiply these values by degrees to get an 
+    # `~astropy.units.Quantity` with units of degrees.
+    ra_random = np.random.rand(100)*360.0 * u.degree
+    dec_random = (np.random.rand(100)*180.0-90.0) * u.degree
+
+    # As next step, those coordinates are transformed into an astropy.coordinates
+    # astropy.coordinates.SkyCoord object.
+    c = SkyCoord(ra=ra_random, dec=dec_random, frame='icrs')
+
+    # Because matplotlib needs the coordinates in radians and between :math:`-\pi`
+    # and :math:`\pi`, not 0 and :math:`2\pi`, we have to convert them. 
+    # For this purpose the `astropy.coordinates.Angle` object provides a special method,
+    # which we use here to wrap at 180:
+    ra_rad = c.ra.wrap_at(180 * u.deg).radian
+    dec_rad = c.dec.radian
+
+    # As last step we set up the plotting environment with matplotlib using the
+    # Aitoff projection with a specific title, a grid, filled circles as markers with
+    # a markersize of 2 and an alpha value of 0.3.
+    plt.figure(figsize=(8,4.2))
+    plt.subplot(111, projection="aitoff")
+    plt.title("Aitoff projection of our random data", y=1.08)
+    plt.grid(True)
+    plt.plot(ra_rad, dec_rad, 'o', markersize=2, alpha=0.3)
+    plt.subplots_adjust(top=0.95,bottom=0.0) 
+    plt.show()
+
+
+
+Example 2: Plotting star positions in bulge and disk
+====================================================
+
+This is more realitic example how to make a plot in the Aitoff projection
+using data in a |SkyCoord| object.
+Here a randomly generated data set (multivariante
+normal distribution) for both stars in the bulge and in the disk of a galaxy
+will be used. Both types will be plotted with different number counts. 
+
+As in the last example, we first import the required packages.
+
+.. doctest-requires:: matplotlib
+
+    >>> from astropy import units as u
+    >>> from astropy.coordinates import SkyCoord
+    >>> import matplotlib.pyplot as plt
+    >>> import numpy as np
+
+We now generate random data for visualisation using
+`numpy.random.multivariate_normal`.
+
+.. doctest-requires:: matplotlib
+
+    >>> disk = np.random.multivariate_normal(mean=[0,0,0], cov=np.diag([1,1,0.5]), size=5000)
+    >>> bulge = np.random.multivariate_normal(mean=[0,0,0], cov=np.diag([1,1,1]), size=500)
+    >>> galaxy = np.concatenate([disk, bulge])
+
+As next step, those coordinates are transformed into an astropy.coordinates
+|SkyCoord| object.
+
+.. doctest-requires:: matplotlib
+
+    >>> c_gal = SkyCoord(galaxy, representation='cartesian', frame='galactic')
+    >>> c_gal_icrs = c_gal.icrs
+
+Again, as in the last example, we need to convert the coordinates in radians 
+and make sure they are between :math:`-\pi` and :math:`\pi`:
+
+.. doctest-requires:: matplotlib
+
+    >>> ra_rad = c_gal_icrs.ra.wrap_at(180 * u.deg).radian
+    >>> dec_rad = c_gal_icrs.dec.radian
+
+We use the same plotting setup as in the last example:
+
+.. doctest-requires:: matplotlib
+
+    >>> plt.figure(figsize=(8,4.2))
+    >>> plt.subplot(111, projection="aitoff")
+    >>> plt.title("Aitoff projection of our random data")
+    >>> plt.grid(True)
+    >>> plt.plot(ra_rad, dec_rad, 'o', markersize=2, alpha=0.3)
+    >>> plt.subplots_adjust(top=0.95,bottom=0.0) 
+    >>> plt.show()
+
+
+.. plot::
+
+    # This is more realitic example how to make a plot in the Aitoff projection
+    # using data in a SkyCoord object.
+    # Here a randomly generated data set (multivariante normal distribution) 
+    # for both stars in the bulge and in the disk of a galaxy
+    # will be used. Both types will be plotted with different number counts. The
+    # final script can be found below.
+
+    # As in the last example, we first import the required packages.
+    from astropy import units as u
+    from astropy.coordinates import SkyCoord
+    import matplotlib.pyplot as plt
+    import numpy as np
+
+    # We now generate random data for visualisation with 
+    # np.random.multivariate_normal.
+    disk = np.random.multivariate_normal(mean=[0,0,0], cov=np.diag([1,1,0.5]), size=5000)
+    bulge = np.random.multivariate_normal(mean=[0,0,0], cov=np.diag([1,1,1]), size=500)
+    galaxy = np.concatenate([disk, bulge])
+
+    # As next step, those coordinates are transformed into an astropy.coordinates
+    # astropy.coordinates.SkyCoord object.
+    c_gal = SkyCoord(galaxy, representation='cartesian', frame='galactic')
+    c_gal_icrs = c_gal.icrs
+
+    # Again, as in the last example, we need to convert the coordinates in radians 
+    # and make sure they are between :math:`-\pi` and :math:`\pi`:
+    ra_rad = c_gal_icrs.ra.wrap_at(180 * u.deg).radian
+    dec_rad = c_gal_icrs.dec.radian
+
+    # We use the same plotting setup as in the last example:
+    plt.figure(figsize=(8,4.2))
+    plt.subplot(111, projection="aitoff")
+    plt.title("Aitoff projection of our random data", y=1.08)
+    plt.grid(True)
+    plt.plot(ra_rad, dec_rad, 'o', markersize=2, alpha=0.3)
+    plt.subplots_adjust(top=0.95,bottom=0.0) 
+    plt.show()
+
+
 Convenience methods
 ^^^^^^^^^^^^^^^^^^^^
 
diff --git a/docs/coordinates/transforming.rst b/docs/coordinates/transforming.rst
index 23320c5..98191f0 100644
--- a/docs/coordinates/transforming.rst
+++ b/docs/coordinates/transforming.rst
@@ -19,7 +19,7 @@ The simplest method of transformation is shown below::
     >>> from astropy.coordinates import SkyCoord
     >>> gc = SkyCoord(l=0*u.degree, b=45*u.degree, frame='galactic')
     >>> gc.fk5  # doctest: +FLOAT_CMP
-    <SkyCoord (FK5): equinox=J2000.000, ra=229.27250215 deg, dec=-1.12841764184 deg>
+    <SkyCoord (FK5): equinox=J2000.000, ra=229.272514629 deg, dec=-1.12844288043 deg>
 
 While this appears to be simple attribute-style access, it is actually
 syntactic sugar for the more general
@@ -28,11 +28,11 @@ accept either a frame name, class or instance::
 
     >>> from astropy.coordinates import FK5
     >>> gc.transform_to('fk5')  # doctest: +FLOAT_CMP
-    <SkyCoord (FK5): equinox=J2000.000, ra=229.27250215 deg, dec=-1.12841764184 deg>
+    <SkyCoord (FK5): equinox=J2000.000, ra=229.272514629 deg, dec=-1.12844288043 deg>
     >>> gc.transform_to(FK5)  # doctest: +FLOAT_CMP
-    <SkyCoord (FK5): equinox=J2000.000, ra=229.27250215 deg, dec=-1.12841764184 deg>
+    <SkyCoord (FK5): equinox=J2000.000, ra=229.272514629 deg, dec=-1.12844288043 deg>
     >>> gc.transform_to(FK5(equinox='J1980.0'))  # doctest: +FLOAT_CMP
-    <SkyCoord (FK5): equinox=J1980.000, ra=229.014681064 deg, dec=-1.05557823687 deg>
+    <SkyCoord (FK5): equinox=J1980.000, ra=229.014693505 deg, dec=-1.05560349378 deg>
 
 As a convenience it is also possible to use a |SkyCoord| object as the frame in
 :meth:`~astropy.coordinates.SkyCoord.transform_to`.  This allows easily putting one
@@ -40,7 +40,7 @@ coordinate object into the frame of another::
 
     >>> sc = SkyCoord(ra=1.0, dec=2.0, unit='deg', frame=FK5, equinox='J1980.0')
     >>> gc.transform_to(sc)  # doctest: +FLOAT_CMP
-    <SkyCoord (FK5): equinox=J1980.000, ra=229.014681064 deg, dec=-1.05557823687 deg>
+    <SkyCoord (FK5): equinox=J1980.000, ra=229.014693505 deg, dec=-1.05560349378 deg>
 
 The table below summarizes the built-in coordinate frames.  For details of
 these frames and the transformations between them see the `astropy.coordinates`
diff --git a/docs/cosmology/index.rst b/docs/cosmology/index.rst
index 1d173df..66bb0ec 100644
--- a/docs/cosmology/index.rst
+++ b/docs/cosmology/index.rst
@@ -251,7 +251,7 @@ Photons and Neutrinos
 ---------------------
 The cosmology classes include the contribution to the energy density
 from both photons and neutrinos.  By default, the latter are assumed
-massless.  The three parameters controlling the proporties of these
+massless.  The three parameters controlling the properties of these
 species, which are arguments to the initializers of all the
 cosmological classes, are ``Tcmb0`` (the temperature of the CMB at z=0),
 ``Neff``, the effective number of neutrino species, and ``m_nu``, the rest
diff --git a/docs/development/docrules.rst b/docs/development/docrules.rst
index e98adfc..f843bd0 100644
--- a/docs/development/docrules.rst
+++ b/docs/development/docrules.rst
@@ -506,7 +506,7 @@ Other points to keep in mind
 
 * Questions and Answers : For general questions on how to write docstrings
   that are not answered in this document, refer to
-  `<http://docs.scipy.org/numpy/Questions+Answers/>`_.
+  `<http://docs-old.scipy.org/numpy/Questions+Answers/>`_.
 
 * ``array_like`` : For functions that take arguments which can have not only
   a type ``ndarray``, but also types that can be converted to an ndarray
diff --git a/docs/development/testguide.rst b/docs/development/testguide.rst
index b36b816..aeff16d 100644
--- a/docs/development/testguide.rst
+++ b/docs/development/testguide.rst
@@ -637,6 +637,25 @@ a real-world example::
    so the ``astropy.tests.helper.catch_warnings`` context manager is
    preferred.
 
+Testing configuration parameters
+--------------------------------
+
+In order to ensure reproducibility of tests, all configuration items
+are reset to their default values when the test runner starts up.
+
+Sometimes you'll want to test the behavior of code when a certain
+configuration item is set to a particular value.  In that case, you
+can use the ``~astropy.config.ConfigItem.set_temp`` context manager to
+temporarily set a configuration item to that value, test within that
+context, and have it automatically return to its original value.
+
+For example::
+
+    def test_pprint():
+        from ... import conf
+        with conf.set_temp('max_lines', 6):
+            # ...
+
 Testing with Unicode literals
 -----------------------------
 
@@ -823,7 +842,7 @@ The simplest way to generalize the example output is to use the ellipses
 
 This doctest expects an exception with a traceback, but the text of the
 traceback is skipped in the example output--only the first and last lines
-of the output are checked.  See the :mod:``doctest`` documentation for
+of the output are checked.  See the :mod:`doctest` documentation for
 more examples of skipping output.
 
 
diff --git a/docs/development/workflow/development_workflow.rst b/docs/development/workflow/development_workflow.rst
index ead0b0f..f6d0908 100644
--- a/docs/development/workflow/development_workflow.rst
+++ b/docs/development/workflow/development_workflow.rst
@@ -31,10 +31,12 @@ development version or stable version is the active one.
 up. It is well worth your time.
 
 Not sure what your first contribution should be? Take a look at the `Astropy
-issue list`_ and grab one labeled "easy"...but note that even your first "easy"
-fix is likely to take a while if you are not familiar with the Astropy source
-code! The developers are friendly and want you to help, so don't be shy about
-asking questions on the `astropy-dev mailing list`_.
+issue list`_ and grab one labeled "package-novice". These issues are the
+most accessible ones if you are not familiar with the Astropy source
+code. Issues labeled as "effort-low" are expected to take a few hours (at
+most) to address, while the "effort-medium" ones may take a few days. The
+developers are friendly and want you to help, so don't be shy about asking
+questions on the `astropy-dev mailing list`_.
 
 New to `git`_?
 ==============
@@ -432,12 +434,12 @@ The actual rebasing is usually easy::
     git fetch astropy/master  # get the latest development astropy
     git rebase astropy/master my-new-feature
 
-You are more likely to run into *conflics* here--places where the changes you
+You are more likely to run into *conflicts* here--places where the changes you
 made conflict with changes that someone else made--than anywhere else. Ask for
 help if you need it.
 
 After the rebase you need to push your changes to GitHub; you will need force
-the push because `git`_ objects to re-writing the history of the respository
+the push because `git`_ objects to re-writing the history of the repository
 after you have pushed it somewhere::
 
     git push -f
diff --git a/docs/development/workflow/get_devel_version.rst b/docs/development/workflow/get_devel_version.rst
index 08d3fce..8b30588 100644
--- a/docs/development/workflow/get_devel_version.rst
+++ b/docs/development/workflow/get_devel_version.rst
@@ -93,7 +93,7 @@ essential items:
 
 + Set up authentication so you don't have to type your github password every
   time you need to access github from the command line. The default method at
-  `Set Up Git at GitHub`_ may require administrative privleges; if that is a
+  `Set Up Git at GitHub`_ may require administrative privileges; if that is a
   problem, set up authentication
   `using SSH keys instead <https://help.github.com/articles/generating-ssh-keys>`_
 
diff --git a/docs/development/workflow/maintainer_workflow.rst b/docs/development/workflow/maintainer_workflow.rst
index cdd8f27..d8bbf16 100644
--- a/docs/development/workflow/maintainer_workflow.rst
+++ b/docs/development/workflow/maintainer_workflow.rst
@@ -226,7 +226,7 @@ Changelog format
 
 The exact formatting of the changelog content is a bit loose for now (though
 it might become stricter if we want to develop more tools around the
-changelog).  The format can be mostly inferred by looking at previous verisons.
+changelog).  The format can be mostly inferred by looking at previous versions.
 Each release gets its own heading (using the ``-`` heading marker) with the
 version and release date.  Releases still under development have
 ``(unreleased)`` as there is no release date yet.
@@ -242,7 +242,7 @@ or that only apply to support modules like ``logging`` or ``utils`` may go
 under a "Misc" group.
 
 The actual texts of the changelog entries are typically just one to three
-sentences--they should be easy to glance over.  Most entires end with a
+sentences--they should be easy to glance over.  Most entries end with a
 reference to an issue/pull request number in square brackets.
 
 A single changelog entry may also reference multiple small changes.  For
diff --git a/docs/development/workflow/virtual_pythons.rst b/docs/development/workflow/virtual_pythons.rst
index 66070cc..26e14d8 100644
--- a/docs/development/workflow/virtual_pythons.rst
+++ b/docs/development/workflow/virtual_pythons.rst
@@ -39,7 +39,7 @@ accomplish each step are given for both `conda`_ and `virtualenvwrapper`_:
 * :ref:`delete_env`
 
 .. note::
-    + You **cannot** use `virtualenvwrapper`_ or `virtualenv`_ within anadoncda.
+    + You **cannot** use `virtualenvwrapper`_ or `virtualenv`_ within anaconda.
     + `virtualenvwrapper`_ works with bash and bash-like shells; see
       :ref:`using-virtualenv` for alternatives.
 
@@ -152,7 +152,7 @@ addition to activating new ones.
 
       workon ENV
 
-* ` conda`: Activiate the environment ``ENV`` with::
+* ` conda`: Activate the environment ``ENV`` with::
 
       source activate ENV
 
diff --git a/docs/getting_started.rst b/docs/getting_started.rst
index 22f9aa2..c0e9d8d 100644
--- a/docs/getting_started.rst
+++ b/docs/getting_started.rst
@@ -68,3 +68,25 @@ particular a package or object, or access their documentation using the
 
 Will bring up the documentation for the `~astropy.units.Quantity` class
 in your browser.
+
+Command-line utilities
+======================
+
+For convenience, several of Astropy's subpackages install utility programs
+on your system which allow common tasks to be performed without having
+to open a Python interpreter. These utilities include:
+
+- `~astropy.io.fits.scripts.fitsheader`: prints the headers of a FITS file.
+
+- `~astropy.io.fits.scripts.fitscheck`: verifies and optionally re-writes
+  the CHECKSUM and DATASUM keywords of a FITS file.
+
+- :ref:`fitsdiff`: compares two FITS files and reports the differences.
+
+- :ref:`samp_hub <vo-samp-example_hub>`: starts a :ref:`SAMP <vo-samp>` hub.
+
+- ``volint``: checks a :ref:`VOTable <astropy-io-votable>`
+  file for compliance against the standards.
+
+- :ref:`wcslint <wcslint>`: checks the :ref:`WCS <astropy-wcs>` keywords in a
+  FITS file for compliance against the standards.
diff --git a/docs/install.rst b/docs/install.rst
index af0afdd..bf5cd71 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -84,7 +84,7 @@ run::
 
 .. note::
 
-    There may be a delay of a day or to between when a new version of Astropy
+    There may be a delay of a day or two between when a new version of Astropy
     is released and when a package is available for Anaconda. You can check
     for the list of available versions with ``conda search astropy``.
 
diff --git a/docs/io/ascii/base_classes.rst b/docs/io/ascii/base_classes.rst
index 406c75f..6c3df84 100644
--- a/docs/io/ascii/base_classes.rst
+++ b/docs/io/ascii/base_classes.rst
@@ -17,5 +17,5 @@ The key elements in :mod:`astropy.io.ascii` are:
 
 Each of these elements is an inheritable class with attributes that control the
 corresponding functionality.  In this way the large number of tweakable
-parameters is modularized into managable groups.  Where it makes sense these
+parameters is modularized into manageable groups.  Where it makes sense these
 attributes are actually functions that make it easy to handle special cases.
diff --git a/docs/io/ascii/fixed_width_gallery.rst b/docs/io/ascii/fixed_width_gallery.rst
index aca8d83..879ee3f 100644
--- a/docs/io/ascii/fixed_width_gallery.rst
+++ b/docs/io/ascii/fixed_width_gallery.rst
@@ -16,7 +16,7 @@ for example::
    2.4 's worlds    2    2
 
 There are a number of common variations in the formatting of fixed-width tables
-which :mod:`astropy.io.ascii` can read and write.  The most signicant difference is
+which :mod:`astropy.io.ascii` can read and write.  The most significant difference is
 whether there is no header line (:class:`~astropy.io.ascii.FixedWidthNoHeader`), one
 header line (:class:`~astropy.io.ascii.FixedWidth`), or two header lines
 (:class:`~astropy.io.ascii.FixedWidthTwoLine`).  Next, there are variations in the
diff --git a/docs/io/fits/appendix/faq.rst b/docs/io/fits/appendix/faq.rst
index b71d634..8576fb5 100644
--- a/docs/io/fits/appendix/faq.rst
+++ b/docs/io/fits/appendix/faq.rst
@@ -448,7 +448,7 @@ If the data must be returned to integers before saving, use the `ImageHDU.scale
 Alternatively, if a file is opened with ``mode='update'`` along with the
 ``scale_back=True`` argument, the original BSCALE and BZERO scaling will
 be automatically re-applied to the data before saving.  Usually this is
-not desireable, especially when converting from floating point back to
+not desirable, especially when converting from floating point back to
 unsigned integer values.  But this may be useful in cases where the raw
 data needs to be modified corresponding to changes in the physical values.
 
@@ -503,7 +503,7 @@ Underlying every table data array returned by `astropy.io.fits` is a Numpy
 structured array data (i.e. a table).  As with normal image arrays, Astropy
 accesses the underlying binary data from the FITS file via mmap (see the
 question "`What performance differences are there between astropy.io.fits and
-fitsio?`_" for a deeper explanation fo this).  The underlying mmap is then
+fitsio?`_" for a deeper explanation of this).  The underlying mmap is then
 exposed as a `~numpy.recarray` and in general this is a very efficient way to
 read the data.
 
diff --git a/docs/io/fits/appendix/header_transition.rst b/docs/io/fits/appendix/header_transition.rst
index 178298d..afb3890 100644
--- a/docs/io/fits/appendix/header_transition.rst
+++ b/docs/io/fits/appendix/header_transition.rst
@@ -16,7 +16,7 @@ Header Interface Transition Guide
 
 PyFITS v3.1 included an almost complete rewrite of the :class:`Header`
 interface.  Although the new interface is largely compatible with the old
-interace (whether due to similarities in the design, or backwards-compatibility
+interface (whether due to similarities in the design, or backwards-compatibility
 support), there are enough differences that a full explanation of the new
 interface is merited.
 
@@ -73,7 +73,7 @@ directly through :class:`Header` objects.  It also tries to present headers as
 similar as possible to more a more familiar data structure--an ordered mapping
 (or :class:`~collections.OrderedDict` in Python) for ease of use by new users
 less familiar with the FITS format.  Though there are still many added
-complexities for dealing with the idiosyncracies of the FITS format.
+complexities for dealing with the idiosyncrasies of the FITS format.
 
 
 Deprecation Warnings
@@ -115,7 +115,7 @@ old Header implementation also had a dict-like interface, it did not implement
 the *entire* dict interface as the new Header does.
 
 Although the new Header is used like a dict/mapping in most cases, it also
-supports a `list` interface.  The list-like interace is a bit idiosyncratic in
+supports a `list` interface.  The list-like interface is a bit idiosyncratic in
 that in some contexts the Header acts like a list of values, in some like a
 list of keywords, and in a few contexts like a list of :class:`Card` objects. This
 may be the most difficult aspect of the new design, but there is logic to it.
@@ -183,7 +183,7 @@ surprises.  There are differences, however:
 
       >>> del header[('NAXIS', 1)]
 
-  This will remove an accdential duplicate NAXIS card from the header.
+  This will remove an accidental duplicate NAXIS card from the header.
 
 - Even if there are duplicate keywords, keyword lookups like
   ``header['NAXIS']`` will always return the value associated with the first
@@ -388,7 +388,7 @@ Other Gotchas
   The other type of string representation happens when one calls
   ``repr(header)``.  The `repr` of an object is just meant to be a useful
   string "representation" of the object; in this case the contents of the
-  header but with linebreaks betwen the cards and with the END card and
+  header but with linebreaks between the cards and with the END card and
   padding trailing padding stripped off.  This happens automatically when
   one enters a variable at the Python prompt by itself without a ``print``
   call.
@@ -405,7 +405,7 @@ Other Gotchas
   automatically stripping trailing spaces, so that ``header['KEYWORD1']`` would
   return just ``'Value'``.
 
-  There is, however, one convention used by the IRAF ccdmosiac task for
+  There is, however, one convention used by the IRAF ccdmosaic task for
   representing its `TNX World Coordinate System
   <http://iraf.noao.edu/projects/ccdmosaic/tnx.html>`_ and `ZPX World
   Coordinate System <http://iraf.noao.edu/projects/ccdmosaic/zpx.html>`_
diff --git a/docs/io/fits/appendix/history.rst b/docs/io/fits/appendix/history.rst
index 9784567..ddcf409 100644
--- a/docs/io/fits/appendix/history.rst
+++ b/docs/io/fits/appendix/history.rst
@@ -468,7 +468,7 @@ Other Changes and Additions
   no dithering is used, but the ``SUBTRACTIVE_DITHER_1`` and
   ``SUBTRACTIVE_DITHER_2`` methods can be enabled by passing the correct
   constants to the ``quantize_method`` argument to the ``CompImageHDU``
-  constuctor.  A seed can be manually specified, or automatically generated
+  constructor.  A seed can be manually specified, or automatically generated
   using either the system clock or checksum-based methods via the
   ``dither_seed`` argument.  See the documentation for ``CompImageHDU`` for
   more details. (#198) (spacetelescope/PYFITS#32)
@@ -928,7 +928,7 @@ API Changes
 - A new global variable ``pyfits.EXTENSION_NAME_CASE_SENSITIVE`` was added.
   This serves as a replacement for ``pyfits.setExtensionNameCaseSensitive``
   which is not deprecated and may be removed in a future version.  To enable
-  case-sensitivity of extension names (i.e. treat 'sci' as distict from 'SCI')
+  case-sensitivity of extension names (i.e. treat 'sci' as distinct from 'SCI')
   set ``pyfits.EXTENSION_NAME_CASE_SENSITIVE = True``.  The default is
   ``False``. (r1139)
 
@@ -1070,7 +1070,7 @@ Bug Fixes
 
 - Fixed a bug where opening a file containing compressed image HDUs in
   'update' mode and then immediately closing it without making any changes
-  caused the file to be rewritten unncessarily. (#167)
+  caused the file to be rewritten unnecessarily. (#167)
 
 - Fixed two memory leaks that could occur when writing compressed image data,
   or in some cases when opening files containing compressed image HDUs in
@@ -1407,7 +1407,7 @@ Bug Fixes
 - Fixed a bug where writing a table with zero rows could fail in some cases
   (#72)
 
-- Miscellanous small bug fixes that were causing some tests to fail,
+- Miscellaneous small bug fixes that were causing some tests to fail,
   particularly on Python 3 (#74, #75)
 
 - Fixed a bug where creating a table column from an array in non-native byte
@@ -1950,7 +1950,7 @@ The following bugs were fixed:
   variable length format column from character data (PA format).
 
 - Modified installation code so that when installing on Windows, when a C++
-  compiler compatable with the Python binary is not found, the installation
+  compiler compatible with the Python binary is not found, the installation
   completes with a warning that all optional extension modules failed to
   build.  Previously, an Error was issued and the installation stopped.
 
@@ -2906,7 +2906,7 @@ Minor changes since v0.9.6:
 - Modify the the design of the open() function to remove the output_verify
   argument.
 
-- Remove the groups argument in GroupsHDU's contructor.
+- Remove the groups argument in GroupsHDU's constructor.
 
 - Redesign the column definition class to make its column components more
   accessible.  Also to make it conducive for higher level functionalities,
diff --git a/docs/io/fits/index.rst b/docs/io/fits/index.rst
index fb887b6..8a85455 100644
--- a/docs/io/fits/index.rst
+++ b/docs/io/fits/index.rst
@@ -503,7 +503,7 @@ variables for the individual columns and without manually creating a
 
 Now you may write this new table HDU directly to a FITS file like so::
 
-    >>> hdu = fits.PrimaryHDU(n)
+    >>> tbhdu.writeto('table.fits')
 
 This shortcut will automatically create a minimal primary HDU with no data and
 prepend it to the table HDU to create a valid FITS file.  If you require
diff --git a/docs/io/fits/usage/scripts.rst b/docs/io/fits/usage/scripts.rst
index 0c5bdec..ec19c1b 100644
--- a/docs/io/fits/usage/scripts.rst
+++ b/docs/io/fits/usage/scripts.rst
@@ -15,6 +15,8 @@ fitscheck
 With Astropy installed, please run ``fitscheck --help`` to see the full program
 usage documentation.
 
+.. _fitsdiff:
+
 fitsdiff
 ^^^^^^^^
 
diff --git a/docs/io/fits/usage/table.rst b/docs/io/fits/usage/table.rst
index e9c43b1..84b5e82 100644
--- a/docs/io/fits/usage/table.rst
+++ b/docs/io/fits/usage/table.rst
@@ -74,7 +74,7 @@ table.  To recap, the simple example in the Quick Tutorial::
     >>> print tbdata[:2]  # show the first two rows
     [(1, 'Sirius', -1.4500000476837158, 'A1V'),
     (2, 'Canopus', -0.73000001907348633, 'F0Ib')]
-    
+
     >>> print tbdata['mag']  # show the values in field "mag"
     [-1.45000005 -0.73000002 -0.1 ]
     >>> print tbdata.field(1)  # columns can be referenced by index too
@@ -92,7 +92,7 @@ and format in TFORM1.
     which that column contains no data.  In such files, the zero-width columns
     are ommitted when accessing the table data, so the indexes of fields might
     change when using the ``field()`` method.  For this reason, if you expect
-    to encounter files containg zero-width columns it is recommended to access
+    to encounter files containing zero-width columns it is recommended to access
     fields by name rather than by index.
 
 
diff --git a/docs/io/fits/usage/unfamiliar.rst b/docs/io/fits/usage/unfamiliar.rst
index 3d058a0..4e82603 100644
--- a/docs/io/fits/usage/unfamiliar.rst
+++ b/docs/io/fits/usage/unfamiliar.rst
@@ -107,7 +107,7 @@ ASCII tables it is not technically a valid format.  ASCII table format codes
 technically require a character width for each column, such as ``'I10'`` to
 create a column that can hold integers up to 10 characters wide.
 
-However, PyFITS allows the width specification to be ommitted in some cases.
+However, PyFITS allows the width specification to be omitted in some cases.
 When it is ommitted from ``'I'`` format columns the minimum width needed to
 accurately represent all integers in the column is used.  The only problem with
 using this shortcut is its ambiguity with the binary table ``'I'`` format, so
@@ -290,7 +290,7 @@ random access group, and it means to add the values together. Thus::
     2445728.0
     >>> print f[0].data.par(5)[99]
     0.10
-    >>> # When accessed by name, it adds the values together if the name is 
+    >>> # When accessed by name, it adds the values together if the name is
     >>> # shared by more than one parameter
     >>> print f[0].data.par('date')[99]
     2445728.10
diff --git a/docs/known_issues.rst b/docs/known_issues.rst
index 125054b..70c9f3a 100644
--- a/docs/known_issues.rst
+++ b/docs/known_issues.rst
@@ -1,3 +1,5 @@
+.. doctest-skip-all
+
 ============
 Known Issues
 ============
@@ -18,32 +20,69 @@ Quantities are subclassed from numpy's `~numpy.ndarray` and in some numpy operat
 means that either a plain array is returned, or a `~astropy.units.quantity.Quantity` without units.
 E.g.::
 
-    In [1]: import astropy.units as u
-
-    In [2]: import numpy as np
-
-    In [3]: q = u.Quantity(np.arange(10.), u.m)
-
-    In [4]: np.dot(q,q)
-    Out[4]: 285.0
-
-    In [5]: np.hstack((q,q))
-    Out[5]: 
+    >>> import astropy.units as u
+    >>> import numpy as np
+    >>> q = u.Quantity(np.arange(10.), u.m)
+    >>> np.dot(q,q)
+    285.0
+    >>> np.hstack((q,q))
     <Quantity [ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 0., 1., 2., 3., 4.,
                 5., 6., 7., 8., 9.] (Unit not initialised)>
 
+Also in-place operations where the output is a normal `~numpy.ndarray`
+will drop the unit silently (at least in numpy <= 1.9)::
+
+    >>> a = np.arange(10.)
+    >>> a *= 1.*u.kg
+    >>> a
+    array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])
+
 Work-arounds are available for some cases.  For the above::
 
-    In [6]: q.dot(q)
-    Out[6]: <Quantity 285.0 m2>
+    >>> q.dot(q)
+    <Quantity 285.0 m2>
 
-    In [7]: u.Quantity([q, q]).flatten()
-    Out[7]: 
+    >>> u.Quantity([q, q]).flatten()
     <Quantity [ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 0., 1., 2., 3., 4.,
                 5., 6., 7., 8., 9.] m>
 
+An incomplete list of specific functions which are known to exhibit this behavior follows.
+
+* `numpy.dot`
+* `numpy.hstack`, `numpy.vstack`, ``numpy.c_``, ``numpy.r_``, `numpy.append`
+* `numpy.where`
+* `numpy.choose`
+* `numpy.vectorize`
+* pandas DataFrame(s)
+
+
 See: https://github.com/astropy/astropy/issues/1274
 
+Quantities float comparison with np.isclose fails
+-------------------------------------------------
+
+Comparing Quantities floats using the numpy function `~numpy.isclose` fails on
+numpy 1.9 as the comparison between ``a`` and ``b`` is made using the formula
+
+.. math::
+
+    |a - b| \le (a_\textrm{tol} + r_\textrm{tol} \times |b|)
+
+This will result in the following traceback when using this with Quantities::
+
+    >>> from astropy import units as u, constants as const
+    >>> import numpy as np
+    >>> np.isclose(500* u.km/u.s, 300 * u.km / u.s)
+    UnitsError: Can only apply 'add' function to dimensionless quantities when
+    other argument is not a quantity (unless the latter is all zero/infinity/nan)
+
+An easy solution is::
+
+    >>> np.isclose(500* u.km/u.s, 300 * u.km / u.s, atol=1e-8 * u.mm / u.s)
+    array([False], dtype=bool)
+
+
+
 Some docstrings can not be displayed in IPython < 0.13.2
 --------------------------------------------------------
 
@@ -51,9 +90,9 @@ Displaying long docstrings that contain Unicode characters may fail on
 some platforms in the IPython console (prior to IPython version
 0.13.2)::
 
-    In [1]: import astropy.units as u
+    >>> import astropy.units as u
 
-    In [2]: u.Angstrom?
+    >>> u.Angstrom?
     ERROR: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in
     position 184: ordinal not in range(128) [IPython.core.page]
 
diff --git a/docs/modeling/algorithms.rst b/docs/modeling/algorithms.rst
index 0183cd0..5d2dff7 100644
--- a/docs/modeling/algorithms.rst
+++ b/docs/modeling/algorithms.rst
@@ -37,7 +37,7 @@ Multivariate polynomial evaluation
     1. Set *di* to the max number of variables (2 for a 2-D polynomials).
 
     2. Set :math:`r_0` to :math:`c_{\alpha(0)}`, where c is a list of
-       coeeficients for each multiindex in inverse lexical order.
+       coefficients for each multiindex in inverse lexical order.
 
     3. For each monomial, n, in the polynomial:
 
@@ -58,4 +58,4 @@ Multivariate polynomial evaluation
 
 
 
-.. [1] J. M. Pena, Thomas Sauer, "On the Multivariate Horner Scheme", SIAM Journal on Numerical Analysis, Vol 37, No. 4 
+.. [1] J. M. Pena, Thomas Sauer, "On the Multivariate Horner Scheme", SIAM Journal on Numerical Analysis, Vol 37, No. 4
diff --git a/docs/nddata/nddata.rst b/docs/nddata/nddata.rst
index 6410f31..278f081 100644
--- a/docs/nddata/nddata.rst
+++ b/docs/nddata/nddata.rst
@@ -95,7 +95,7 @@ Arithmetic
 ----------
 
 Provided that the world coordinate system (WCS) and shape match, and that the
-units are consisten, two :class:`~astropy.nddata.NDData` instances can be
+units are consistent, two :class:`~astropy.nddata.NDData` instances can be
 added, subtracted, multiplied or divided from each other, with uncertainty
 propagation, creating a new :class:`~astropy.nddata.NDData` object::
 
diff --git a/docs/table/construct_table.rst b/docs/table/construct_table.rst
index a6879b9..4d8025f 100644
--- a/docs/table/construct_table.rst
+++ b/docs/table/construct_table.rst
@@ -141,7 +141,7 @@ The input column data can be any data type that can initialize a |Column| object
   array([(1, [2, 3], 'x'), (4, [5, 6], 'y')],
         dtype=[('a', '<i8'), ('b', '<i8', (2,)), ('c', 'S1')])
 
-Notice that the key ``'c'`` takes precendence over the existing column name
+Notice that the key ``'c'`` takes precedence over the existing column name
 ``'axis'`` in the third column.  Also see that the ``'b'`` column is a vector
 column where each row element is itself a 2-element array.
 
@@ -169,7 +169,7 @@ need to use the ``rows`` keyword to create a table::
   ...              (5, 8.2, 'z')]
   >>> t = Table(rows=data_rows, names=('a', 'b', 'c'))
   >>> print(t)
-   a   b   c 
+   a   b   c
   --- --- ---
     1 2.0   x
     4 5.0   y
@@ -221,13 +221,14 @@ the difference between a scalar ``1`` (length 0) and an array like
 
 NumPy structured array
 """"""""""""""""""""""
-The structured array is the standard mechanism in `numpy` for storing heterogenous
-table data.  Most scientific I/O packages that read table files (e.g.
-`PyFITS <http://www.stsci.edu/resources/software_hardware/pyfits>`_,
-`vo.table <http://stsdas.stsci.edu/astrolib/vo/html/intro_table.html>`_,
-`asciitable <http://cxc.harvard.edu/contrib/asciitable/>`_)
-will return the table in an object that is based on the structured array.
-A structured array can be created using::
+The structured array is the standard mechanism in `numpy` for storing
+heterogeneous table data.  Most scientific I/O packages that read table
+files (e.g.  `PyFITS
+<http://www.stsci.edu/resources/software_hardware/pyfits>`_, `vo.table
+<http://stsdas.stsci.edu/astrolib/vo/html/intro_table.html>`_, `asciitable
+<http://cxc.harvard.edu/contrib/asciitable/>`_) will return the table in an
+object that is based on the structured array.  A structured array can be
+created using::
 
   >>> arr = np.array([(1, 2.0, 'x'),
   ...                 (4, 5.0, 'y')],
@@ -761,7 +762,7 @@ subclasses, but in practice you would override only the necessary subcomponents:
 
 
 Example
-""""""""
+"""""""
 
 As a more practical example, suppose you have a table of data with a certain set of fixed
 columns, but you also want to carry an arbitrary dictionary of keyword=value
@@ -789,7 +790,7 @@ are contained in a numpy object-dtype column named ``params``::
   ...    def values(self):
   ...        return [self[key] for key in self.keys()]
 
-Now we put this into action with a trival |Table| subclass::
+Now we put this into action with a trivial |Table| subclass::
 
   >>> class ParamsTable(Table):
   ...     Row = ParamsRow
diff --git a/docs/time/index.rst b/docs/time/index.rst
index 95063aa..2112cb0 100644
--- a/docs/time/index.rst
+++ b/docs/time/index.rst
@@ -153,7 +153,7 @@ yday       :class:`~astropy.time.TimeYearDayTime`             2000:001:00:00:00.
 =========  =================================================  ==============================
 
 Subformat
-""""""""""
+"""""""""
 
 The time format classes :class:`~astropy.time.TimeISO`,
 :class:`~astropy.time.TimeISOT`, and
diff --git a/docs/units/decomposing_and_composing.rst b/docs/units/decomposing_and_composing.rst
index 2a01e35..915f28c 100644
--- a/docs/units/decomposing_and_composing.rst
+++ b/docs/units/decomposing_and_composing.rst
@@ -80,13 +80,13 @@ Built on top of this functionality is a convenience method to convert
 between unit systems.
 
    >>> u.Pa.to_system(u.cgs)
-   [Unit("10 Ba")]
+   [Unit("10 P / s"), Unit("10 Ba")]
 
 There is also a shorthand for this which only returns the first of
 many possible matches::
 
    >>> u.Pa.cgs
-   Unit("10 Ba")
+   Unit("10 P / s")
 
 This is equivalent to decomposing into the new system and then
 composing into the most complex units possible, though
@@ -96,4 +96,4 @@ return the results sorted in the most useful order::
    >>> u.Pa.decompose(bases=u.cgs.bases)
    Unit("10 g / (cm s2)")
    >>> _.compose(units=u.cgs)
-   [Unit("10 Ba")]
+   [Unit("10 Ba"), Unit("10 P / s")]
diff --git a/docs/units/format.rst b/docs/units/format.rst
index e1ca602..b9750bf 100644
--- a/docs/units/format.rst
+++ b/docs/units/format.rst
@@ -14,7 +14,7 @@ You can control the way that |quantity| and |unit| objects are rendered as
 strings using the new `Format String Syntax
 <http://docs.python.org/library/string.html#format-string-syntax>`__.
 New-style format strings use the ``"{}".format()`` syntax.  Most of
-the format speficiers are simliar to the old ``%``-style formatting,
+the format specifiers are similar to the old ``%``-style formatting,
 so things like ``0.003f`` still work, just in the form
 ``"{:0.003f}".format()``.
 
diff --git a/docs/vo/samp/example_table_image.rst b/docs/vo/samp/example_table_image.rst
index c51be7b..e6290ed 100644
--- a/docs/vo/samp/example_table_image.rst
+++ b/docs/vo/samp/example_table_image.rst
@@ -265,7 +265,7 @@ Receiving a table from Ds9 or Aladin
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Receiving images over SAMP is identical to `Receiving a table from TOPCAT`_,
-with the execption that the message type should be ``image.load.fits`` instead
+with the exception that the message type should be ``image.load.fits`` instead
 of ``table.load.votable``. Once the URL has been received, the FITS image can
 be opened with::
 
diff --git a/docs/wcs/examples/from_file.py b/docs/wcs/examples/from_file.py
index b43be74..86f3077 100644
--- a/docs/wcs/examples/from_file.py
+++ b/docs/wcs/examples/from_file.py
@@ -10,7 +10,7 @@ import sys
 
 def load_wcs_from_file(filename):
     # Load the FITS hdulist using astropy.io.fits
-    hdulist = fits.open(sys.argv[-1])
+    hdulist = fits.open(filename)
 
     # Parse the WCS keywords in the primary HDU
     w = wcs.WCS(hdulist[0].header)
diff --git a/docs/wcs/index.rst b/docs/wcs/index.rst
index 99f4cc0..6e5b121 100644
--- a/docs/wcs/index.rst
+++ b/docs/wcs/index.rst
@@ -99,6 +99,8 @@ saves those settings to a new FITS header.
 .. literalinclude:: examples/programmatic.py
    :language: python
 
+.. _wcslint:
+
 Validating the WCS keywords in a FITS file
 ------------------------------------------
 
diff --git a/setup.py b/setup.py
index c73d7ff..b754824 100755
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ from astropy_helpers.version_helpers import generate_version_py
 NAME = 'astropy'
 
 # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
-VERSION = '0.4.2'
+VERSION = '0.4.3'
 
 # Indicates if this version is a release version
 RELEASE = 'dev' not in VERSION

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/python-astropy.git



More information about the debian-science-commits mailing list